Gamma, GammaNum , Zeta, ZetaNum , Bernoulli, BernoulliArray , Euler , LambertW, LambertWNum , gamma , GoldenRatio , Catalan .

# Special functions

In this chapter, special and transcendental mathematical functions are described.

Gamma, GammaNum | Euler's Gamma function
Zeta, ZetaNum | Riemann's Zeta function
Bernoulli, BernoulliArray | Bernoulli numbers and polynomials
Euler | Euler numbers and polynomials
LambertW, LambertWNum | Lambert's W function
gamma | Euler's constant gamma
GoldenRatio | the Golden Ratio
Catalan | Catalan's Constant

###

Gamma, GammaNum -- Euler's Gamma function

##### Standard library

##### Calling format:

    Gamma(x)
    GammaNum(number)

##### Parameters:

`x` -- expression

`number` -- expression that can be evaluated to a number

##### Description:

`Gamma(x)` is an interface to Euler's Gamma function Gamma(x). It returns exact values on integer and half-integer arguments. `GammaNum(x)` or equivalently `N(Gamma(x)` takes a numeric parameter and always returns a floating-point number in the current precision.

Note that Euler's constant gamma<=>0.57722 is the lowercase `gamma` in Yacas.

##### Examples:

    In> Precision(30)
    Out> True;
    In> Gamma(1.3)
    Out> Gamma(1.3);
    In> N(Gamma(1.3))
    Out> 0.897470696306277188493754954771;
    In> Gamma(1.5)
    Out> Sqrt(Pi)/2;
    In> GammaNum(1.5);
    Out> 0.88622692545275801364908374167;

##### See also:

! , N , gamma .

###

Zeta, ZetaNum -- Riemann's Zeta function

##### Standard library

##### Calling format:

    Zeta(x)
    ZetaNum(number)

##### Parameters:

`x` -- expression

`number` -- expression that can be evaluated to a number

##### Description:

`Zeta(x)` is an interface to Riemann's Zeta function zeta(s). It returns exact values on integer and half-integer arguments. `ZetaNum(x)` or equivalently `N(Zeta(x)` takes a numeric parameter and always returns a floating-point number in the current precision.

##### Examples:

    In> Precision(30)
    Out> True;
    In> Zeta(1)
    Out> Infinity;
    In> Zeta(1.3)
    Out> Zeta(1.3);
    In> N(Zeta(1.3))
    Out> 3.93194921180954422697490751058798;
    In> Zeta(2)
    Out> Pi^2/6;
    In> ZetaNum(2);
    Out> 1.64493406684822643647241516664602;

##### See also:

! , N .

###

Bernoulli, BernoulliArray -- Bernoulli numbers and polynomials

##### Standard library

##### Calling format:

    Bernoulli(index)
    BernoulliArray(index)
    Bernoulli(index, x)

##### Parameters:

`x` -- expression that will be the variable in the polynomial

`index` -- expression that can be evaluated to an integer

##### Description:

`Bernoulli(n)` evaluates the n-th Bernoulli number. `Bernoulli(n, x)` returns the n-th Bernoulli polynomial in the variable x. The polynomial is returned in the Horner form.

An auxiliary function `BernoulliArray(n)` might be useful too: it returns an array (of type `GenericArray`) of Bernoulli numbers up to n. The array is 1-based, so that the n-th Bernoulli number is `BernoulliArray(n)[n+1]`.

##### Example:

    In> Bernoulli(20);
    Out> -174611/330;
    In> Bernoulli(4, x);
    Out> ((x-2)*x+1)*x^2-1/30;

##### See also:

Gamma , Zeta .

###

Euler -- Euler numbers and polynomials

##### Standard library

##### Calling format:

    Euler(index)
    Euler(index,x)

##### Parameters:

`x` -- expression that will be the variable in the polynomial

`index` -- expression that can be evaluated to an integer

##### Description:

`Euler(n)` evaluates the n-th Euler number. `Euler(n,x)` returns the n-th Euler polynomial in the variable x.

