scipy.special.spence

scipy.special.spence(z, out=None) = <ufunc 'spence'>

Spence’s function, also known as the dilogarithm.

It is defined to be

\[\int_1^z \frac{\log(t)}{1 - t}dt\]

for complex \(z\), where the contour of integration is taken to avoid the branch cut of the logarithm. Spence’s function is analytic everywhere except the negative real axis where it has a branch cut.

Parameters
zarray_like

Points at which to evaluate Spence’s function

Returns
sndarray

Computed values of Spence’s function

Notes

There is a different convention which defines Spence’s function by the integral

\[-\int_0^z \frac{\log(1 - t)}{t}dt;\]

this is our spence(1 - z).