The Lerch Transcendent

The Lerch Transcendent, `Phi(z,s,a)` is a special function which is a special case of the Gauss Hypergeometric function 2F1. It has utility in chemical kinetics arising in the solution for the Parallel-Consecutive Bimolecular mechanism. The Lerch transcendent is the analytic continuation of the series,

`Phi(z,s,a)=1/a^s+z/(a+1)^s+z^2/(a+2)^s+z^3/(a+3)^s+...`

Series Expansion

`Phi(z,s,a)=sum_(n=0)^(oo) z^n/(a+n)^s`

The series is rapidly convergent for z<1 and s=1, and is accurate to around 5 s.f. when the series is truncated to the first 5 terms.

Integral Representation

`Phi(z,1,a)=int_0^1 (x^(a-1))/(1-zx) dx`

Algorithms for Evaluation

On this website, we evaluate the Lerch Transcendent using JScript, since this is cross-browser compliant. We use the code below,

function LPhi(z,s,a,m)
//The Lerch Transcendent Function in JScript
//m is the number of terms to include (5 is not a bad number for use in websites
{
	var rval=0
	for (var n = 0; n <= m; n++){
		rval=rval+Math.pow(z,n)/Math.pow((a+n),s);
	}
	return rval;
}

Alternatively, in Excel, we use VBScript, which is the native language of Microsoft Office Macro's. I drop this function in a VB Module inside a Macro-enabled Excel spreadsheet, that way the function can be called directly as a formula in a cell. We use this code instead,

function Phi(z as double, s as integer, a as double, m as integer)
'm is the number of terms to include. In Excel I use m=10
	dim n, out
	Phi = 0
	for n = 0 to m
		out = out + z^n / (a+n)^s
	next
	Phi = out
end function