Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Factorial Calculator

Factorial

Function: factorial (<x>) Represents the factorial function. Maxima treats factorial (<x>) the same as <x>!. See !.

f(x):=sin(x);
g(n,x):=sum((-x)^(2*i+1)/factorial(2*i+1),i,0,n);
plot2d([f(x),g(2,x)],[x,-2,2])

-- Operator: ! The factorial operator.

For any complex number x, except for negative integers, x! is defined as gamma(x+1).

For an integer x, x! simplifies to the product of the integers from 1 to x inclusive. 0! simplifies to 1. For a real or complex number in float or bigfloat precision x, x! simplifies to the value of gamma (x+1). For x equal to n/2 where n is an odd integer, x! simplifies to a rational factor times sqrt

     (%pi) (since gamma (1/2) is equal to sqrt (%pi)).

The option variables factlim and gammalim control the numerical evaluation of factorials for integer and rational arguments. The functions minfactorial and factcomb simplifies expressions containing factorials. See factlim, gammalim, minfactorial and factcomb.

The functions gamma, bffac, and cbffac are varieties of the gamma function. bffac and cbffac are called internally by gamma to evaluate the gamma function for real and complex numbers in bigfloat precision.

makegamma substitutes gamma for factorials and related functions.

Maxima knows the derivative of the factorial function and the limits for specific values like negative integers.

The option variable factorial_expand controls the simplification of expressions like (n+x)!, where n is an integer.

See also binomial.

The factorial of an integer is simplified to an exact number unless the operand is greater than factlim. The factorial for real and complex numbers is evaluated in float or bigfloat precision.

          (%i1) factlim:10;
          (%o1)                                 10
          (%i2) [0!, (7/2)!, 8!, 20!];
                                      105 sqrt(%pi)
          (%o2)                   [1, -------------, 40320, 20!]
                                           16
          (%i3) [4.77!, (1.0+%i)!];
          (%o3)    [81.44668037931197,
                    .3430658398165454 %i + .6529654964201665]
          (%i4) [2.86b0!, (1.0b0+%i)!];
          (%o4) [5.046635586910012b0,
                 3.430658398165454b-1 %i + 6.529654964201667b-1]

The factorial of a known constant, or general expression is not simplified. Even so it may be possible to simplify the factorial after evaluating the operand.

          (%i1) [(%i + 1)!, %pi!, %e!, (cos(1) + sin(1))!];
          (%o1)      [(%i + 1)!, %pi!, %e!, (sin(1) + cos(1))!]
          (%i2) ev (%, numer, %enumer);
          (%o2) [.3430658398165454 %i + .6529654964201665,
                 7.188082728976031,
                 4.260820476357003, 1.227580202486819]

Factorials are simplified, not evaluated. Thus x! may be replaced even in a quoted expression.

          (%i1) ([0!, (7/2)!, 4.77!, 8!, 20!]);
                    105 sqrt(%pi)
          (%o1) [1, -------------, 81.44668037931199, 40320,
                         16
                                                       2432902008176640000]

Maxima knows the derivative of the factorial function.

          (%i1) diff(x!,x);
          (%o1)                           x! psi (x + 1)
                                                0

The option variable factorial_expand controls expansion and simplification of expressions with the factorial function.

          (%i1) (n+1)!/n!,factorial_expand:true;
          (%o1)                                n + 1

There are also some inexact matches for factorial. Try ?? factorial to see them.

(%o1)                                true
(%i2) 

Factorial Example

Related Examples

factorial-subst

f:e^x=1+x+1/2*x^2+1/f...

f1:subst(x=0.43,f);

Calculate

factorial-plot2d-sin-sum
plot2d([g(1,x),g(2,x),g(3,x),g(4,x),f(x)],[x,-5,5],[y,-5,5]);

f(x):=sin(x);

g(n,x):=sum((-1)^i*x^...

plot2d([g(1,x),g(2,x)...

Calculate

factorial-inf-sum-true

sum(20^k/factorial(k)...

Calculate

factorial-inf-limit-sum-true

S : sum(20^k/factoria...

limit(S, n, inf);

Calculate

factorial-inf-log

lomot(log(factorial(n...

Calculate

factorial

factorial(7);

Calculate

factorial-inf-limit-sum

S : sum(20^k/factoria...

limit(S, n, inf);

Calculate

factorial-inf-limit-log-sqrt

limit ( (n/log(n)) / ...

limit ( (log(n)^2) / ...

limit ( (log(factoria...

Calculate

factorial-plot2d-sin-sum
plot2d([s,sin(x)],[x,0,20*%pi]);

s:sum((-1)^n*x^(2*n+1...

plot2d([s,sin(x)],[x,...

Calculate

factorial

factorial(30) / facto...

Calculate