Skip to content

HeunG (General Heun Function)

The general Heun equation is the most general second-order Fuchsian ordinary differential equation with four regular singular points. After a Möbius transformation, these singularities can be placed at

z=0,  1,  a,  ,a0,1.z = 0,\; 1,\; a,\; \infty,\qquad a\neq 0,1.

The function commonly called HeunG in computer algebra systems is the normalized Frobenius solution around z=0z=0 corresponding to the exponent 00:

  • it is analytic at z=0z=0,
  • it satisfies y(0)=1y(0)=1,
  • it depends on an accessory parameter qq that controls global analytic behavior and typically becomes an eigenvalue in boundary value problems.

1. Canonical general Heun equation and parameters

Section titled “1. Canonical general Heun equation and parameters”

The canonical (general) Heun equation is commonly written as

d2ydz2+(γz+δz1+ϵza)dydz+αβzqz(z1)(za)y=0,\frac{d^2y}{dz^2} +\left(\frac{\gamma}{z}+\frac{\delta}{z-1}+\frac{\epsilon}{z-a}\right)\frac{dy}{dz} +\frac{\alpha\beta\, z-q}{z(z-1)(z-a)}\,y=0,

with complex parameters (a,q,α,β,γ,δ,ϵ)(a,q,\alpha,\beta,\gamma,\delta,\epsilon) and with

a0,1.a\neq 0,1.

The parameters are not independent: Fuchsian balance at infinity implies

γ+δ+ϵ=α+β+1,equivalentlyϵ=α+βγδ+1.\gamma+\delta+\epsilon=\alpha+\beta+1, \qquad\text{equivalently}\qquad \epsilon=\alpha+\beta-\gamma-\delta+1.

The equation is Fuchsian with regular singularities at

z=0,  1,  a,  .z=0,\;1,\;a,\;\infty.

A convenient way to summarize local exponents is via the Riemann PP-symbol:

P{01a000α1γ1δ1ϵβ  |  z},P\left\{ \begin{matrix} 0&1&a&\infty\\ 0&0&0&\alpha\\ 1-\gamma&1-\delta&1-\epsilon&\beta \end{matrix} \;\middle|\; z \right\},

meaning that the pairs of characteristic exponents are

  • at z=0z=0: 0,  1γ0,\;1-\gamma,
  • at z=1z=1: 0,  1δ0,\;1-\delta,
  • at z=az=a: 0,  1ϵ0,\;1-\epsilon,
  • at z=z=\infty: α,  β\alpha,\;\beta.
  • aa locates the third finite singular point (in addition to 00 and 11). It is often called the singularity parameter.
  • qq is the accessory parameter. Unlike (α,β,γ,δ,ϵ)(\alpha,\beta,\gamma,\delta,\epsilon) (which fix exponent data), qq is not determined by local exponents; in applications it frequently plays the role of an eigenvalue fixed by global boundary/regularity conditions.

2. Definition of the general Heun function HeunG

Section titled “2. Definition of the general Heun function HeunG”

2.1 Local (Frobenius) solution at the origin

Section titled “2.1 Local (Frobenius) solution at the origin”

Among the two local Frobenius solutions about z=0z=0, the one corresponding to exponent 00 is analytic at z=0z=0 and can be normalized by setting y(0)=1y(0)=1. This normalized local solution is what most CAS call the general Heun function:

Definition (local):
HeunG(a,q,α,β,γ,δ;z) is the solution of the canonical Heun equation that is analytic at z=0z=0 and satisfies

HeunG(a,q,α,β,γ,δ;0)=1.\mathrm{HeunG}(a,q,\alpha,\beta,\gamma,\delta;0)=1.

In the Ronveaux (1995) convention, this same object is often denoted

Hl(a,q;α,β,γ,δ;z),Hl(a,q;\alpha,\beta,\gamma,\delta;z),

with ϵ\epsilon understood implicitly through ϵ=α+βγδ+1\epsilon=\alpha+\beta-\gamma-\delta+1.

2.2 The second local solution at z=0z=0

Section titled “2.2 The second local solution at z=0z=0z=0”

Generically (when γZ\gamma\notin\mathbb{Z}), the second local solution behaves like

y(z)z1γ(z0).y(z)\sim z^{\,1-\gamma}\quad(z\to 0).