##### Examples:

    In> Euler(6)
    Out> -61;
    In> A:=Euler(5,x)
    Out> (x-1/2)^5+(-10*(x-1/2)^3)/4+(25*(x-1/2))/16;
    In> Simplify(A)
    Out> (2*x^5-5*x^4+5*x^2-1)/2;

##### See also:

Bin .

###

LambertW, LambertWNum -- Lambert's W function

##### Standard library

##### Calling format:

    LambertW(x)
    LambertWNum(x)

##### Parameters:

`x` -- expression, argument of the function

##### Description:

Lambert's W function is (a multiple-valued, complex function) defined for any (complex) z by

W(z)*Exp(W(z))=z.
This function is sometimes useful to represent solutions of transcendental equations. For example, the equation Ln(x)=3*x can be "solved" by writing x= -3*W(-1/3). It is also possible to take a derivative or integrate this function "explicitly".

For real arguments x, W(x) is real if x>= -Exp(-1).

`LambertWNum` is an auxiliary function that computes the numerical value of the principal branch of Lambert's W function for real arguments x>= -Exp(-1) to current precision.

##### Examples:

    In> LambertW(0)
    Out> 0;
    In> N(LambertW(-0.24/Sqrt(3*Pi)))
    Out> -0.0851224014;

##### See also:

Exp .

###

gamma -- Euler's constant gamma

##### Standard library

##### Calling format:

    N(gamma)
    gamma()

##### Description:

These functions compute Euler's constant gamma<=>0.57722...

The constant is available symbolically as `gamma` or numerically as a function `gamma()`. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(gamma)`. The low-level numerical computations are performed by the routine `GammaConstNum`.

Note that Euler's Gamma function Gamma(x) is the capitalized `Gamma` in Yacas.

##### Examples:

    In> gamma+Pi
    Out> gamma+Pi;
    In> N(gamma+Pi)
    Out> 3.7188083184;
    In> [Precision(20);V(gamma());]

    CachedConstant: Info: constant gamma is being
      recalculated at precision 20
    GammaConstNum: Info: used 56 iterations at
      working precision 24
    Out> 0.57721566490153286061;

##### See also:

Gamma , N , CachedConstant .

###

GoldenRatio -- the Golden Ratio

##### Standard library

##### Calling format:

    N(GoldenRatio)
    GoldenRatio()

##### Description:

These functions compute the "golden ratio"

phi<=>1.6180339887<=>(1+Sqrt(5))/2.

The ancient Greeks defined the "golden ratio" as follows: If one divides a length 1 into two pieces x and 1-x, such that the ratio of 1 to x is the same as the ratio of x to 1-x, then 1/x<=>1.618... is the "golden ratio".

The constant is available symbolically as `GoldenRatio` or numerically as a function `GoldenRatio()`. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(GoldenRatio)`.

##### Examples:

    In> x:=GoldenRatio - 1
    Out> GoldenRatio-1;
    In> N(x)
    Out> 0.6180339887;
    In> N(1/GoldenRatio)
    Out> 0.6180339887;
    In> [Precision(20);V(GoldenRatio());]

    CachedConstant: Info: constant GoldenRatio is
    being recalculated at precision 20
    Out> 1.6180339887498948482;

##### See also:

N , CachedConstant .

###

Catalan -- Catalan's Constant

##### Standard library

##### Calling format:

    N(Catalan)
    Catalan()

##### Description:

These functions compute Catalan's Constant Catalan<=>0.9159655941.

The constant is available symbolically as `Catalan` or numerically as a function `Catalan()`. This is a "cached constant" which is recalculated only when precision is increased. The numerical value of the constant can also be obtained as `N(Catalan)`. The low-level numerical computations are performed by the routine `CatalanConstNum`.

##### Examples:

    In> N(Catalan)
    Out> 0.9159655941;
    In> DirichletBeta(2)
    Out> Catalan;
    In> [Precision(20);V(Catalan());]

    CachedConstant: Info: constant Catalan is
    being recalculated at precision 20
    Out> 0.91596559417721901505;

##### See also:

N , CachedConstant .