## `beta` -- the beta function

#### Introduction

`beta``(x, y)` represents the beta function gamma(x)*gamma(y)/gamma(x+y).

#### Call(s)

`beta(x, y)`

#### Parameters

`x, y` | - | arithmetical expressions

#### Returns

an arithmetical expression.

### Overloadable:

`x`

#### Side Effects

When called with floating point arguments, the function is sensitive to the environment variable `DIGITS` which determines the numerical working precision.

#### Related Functions

`gamma`, `psi`

#### Details

- The beta function is defined for complex arguments x and y.
- The result is expressed by calls to the gamma function if both arguments are of type `Type::Numeric`. Note that the beta function may have a regular value, even if gamma(x) or gamma(y) and gamma(x+y) are singular. In such cases `beta` returns the limit of the quotients of the singular terms.
- A floating point value is returned if both arguments are numerical and at least one of them is a floating point value.
- An unevaluated call of `beta` is returned, if none of the arguments vanishes and at least one of the arguments does not evaluate to a number of type `Type::Numeric`.

#### Example 1

We demonstrate some calls with exact and symbolic input data:

    >> beta(1, 5), beta(I, 3/2), beta(1, y + 1), beta(x, y)

                             1/2
                           PI    gamma(I)     1
                     1/5, ----------------, -----, beta(x, y)
                          2 gamma(3/2 + I)  y + 1

Floating point values are computed for floating point arguments:

    >> beta(3.5, sqrt(2)), beta(sqrt(2), 2.0 + 10.0*I)

                  0.1395855454, - 0.01112350756 - 0.03108193098 I

#### Example 2

The gamma function is singular if its argument is a nonpositive integer. Nevertheless, `beta` has a regular value for the following arguments:

    >> beta(-3, 2)

                                        1/6

#### Example 3

The functions `diff`, `expand` and `float` handle expressions involving `beta`:

    >> diff(beta(x^2, x), x)

                     2                     2             2
            beta(x, x ) (psi(x) + 2 x psi(x ) - psi(x + x ) (2 x + 1))

    >> expand(beta(x - 1, y + 1))

                               y gamma(x) gamma(y)
                               --------------------
                               gamma(x + y) (x - 1)

    >> float(beta(100, 1000))

                                 7.730325902e-147

#### Changes

- The `expand` attribute now rewrites `beta` in terms of `gamma` and expands the result.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000