## `zeta` -- the Riemann zeta function

#### Introduction

`zeta``(z)` represents the Riemann zeta function sum(k^(-z),k=1..infinity).

#### Call(s)

`zeta(z)`

#### Parameters

`z` | - | an arithmetical expression

#### Returns

an arithmetical expression.

### Overloadable:

`z`

#### Side Effects

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

#### Related Functions

`bernoulli`

#### Details

- The zeta function is defined for all complex arguments except for the simple pole z=1.
- A floating point result is returned for floating point arguments.
- The following special values are implemented: zeta(z)=0 for even integers z<0, zeta(z)=-bernoulli(z)/(1-z) for odd integers z<0, zeta(0)=-1/2, zeta(z)=(2*PI)^z*abs(bernoulli(z))/2/fact(z) for even integers z>0.

  `zeta` returns an unevaluated function call, if the argument does not evaluate to one of the above numbers.

- The float attribute of `zeta` is a kernel function, i.e., floating point evaluation is fast. Use `zeta(float(z))` rather than `float(zeta(z))`, because the evaluation of the intermediate exact result `zeta(z)` may be costly for integers `z` of large absolute value.

#### Example 1

We demonstrate some calls with exact and symbolic input data:

    >> zeta(-6), zeta(-5), zeta(-4), zeta(-3), zeta(-2), zeta(-1)

                           0, -1/252, 0, 1/120, 0, -1/12

    >> zeta(0), zeta(2), zeta(3), zeta(4), zeta(5), zeta(6), zeta(7)

                          2             4             6
                        PI            PI            PI
                  -1/2, ---, zeta(3), ---, zeta(5), ---, zeta(7)
                         6            90            945

    >> zeta(1/2), zeta(1 + I), zeta(z^2 -I)

                                                     2
                       zeta(1/2), zeta(1 + I), zeta(z  - I)

Floating point values are computed for floating point arguments:

    >> zeta(-1001.0), zeta(12.3), zeta(0.5 + 14.13472514*I)

          -1.348590824e1771, 1.000199699,

             0.0000000002163160213 - 0.000000001358779595 I

`zeta` has a pole at the point z=1:

    >> zeta(1)

          Error: singularity [zeta]

#### Example 2

Looking for roots of the Zeta function, we plot the function f(z)=abs(zeta(z)) along the ``critical line'' of complex numbers with real part 1/2:

    >> plotfunc2d(Labels = ["", ""], Title = "", Grid = 500,
                  abs(zeta(1/2 + y*I)), y = 0..30)

The following procedure is a simple implementation of the usual Newton method for finding numerical roots of zeta. Note that numeric differentiation is used within the Newton step, because MuPAD does not provide a symbolic derivative of `zeta`:

    >> NewtonStep := proc(z)
       local h, f, f2, fprime;
       begin
         z := float(z);
         h := 10^(-DIGITS/2.0)*(1 + abs(z));
         f := zeta(z);
         f2 := zeta(z + h);
         fprime := (f2 - f)/h;
         return(z - f/fprime)
       end_proc:

The sequence `z:=NewtonStep(z)` converges to a root, if the initial value is a sufficiently good approximation of the root:

    >> z:= 1/2 + 21*I:  z := NewtonStep(z): z, abs(zeta(z))

                   0.5002926366 + 21.0220145 I, 0.0003338475592

    >> z := NewtonStep(z): z, abs(zeta(z))

                 0.4999999108 + 21.02203966 I, 0.0000001039451698

    >> z := NewtonStep(z): z, abs(zeta(z))

                       0.5 + 21.02203964 I, 1.387291733e-11

    >> delete NewtonStep, z:

#### Changes

- Explicit expressions are now returned for all negative integer arguments and all positive even integer arguments.

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