When γZ\gamma\in\mathbb{Z}, the exponent difference 1γ1-\gamma is an integer and the second local solution may involve a logz\log z term (“logarithmic case”). This is one of the main sources of special-function subtlety for Heun equations.

2.3 Quickstart in CAS (Maple and Wolfram Language)

Section titled “2.3 Quickstart in CAS (Maple and Wolfram Language)”

Most researchers first use HeunG through a CAS. The two most common interfaces are:

Maple

HeunG(a, q, alpha, beta, gamma, delta, z);
HeunGPrime(a, q, alpha, beta, gamma, delta, z); # derivative w.r.t. z

Wolfram Language / Mathematica

HeunG[a, q, α, β, γ, δ, z]
HeunGPrime[a, q, α, β, γ, δ, z] (* derivative w.r.t. z *)

Both systems use the same parameter order (a,q,α,β,γ,δ;z)(a,q,\alpha,\beta,\gamma,\delta;z) and the same canonical differential equation in §1, with the same normalization y(0)=1y(0)=1.

A good habit (especially when inheriting conventions from a paper) is to ask the CAS for its own definition:

  • Maple: FunctionAdvisor(definition, HeunG);
  • Wolfram Language: consult the built-in HeunG documentation page.

3. Power-series expansion: coefficients and recurrence

Section titled “3. Power-series expansion: coefficients and recurrence”

For the exponent-00 local solution about z=0z=0, use the series

y(z)=r=0crzr,c00,y(z)=\sum_{r=0}^{\infty}c_r z^r,\qquad c_0\neq 0,

and impose the standard normalization

c0=1.c_0=1.

Substituting the series into the Heun equation yields a three-term recurrence. The starting relation is

qc0+aγc1=0c1=qaγ(γ0).-q\,c_0 + a\gamma\,c_1 = 0 \qquad\Rightarrow\qquad c_1=\frac{q}{a\gamma}\quad(\gamma\neq 0).

For r1r\ge 1,

Prcr1(Qr+q)cr+Rrcr+1=0,P_r\,c_{r-1} - (Q_r+q)\,c_r + R_r\,c_{r+1}=0,

where

Pr=(r1+α)(r1+β),P_r=(r-1+\alpha)(r-1+\beta), Qr=r[(r1+γ)(1+a)+aδ+ϵ],Q_r=r\Big[(r-1+\gamma)(1+a)+a\delta+\epsilon\Big], Rr=(r+1)(r+γ)a,R_r=(r+1)(r+\gamma)a,

and ϵ=α+βγδ+1\epsilon=\alpha+\beta-\gamma-\delta+1.

Equivalently, the forward form is

cr+1=(Qr+q)crPrcr1Rr(r1),c_{r+1}=\frac{(Q_r+q)c_r - P_r c_{r-1}}{R_r}\qquad(r\ge 1),

with the convention c1=0c_{-1}=0.

The power series about z=0z=0 converges up to the nearest singularity. Since the finite singularities other than 00 are at z=1z=1 and z=az=a,

radius of convergence=min(1,a).\text{radius of convergence} = \min(1,|a|).

So:

  • if a>1|a|>1, the disk of convergence is typically z<1|z|<1,
  • if a<1|a|<1, the disk is typically z<a|z|<|a|.

This matters in practice: when aa is close to 00 or 11, the local series can have a very small domain of convergence.


A standard way to write the second independent local solution at z=0z=0 (generic case) is

y2(z)=z1γy~(z),y_2(z)=z^{1-\gamma}\,\tilde y(z),

where y~(z)\tilde y(z) is again a local Heun function with shifted parameters.

One explicit parameter shift is

αα+1γ,ββ+1γ,γ2γ,δδ,ϵϵ,\alpha\mapsto \alpha+1-\gamma,\quad \beta\mapsto \beta+1-\gamma,\quad \gamma\mapsto 2-\gamma,\quad \delta\mapsto \delta,\quad \epsilon\mapsto \epsilon,

and

qqII=q+(aδ+ϵ)(1γ).q\mapsto q_{II}=q+(a\delta+\epsilon)(1-\gamma).

So a local basis near z=0z=0 is

y1(z)=Hl(a,q;α,β,γ,δ;z),y_1(z)=Hl(a,q;\alpha,\beta,\gamma,\delta;z), y2(z)=z1γHl(a,qII;α+1γ,β+1γ,2γ,δ;z).y_2(z)=z^{1-\gamma}\,Hl(a,q_{II};\alpha+1-\gamma,\beta+1-\gamma,2-\gamma,\delta;z).

This is the direct analog of the hypergeometric basis 2F1{}_2F_1 and z1c2F1z^{1-c}{}_2F_1.


Heun theory is transformation-heavy. Two families are particularly important:

  1. Möbius transformations of zz (permuting {0,1,a,}\{0,1,a,\infty\}).
  2. Prefactor transformations of yy of the form y=zρ(z1)σ(za)τy~y=z^{\rho}(z-1)^{\sigma}(z-a)^{\tau}\tilde y to swap exponent choices.

Together these generate many equivalent local series representations (often summarized as “192192 series”), but they reduce to the expected eight local solutions: two around each singularity.

One especially useful identity relates expansions at aa and 1/a1/a:

Hl(a,q;α,β,γ,δ;z)=Hl ⁣(1a,qa;α,β,γ,α+βγδ+1;za).Hl(a,q;\alpha,\beta,\gamma,\delta;z) = Hl\!\left(\frac{1}{a},\frac{q}{a};\alpha,\beta,\gamma,\alpha+\beta-\gamma-\delta+1;\frac{z}{a}\right).

This can be used to move aa inside or outside the unit disk to improve convergence regions.

5.2 An example where the accessory parameter transforms nontrivially

Section titled “5.2 An example where the accessory parameter transforms nontrivially”

For the change of variables ζ=z/(z1)\zeta = z/(z-1), one finds an identity of the form

Hl(a,q;α,β,γ,δ;z)=Hl ⁣(aa1,q+αγaa1;α,αδ+1,γ,α+β+1;zz1).Hl(a,q;\alpha,\beta,\gamma,\delta;z) = Hl\!\left(\frac{a}{a-1},\frac{q+\alpha\gamma a}{a-1};\alpha,\alpha-\delta+1,\gamma,\alpha+\beta+1;\frac{z}{z-1}\right).

The point to internalize is not the specific map, but the phenomenon: qq transforms in a genuinely non-obvious way, and it encodes global information.


The general Heun equation can degenerate to the Gauss hypergeometric equation in special parameter limits. If F(a,q;α,β,γ,δ;z)F(a,q;\alpha,\beta,\gamma,\delta;z) denotes the normalized exponent-00 Frobenius solution at z=0z=0 with F(0)=1F(0)=1, then three useful degenerations are:

  1. If a=1a=1 and q=αβq=\alpha\beta,
F(1,αβ;α,β,γ,δ;z)=2F1(α,β;γ;z).F(1,\alpha\beta;\alpha,\beta,\gamma,\delta;z) = {}_2F_1(\alpha,\beta;\gamma;z).
  1. If a=0a=0 and q=0q=0,
F(0,0;α,β,γ,δ;z)=2F1 ⁣(α,β;α+βδ+1;z).F(0,0;\alpha,\beta,\gamma,\delta;z) = {}_2F_1\!\big(\alpha,\beta;\alpha+\beta-\delta+1;z\big).
  1. If ϵ=0\epsilon=0 and q=aαβq=a\alpha\beta (equivalently δ=α+βγ+1\delta=\alpha+\beta-\gamma+1),
F(a,aαβ;α,β,γ,α+βγ+1;z)=2F1(α,β;γ;z).F(a,a\alpha\beta;\alpha,\beta,\gamma,\alpha+\beta-\gamma+1;z) = {}_2F_1(\alpha,\beta;\gamma;z).

These limits are excellent sanity checks for both symbolic manipulations and numerics.


7. Global solutions and why qq becomes an eigenvalue

Section titled “7. Global solutions and why qqq becomes an eigenvalue”

A local HeunG/HlHl solution is defined near one singularity (e.g. near z=0z=0). In contrast, the reference uses the term Heun function (denoted HfHf) for a solution that is simultaneously a Frobenius solution about two singularities s1,s2s_1,s_2, i.e. analytic in a region containing both (with branch cuts chosen for single-valuedness).

In many physical problems you impose two endpoint conditions such as:

  • regularity at z=0z=0 and z=1z=1,
  • ingoing behavior at one singular point and normalizability at another,
  • prescribed monodromy around a contour.

These global requirements typically hold only for a discrete set of qq values. That is why qq behaves as an eigenvalue.

To enforce “regular at z=0z=0 and z=1z=1” you can:

  1. Build a local basis near z=0z=0: y1=Hl()y_1=Hl(\cdots) and y2=z1γHl()y_2=z^{1-\gamma}Hl(\cdots).

  2. Build a local basis near z=1z=1 (by a transformation z1zz\mapsto 1-z or a dedicated local expansion).

  3. Evaluate both bases and their derivatives at a matching point zz_* in an overlap region.

  4. Solve for the connection coefficients and impose that the coefficient of the singular basis element vanishes.

This yields a scalar condition on qq, i.e. an eigenvalue equation.


8. Heun polynomials and series termination

Section titled “8. Heun polynomials and series termination”

A Heun polynomial is a solution that is simultaneously Frobenius at three singularities and has the structured form

Hp(z)=zσ1(z1)σ2(za)σ3p(z),Hp(z)=z^{\sigma_1}(z-1)^{\sigma_2}(z-a)^{\sigma_3}\,p(z),

where p(z)p(z) is a polynomial and each σi\sigma_i is one of the two local exponents at the corresponding singularity.

From the recurrence, if

α=n,n{0,1,2,},\alpha=-n,\qquad n\in\{0,1,2,\ldots\},

then Pn+1=0P_{n+1}=0. If one chooses qq so that cn+1=0c_{n+1}=0, the series terminates and produces a polynomial of degree nn (class I in the reference). The admissible qq values satisfy an algebraic equation of degree n+1n+1.

The reference classifies Heun polynomials into eight classes I–VIII, determined by the choices of (σ1,σ2,σ3)(\sigma_1,\sigma_2,\sigma_3) and corresponding constraints on (α,β)(\alpha,\beta).

A convenient summary is:

Classσ1σ2σ3αβI000nγ+δ+ϵ+n1II1γ00γn1δ+ϵ+nIII01δ0δn1ϵ+γ+nIV1γ1δ0γ+δn2ϵ+n+1V001ϵϵn1γ+δ+nVI1γ01ϵγ+ϵn2δ+n+1VII01δ1ϵδ+ϵn2γ+n+1VIII1γ1δ1ϵγ+δ+ϵn3n+2\begin{array}{c|ccc|cc} \text{Class} & \sigma_1 & \sigma_2 & \sigma_3 & \alpha & \beta\\ \hline \text{I} & 0 & 0 & 0 & -n & \gamma+\delta+\epsilon+n-1\\ \text{II} & 1-\gamma & 0 & 0 & \gamma-n-1 & \delta+\epsilon+n\\ \text{III} & 0 & 1-\delta & 0 & \delta-n-1 & \epsilon+\gamma+n\\ \text{IV} & 1-\gamma & 1-\delta & 0 & \gamma+\delta-n-2 & \epsilon+n+1\\ \text{V} & 0 & 0 & 1-\epsilon & \epsilon-n-1 & \gamma+\delta+n\\ \text{VI} & 1-\gamma & 0 & 1-\epsilon & \gamma+\epsilon-n-2 & \delta+n+1\\ \text{VII} & 0 & 1-\delta & 1-\epsilon & \delta+\epsilon-n-2 & \gamma+n+1\\ \text{VIII} & 1-\gamma & 1-\delta & 1-\epsilon & \gamma+\delta+\epsilon-n-3 & n+2 \end{array}

Even though the local series defines an analytic function in its convergence disk, analytic continuation around singularities produces monodromy, so the global object is generally multi-valued.

Computer algebra systems choose a principal branch, which is implemented by placing branch cuts that connect singular points to infinity.

In Wolfram Language, the principal branch of HeunG[a,q,α,β,γ,δ,z] has two branch cut discontinuities in the complex zz-plane: one running from z=1z=1 to infinity and one running from z=az=a to infinity in the direction of aa.

  • If you are doing numerics, always record:
    • which branch you intend (path of continuation),
    • where you expect discontinuities,
    • how you validate (e.g. by checking the ODE numerically).
  • If you are doing spectral/eigenvalue problems, make sure the boundary/regularity conditions are imposed on a consistent branch.

10. How to reduce a given ODE to HeunG form

Section titled “10. How to reduce a given ODE to HeunG form”

Suppose you start with a second-order linear ODE

w(x)+p(x)w(x)+r(x)w(x)=0,w''(x)+p(x)w'(x)+r(x)w(x)=0,

and you suspect it has four regular singular points.

A robust reduction procedure is:

Step 1: map the singular points to {0,1,a,}\{0,1,a,\infty\}

Section titled “Step 1: map the singular points to {0,1,a,∞}\{0,1,a,\infty\}{0,1,a,∞}”

If the finite regular singular points are at x=x1,x2,x3x=x_1,x_2,x_3 (distinct), choose a Möbius transformation

z=(xx1)(x2x3)(xx3)(x2x1)z=\frac{(x-x_1)(x_2-x_3)}{(x-x_3)(x_2-x_1)}

so that

x=x1z=0,x=x2z=1,x=x3z=a,x=x_1\mapsto z=0,\qquad x=x_2\mapsto z=1,\qquad x=x_3\mapsto z=a,

for some computed a0,1a\neq 0,1.

Step 2: normalize exponents with a gauge factor

Section titled “Step 2: normalize exponents with a gauge factor”

Write

w(x(z))=zσ0(z1)σ1(za)σay(z),w(x(z)) = z^{\sigma_0}(z-1)^{\sigma_1}(z-a)^{\sigma_a}\,y(z),

and choose (σ0,σ1,σa)(\sigma_0,\sigma_1,\sigma_a) so that y(z)y(z) has the desired local exponents at z=0,1,az=0,1,a (often one chooses the exponent 00 at each finite singularity for the canonical Heun normalization).

Step 3: match coefficients to read off (γ,δ,ϵ)(\gamma,\delta,\epsilon) and (αβ,q)(\alpha\beta,q)

Section titled “Step 3: match coefficients to read off (γ,δ,ϵ)(\gamma,\delta,\epsilon)(γ,δ,ϵ) and (αβ,q)(\alpha\beta,q)(αβ,q)”

After Steps 1–2, bring the equation to the canonical form

y+(γz+δz1+ϵza)y+αβzqz(z1)(za)y=0.y'' + \left(\frac{\gamma}{z}+\frac{\delta}{z-1}+\frac{\epsilon}{z-a}\right)y' + \frac{\alpha\beta\,z-q}{z(z-1)(z-a)}y=0.

Then:

  • the residues of the yy' coefficient at z=0,1,az=0,1,a give (γ,δ,ϵ)(\gamma,\delta,\epsilon),
  • the numerator of the yy coefficient gives αβ\alpha\beta (coefficient of zz) and qq (minus the constant term).

Finally, enforce the Fuchs relation ϵ=α+βγδ+1\epsilon=\alpha+\beta-\gamma-\delta+1 to determine ϵ\epsilon (or as a consistency check).


  • Forgetting the constraint ϵ=α+βγδ+1\epsilon=\alpha+\beta-\gamma-\delta+1 (software often hides ϵ\epsilon).
  • Using forbidden values a=0a=0 or a=1a=1 (singularities collide; you enter a confluent regime).
  • Logarithmic cases (γZ\gamma\in\mathbb{Z}, similarly at z=1z=1 or z=az=a when δ\delta or ϵ\epsilon are integers): the naive Frobenius basis changes.
  • Small radius of convergence when a1|a|\ll 1 or a1a\approx 1: use transformations or re-expansion.
  • Branch cut crossings in analytic continuation: results can jump between branches.
  • Assuming symmetry in (α,β)(\alpha,\beta): the equation is symmetric under αβ\alpha\leftrightarrow\beta, but your chosen solution/branch and normalization may not make that symmetry manifest.
  • Underestimating precision needs near singular points: high-precision arithmetic is often necessary.

  • Primary convention source for this page:
    A. Ronveaux (ed.), Heun’s Differential Equations, Oxford University Press (1995), Part A: “Heun’s equation” (canonical form, local solution HlHl, transformations, Heun functions HfHf, Heun polynomials HpHp).

  • Additional standard references you may see in the literature:

    • A. F. Slavyanov and W. Lay, Special Functions: A Unified Theory Based on Singularities (useful for broader special-function context).
    • R. S. Maier, work on the 192 solutions and transformation theory (useful for symmetry and connection problems).