Skip to Main Content Skip to Search
Product Documentation

gamma - Gamma function

Syntax

gamma(x)
gamma(A)

Description

gamma(x) returns the gamma function of a symbolic variable or symbolic expression x.

gamma(A) returns the gamma function of the elements of a symbolic vector or a symbolic matrix A.

Input Arguments

x

Symbolic number, variable, or expression.

A

Vector or matrix of symbolic numbers, variables, or expressions.

Definitions

gamma Function

The following integral defines the gamma function:

Examples

Differentiate the gamma function, and then substitute the variable t with the value 1:

syms t
u = diff(gamma(t^3 + 1))
subs(u, 1)
u =
3*t^2*gamma(t^3 + 1)*psi(t^3 + 1)

ans =
    1.2684
 

Compute the limit of the following expression that involves the gamma function:

syms x
limit(x/gamma(x), x, inf)
ans =
0
 

Simplify the following expression:

syms x
simplify(gamma(x)*gamma(1 - x))
ans =
pi/sin(pi*x)

See Also

beta | factorial | mfun | mfunlist | nchoosek | psi

How To

  


Free Symbolic Math Interactive Kit

See how symbolic computations can help you find analytical solutions to math and engineering problems.

Get free kit

Trials Available

Try the latest version of symbolic math products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS