HeunG[a,q,α,β,γ,δ,z]
gives the general Heun function.
HeunG
HeunG[a,q,α,β,γ,δ,z]
gives the general Heun function.
Details
- HeunG belongs to the Heun class of functions, directly generalizes the Hypergeometric2F1 function and occurs in quantum mechanics, mathematical physics and applications.
- Mathematical function, suitable for both symbolic and numerical manipulation.
- HeunG[a,q,α,β,γ,δ,z] satisfies the general Heun differential equation
. - The HeunG function is the regular solution of the general Heun equation that satisfies the condition HeunG[a,q,α,β,γ,δ,0]1.
- HeunG has one branch cut discontinuity in the complex
plane running from
to
and one running from
to DirectedInfinity[a]. - For certain special arguments, HeunG automatically evaluates to exact values.
- HeunG can be evaluated for arbitrary complex parameters.
- HeunG can be evaluated to arbitrary numerical precision.
- HeunG automatically threads over lists.
- HeunG[a,q,α,β,γ,δ,z] specializes to Hypergeometric2F1[α,β,γ,z] if
and
or
and
.
Examples
open all close allBasic Examples (3)
Scope (37)
Numerical Evaluation (10)
N[HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, 1 / 10], 50]The precision of the output tracks the precision of the input:
HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, 0.10000000000000000001]HeunG can take one or more complex number parameters:
HeunG[1.2 + I, 0.9, -1.4, 0.12, 0.03, -0.2, 0.1]HeunG[1.2 + I, 0.9 - 0.1I, -1.4 + 0.I, 0.12 - I, 0.03 + 0.123I, -0.2 - 0.2I, 0.1]HeunG can take complex number arguments:
HeunG[1.2, 0.9, -1.4, 0.12, 0.03, -0.2, 0.1 + I]Finally, HeunG can take all complex number input:
HeunG[1.2 + I, 0.9 - 0.1I, -1.4 + 0.I, 0.12 - I, 0.03 + 0.123I, -0.2 - 0.2I, 0.1 + I]Evaluate HeunG efficiently at high precision:
HeunG[1 / 2, 1 / 3, -1 / 4, 1 / 5, 1 / 6, -1 / 7, 1 / 8`100]//TimingHeunG[1 / 2, 1 / 3, -1 / 4, 1 / 5, 1 / 6, -1 / 7, 1 / 8 + I / 2`100]//TimingHeunG[1.2, 0.9, -1.4, 0.12, 0.03, -0.2, {0.1, 0.1 + I, I, 4}]HeunG[4.3, -0.2, {1.3, -0.4}, 0.12, -0.14, 4.32, -1.4]HeunG[1.2, 0.9, -1.4, 0.12, 0.03, -0.2, (| | |
| :- | :---- |
| π | u |
| v | (π/2) |) ]Evaluate HeunG for points at branch cut
to
:
HeunG[4.3 + I, 1.3, -0.71, 0.12, 1, 4.32, 11]Evaluate HeunG for points on a branch cut from
to DirectedInfinity[a]:
With[{a = 4.3 + I}, HeunG[a, 1.3, -0.71, 0.12, 1, 4.32, 2a]]Compute the elementwise values of an array:
HeunG[.1, .1 + I, I, 0.12, 1, -0.32, {{.01, -1}, {.3, .2}}]Or compute the matrix HeunG function using MatrixFunction:
MatrixFunction[HeunG[.1, .1 + I, I, 0.12, 1, -0.32, #]&, {{.01, -1}, {.3, .2}}]Specific Values (8)
Value of HeunG at origin:
HeunG[a, q, α, β, γ, δ, 0]Value of HeunG at the regular singular point
is indeterminate:
HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, 1]Value of HeunG at the regular singular point
is indeterminate:
HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, 12 / 10]Values of HeunG in "logarithmic" cases, for nonpositive integer
, are not determined:
HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, -3, -2 / 10, 2 / 10]HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 0, -2 / 10, 2 / 10]Value of HeunG is indeterminate if
:
HeunG[0, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, 2 / 10] HeunG automatically evaluates to the Hypergeometric2F1 function if
and
:
HeunG[1, α * β, α, β, γ, δ, z]HeunG automatically evaluates to the Hypergeometric2F1 function if
and
:
HeunG[a, a * α * β, α, β, γ, 1 + α + β - γ, z]HeunG automatically evaluates to simpler functions for certain parameters:
HeunG[1, -3, -3 / 2, 2, 3, 1 / 3, z]HeunG[1, 1 / 4, 1 / 2, 1 / 2, 1, 1 / 3, z]Visualization (5)
Plot the HeunG function:
Plot[HeunG[4, -20, -0.6, -0.7 , -0.18, 0.3 , z], {z, -3 / 10, 9 / 10}]Plot the absolute value of the HeunG function for complex parameters:
Plot[Abs[HeunG[4 + I, -20, -0.6 + 0.9 I, -0.7 I, -0.18 - 0.03 I, 0.3 + 0.6 I, z]], {z, -3 / 10, 9 / 10}]Plot HeunG as a function of its third parameter
:
Plot[HeunG[4, -20, α, -0.7, -0.18, 0.3 , z] /. α -> {-2, Sqrt[20], 1 / 10}//Evaluate, {z, -3 / 10, 9 / 10}]Plot HeunG as a function of
and
:
{a, α, β, γ, δ} = {4 + I, -0.6 + 0.9 I, -0.7 I, -0.18 - 0.03 I, 0.3 + 0.6 I};Plot3D[Abs[HeunG[a, q, α, β, γ, δ, z]], {q, -20, -1}, {z, -1 / 10, 9 / 10}, ColorFunction -> Function[{q, z, HG}, Hue[HG]], PlotRange -> All]Plot the family of HeunG functions for different accessory parameters
:
{a, α, β, γ, δ} = {4 + I, -0.6 + 0.9 I, -0.7 I, -0.18 - 0.03 I, 0.3 + 0.6 I};Plot[Evaluate[Table[Abs[HeunG[a, q, α, β, γ, δ, z]], {q, -20, -3, 1}]], {z, -3 / 10, 9 / 10}, PlotStyle -> Table[{Hue[i / 20], Thickness[0.002]}, {i, 20}], PlotRange -> All, Frame -> True, Axes -> False]Function Properties (3)
Hypergeometric2F1 is a special case of HeunG:
HeunG[1, α * β, α, β, γ, δ, z]HeunG[a, a * α * β, α, β, γ, 1 + α + β - γ, z]HeunG can be simplified to the Hypergeometric2F1 function with nonlinear argument:
HeunG[-1, 0, 2α, 2β, 2γ - 1, α + β - γ + 1, z]HeunG[2, α * β, α, β, γ, 1 + α + β - 2γ, z]HeunG[-3, 0, 3a, 3b, 2a + 2b, 1 / 2, z]HeunG can be simplified to rational functions in special cases:
HeunG[-(3/2), (5/72), -(5/6), (7/6), (1/6), (1/2), 1 / z]HeunG[1 / 3, 1 / 2, 1 / 2, 1 / 3, 3 / 2, -1, z]HeunG[1, α, α, 1, 1, 0, z]Differentiation (4)
The
-derivative of HeunG is HeunGPrime:
D[HeunG[a, q, α, β, γ, δ, z], z]Higher derivatives of HeunG are calculated using HeunGPrime:
D[HeunG[a, q, α, β, γ, δ, z], {z, 2}]//SimplifyDerivatives of HeunG for specific cases of parameters:
D[HeunG[1, α * β, α, β, γ, δ, z], z]D[HeunG[1, α * β, α, β, γ, δ, z], {z, n}]Higher derivatives of HeunG involving specific cases of parameters:
D[HeunG[1, α * β, α, β, γ, δ, z^2], {z, 2}]Integration (3)
Indefinite integrals of HeunG cannot be expressed in elementary or other special functions:
Integrate[HeunG[a, q, α, β, γ, δ, z], z]Definite numerical integrals of HeunG:
NIntegrate[HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, z], {z, 0, 1 / 3}]More integrals with HeunG:
NIntegrate[z ^ 2 HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, z], {z, -1, 1 / 3}]NIntegrate[Sin[Sqrt[z]] ^ 2 HeunG[12 / 10, 9 / 10, -14 / 10, 12 / 100, 3 / 100, -2 / 10, z], {z, -1, 1 / 3}]Series Expansions (4)
Taylor expansion for HeunG at regular singular origin:
Series[HeunG[a, q, α, β, γ, δ, z], {z, 0, 2}]Coefficient of the second term in the series expansion of HeunG at
:
SeriesCoefficient[HeunG[a, q, α, β, γ, δ, z], {z, 0, 2}]Plot the first three approximations for HeunG around
:
{a, q, α, β, γ, δ} = {2 / 3, 0, 1 / 4, -12 / 10, 3 / 10, -22 / 10};terms = Normal@Table[Series[HeunG[a, q, α, β, γ, δ, z], {z, 0, m}], {m, 1, 7, 2}];Plot[{HeunG[a, q, α, β, γ, δ, z], terms}//Evaluate, {z, -1, 1 / 2}, PlotLegends -> {"HeunG[a, q, α, β, γ, δ, z]", "1st approximation", "2nd approximation", "3rd approximation", "4th approximation"}]Series expansion for HeunG at any ordinary complex point:
Series[HeunG[a, q, α, β, γ, δ, z], {z, 1 / 2, 1}]//FullSimplifyApplications (5)
Solve the general Heun differential equation using DSolve:
sol = DSolve[ y''[z] + ((γ/z) + (δ/z - 1) + (1 + α + β - γ - δ/z - a))y'[z] + (α β z - q/z(z - 1)(z - a))y[z] == 0, y[z], z]Plot the solution for different initial conditions:
{a, q, α, β, γ, δ} = {4 + I, -20, -3 / 5 + 9 / 10 I, -7 / 10I, -1 / 5 - 1 / 30 I, 1 / 3 + 2 / 3 I};Plot[Abs[y[z]] /. sol /. {{C[1] -> 1, C[2] -> 0}, {C[1] -> 0, C[2] -> 1}, {C[1] -> 1 / 3, C[2] -> 1 / 3}}//Evaluate, {z, -3 / 4, 3 / 4}, PlotRange -> {0, 5}]Solve the initial value problem:
sol = DSolveValue[ {y''[z] + ((γ/z) + (δ/z - 1) + (1 + α + β - γ - δ/z - a))y'[z] + (α β z - q/z(z - 1)(z - a))y[z] == 0, y[0] == 1, y'[0] == (q/a γ)}, y[z], z]Plot the solution for different values of the accessory parameter q:
{a, α, β, γ, δ} = {-2, -3 / 5, -7 / 10, -8 / 5, 1 / 3 };Plot[sol /. q -> {1, 2, 3, 4}//Evaluate, {z, -9 / 10, 9 / 10}]Solve the Lamé differential equation in terms of HeunG:
sol = DSolve[ y''[z] + (1/2)((1/z) + (1/z - 1) + (1/z - a))y'[z] + (a h - ν(ν + 1)z/4z(z - 1)(z - a))y[z] == 0, y[z], z, Assumptions -> ν > 0]Plot the absolute value of the solution for different h:
{a, ν} = {3 / 4, 3};Plot[Abs[y[z] /. sol /. {C[1] -> 1 / 3, C[2] -> 1 / 3}] /. h -> {-100, -10, 0, 10, 100}//Evaluate, {z, -1 / 2, 1 / 2}, PlotRange -> {0, 2}]Stationary 1D Schrödinger equation for this infinite potential well is solved in terms of HeunG:
V[x_] := (V0/(E^2 x - 1)^2)Plot[V[x] /. V0 -> -1, {x, -4, 4}]The fundamental solution of the Schrödinger equation in terms of HeunG:
ψ[x_] := (E^x)^Sqrt[C1 - C2] (-1 + E^x)^(1/2) (1 + Sqrt[1 + C1]) (1 + E^x)^(1/2) (1 - Sqrt[1 + C1])HeunG[-1, q, α, β, γ, δ, E^x]{q, α, β, γ, δ} = {-Sqrt[1 + C1] (1 + 2 Sqrt[C1 - C2]), 1 + Sqrt[C1 - C2] - Sqrt[-C2], 1 + Sqrt[C1 - C2] + Sqrt[-C2], 1 + 2 Sqrt[C1 - C2], 1 + Sqrt[1 + C1]};{C1, C2} = {(2 m V0/ℏ^2), (2 m EE/ℏ^2)};Verify this solution by direct substitution:
ψ''[x] + (2m/ℏ^2)(EE - (V0/(-1 + E^2 x)^2))ψ[x] == 0//SimplifyThe general form of a second-order Fuchsian equation with four regular singularities at
and exponent parameters
, subject to the constraint
:
fuchsianeq = y''[z] + ((1 - Subscript[a, 1] - Subscript[a, 2]/z - α) + (1 - Subscript[b, 1] - Subscript[b, 2]/z - β) + (1 - Subscript[c, 1] - Subscript[c, 2]/z - γ) + (1 - Subscript[d, 1] - Subscript[d, 2]/z - δ))y'[z] + (((α - β)(α - γ)(α - δ)Subscript[a, 1] Subscript[a, 2]/z - α) + ((β - α)(β - γ)(β - δ)Subscript[b, 1] Subscript[b, 2]/z - β) + ((γ - α)(γ - β)(γ - δ)Subscript[c, 1] Subscript[c, 2]/z - γ) + ((δ - α)(δ - β)(δ - γ)Subscript[d, 1]Subscript[d, 2]/z - δ))(y[z]/(z - α)(z - β)(z - γ)(z - δ));Construct two linearly independent solutions in terms of HeunG:
sol1[z_] := ((z - α/z - δ))^Subscript[a, 1]((z - β/z - δ))^Subscript[b, 1]((z - γ/z - δ))^Subscript[c, 1]HeunG[((α - γ) (β - δ)/(α - β) (γ - δ)), Subscript[c, 1] - Subscript[a, 2] Subscript[c, 1] - Subscript[a, 1] (Subscript[a, 2] + Subscript[c, 2] - 1) - Subscript[a, 1] Subscript[a, 2] ((α - γ) (α - δ)/(α - β) (γ - δ)) - ((Subscript[a, 2] - 1) Subscript[b, 1] + Subscript[a, 1] (Subscript[b, 2] - 1))((α - γ) (β - δ)/(α - β) (γ - δ)) - (Subscript[b, 1] Subscript[b, 2] (β - γ) (β - δ)/(α - β) (γ - δ)) + Subscript[c, 1] Subscript[c, 2](β - γ/α - β) + Subscript[d, 1] Subscript[d, 2](δ - β/α - β), Subscript[a, 1] + Subscript[b, 1] + Subscript[c, 1] + Subscript[d, 1], Subscript[a, 1] + Subscript[b, 1] + Subscript[c, 1] + Subscript[d, 2], 1 + Subscript[a, 1] - Subscript[a, 2], 1 + Subscript[b, 1] - Subscript[b, 2], ((z - α) (β - δ)/(β - α) (z - δ))]sol2[z_] := ((z - α/z - δ))^Subscript[a, 2] ((z - β/z - δ))^Subscript[b, 1]((z - γ/z - δ))^Subscript[c, 1]HeunG[((α - γ) (β - δ)/(α - β) (γ - δ)), Subscript[c, 1] - Subscript[a, 2] Subscript[c, 1] - Subscript[a, 1] (Subscript[a, 2] + Subscript[c, 2] - 1) + Subscript[c, 1] Subscript[c, 2](β - γ/α - β) - (Subscript[a, 1] - Subscript[a, 2])(2 + Subscript[b, 1] - Subscript[b, 2] + Subscript[c, 1] - Subscript[c, 2] + ((1 + Subscript[b, 1] - Subscript[b, 2]) (β - γ) (α - δ)/(α - β) (γ - δ))) - Subscript[a, 1] Subscript[a, 2] ((α - γ) (α - δ)/(α - β) (γ - δ)) - ((Subscript[a, 2] - 1) Subscript[b, 1] + Subscript[a, 1] (Subscript[b, 2] - 1))((α - γ) (β - δ)/(α - β) (γ - δ)) - Subscript[b, 1] Subscript[b, 2] ((β - γ) (β - δ)/(α - β) (γ - δ)) + Subscript[d, 1] Subscript[d, 2](δ - β/α - β), Subscript[a, 2] + Subscript[b, 1] + Subscript[c, 1] + Subscript[d, 1], Subscript[a, 2] + Subscript[b, 1] + Subscript[c, 1] + Subscript[d, 2], 1 - Subscript[a, 1] + Subscript[a, 2], 1 + Subscript[b, 1] - Subscript[b, 2], ((z - α) (β - δ)/(β - α) (z - δ))]Verify that these solutions satisfy the Fuchsian equation:
(fuchsianeq /. y -> sol1) /. (Subscript[d, 2] -> 2 - (Subscript[a, 1] + Subscript[a, 2] + Subscript[b, 1] + Subscript[b, 2] + Subscript[c, 1] + Subscript[c, 2] + Subscript[d, 1]))//Simplify(fuchsianeq /. y -> sol2) /. (Subscript[d, 2] -> 2 - (Subscript[a, 1] + Subscript[a, 2] + Subscript[b, 1] + Subscript[b, 2] + Subscript[c, 1] + Subscript[c, 2] + Subscript[d, 1]))//SimplifyProperties & Relations (6)
HeunG is analytic at the origin:
Series[HeunG[a, q, α, β, γ, δ, z], {z, 0, 2}]
and
are singular points of the HeunG function:
HeunG[a, q, α, β, γ, δ, 1]HeunG[a, q, α, β, γ, δ, a]Except for these two singular points, HeunG can be calculated at any finite complex
:
HeunG[4 + I, -1 / 2, 5 / 2, 1 / 4, -7 / 5, 2, z] /. z -> RandomComplex[{-5 - I, 5 + I}, 5]The derivative of HeunG is HeunGPrime:
D[HeunG[a, q, α, β, γ, δ, z], z]HeunG is symmetric in the parameters
and
:
HeunG[a, q, α, β, γ, δ, z] == HeunG[a, q, β, α, γ, δ, z]Four equivalent expressions for HeunG, corresponding to parameter transformations that leave the argument
and singular point
invariant:
g1 = HeunG[a, q, α, β, γ, δ, z];g2 = (1 - z)^1 - δHeunG[a, q - γ(δ - 1)a, α - δ + 1, β - δ + 1, γ, 2 - δ, z];g3 = (1 - (z/a))^γ + δ - α - βHeunG[a, q - γ(α + β - γ - δ), γ + δ - α, γ + δ - β, γ, δ, z];g4 = (1 - z)^1 - δ(1 - (z/a))^γ + δ - α - βHeunG[a, q - γ(α + β - γ - δ + a(δ - 1)), γ - α + 1, γ - β + 1, γ, 2 - δ, z];Use Series to show that the series expansions of the last three expressions at
agree with that of the first:
{Series[g1 - g2, {z, 0, 9}], Series[g1 - g3, {z, 0, 9}], Series[g1 - g4, {z, 0, 9}]}//SimplifySix equivalent expressions for HeunG, corresponding to argument transformations that leave the parameters
and
invariant:
g1 = HeunG[a, q, α, β, γ, δ, z];g2 = HeunG[(1/a), (q/a), α, β, γ, α + β + 1 - γ - δ, (z/a)];g3 = (1 - z)^-αHeunG[(a/a - 1), (α γ a - q/a - 1), α, α - δ + 1, γ, α - β + 1, (z/z - 1)];g4 = (1 - (z/a))^-αHeunG[(1/1 - a), (α γ - q/1 - a), α, γ + δ - β, γ, α - β + 1, (z/z - a)];
g5 = (1 - (z/a))^-αHeunG[1 - a, α γ - q, α, γ + δ - β, γ, δ, (z(1 - a)/z - a)];
g6 = (1 - z)^-αHeunG[1 - (1/a), α γ - (q/a), α, α - δ + 1, γ, α + β + 1 - γ - δ, (z(a - 1)/a(z - 1))];Use Series to show that the series expansions of the last five expressions at
agree with that of the first:
Series[{g2, g3, g4, g5, g6} - g1, {z, 0, 9}]//SimplifyPossible Issues (2)
HeunG is not defined if
is a nonpositive integer (so-called logarithmic cases):
HeunG[4.3 + I, -14.2, 1.3, 0.12, 0, 4.32, 4.3 + 0.5I]HeunG[4.3 + I, -14.2, 1.3, 0.12, -400, 4.32, (4.3 + I) * 2]HeunG is undefined when
:
HeunG[0, q, α, β, γ, δ, z]Neat Examples (1)
Create a table of some special cases for HeunG :
flist = Inactivate[{HeunG[1, α β, α, β, γ, δ, z], HeunG[a, a * α β, α, β, γ, 1 + α + β - γ, z], HeunG[1, 1 / 4, 1 / 2, 1 / 2, 1, 1 / 3, z], HeunG[1, 3, 3 / 2, 2, 3, 1 / 3, z]}, HeunG];Grid[Join[{{Text["Special case of HeunG"], Text["Simpler Special function"]}}, Transpose[{flist, Activate[flist]}]],
IconizedObject[«Grid options»]]//TraditionalFormRelated Guides
History
Introduced in 2020 (12.1)
Text
Wolfram Research (2020), HeunG, Wolfram Language function, https://reference.wolfram.com/language/ref/HeunG.html.
CMS
Wolfram Language. 2020. "HeunG." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HeunG.html.
APA
Wolfram Language. (2020). HeunG. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HeunG.html
BibTeX
@misc{reference.wolfram_2026_heung, author="Wolfram Research", title="{HeunG}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/HeunG.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_heung, organization={Wolfram Research}, title={HeunG}, year={2020}, url={https://reference.wolfram.com/language/ref/HeunG.html}, note=[Accessed: 13-June-2026]}