HeunG - Maple Programming Help

HeunG

The Heun general function

HeunGPrime

The derivative of the Heun general function

 Calling Sequence HeunG(a, q, $\mathrm{\alpha }$, $\mathrm{\beta }$, $\mathrm{\gamma }$, $\mathrm{\delta }$, z) HeunGPrime(a, q, $\mathrm{\alpha }$, $\mathrm{\beta }$, $\mathrm{\gamma }$, $\mathrm{\delta }$, z)

Parameters

 a - algebraic expression q - algebraic expression $\mathrm{\alpha }$ - algebraic expression $\mathrm{\beta }$ - algebraic expression $\mathrm{\gamma }$ - algebraic expression $\mathrm{\delta }$ - algebraic expression z - algebraic expression

Description

 • The HeunG function is the solution of the Heun General equation. Following the first reference (at the end), the equation and the conditions at the origin satisfied by HeunG are
 ${\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{DESol}}{}\left(\left\{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{_Y}}{}\left({z}\right){-}\frac{\left(\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}{+}{1}\right){}{{z}}^{{2}}{+}\left(\left({-}{\mathrm{\delta }}{-}{\mathrm{\gamma }}\right){}{a}{-}{\mathrm{\alpha }}{+}{\mathrm{\delta }}{-}{\mathrm{\beta }}{-}{1}\right){}{z}{+}{\mathrm{\gamma }}{}{a}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{_Y}}{}\left({z}\right)\right)}{{z}{}\left({z}{-}{1}\right){}\left({-}{z}{+}{a}\right)}{-}\frac{\left({\mathrm{\alpha }}{}{\mathrm{\beta }}{}{z}{-}{q}\right){}{\mathrm{_Y}}{}\left({z}\right)}{{z}{}\left({z}{-}{1}\right){}\left({-}{z}{+}{a}\right)}\right\}{,}\left\{{\mathrm{_Y}}{}\left({z}\right)\right\}{,}\left\{{\mathrm{_Y}}{}\left({0}\right){=}{1}{,}{\mathrm{D}}{}\left({\mathrm{_Y}}\right){}\left({0}\right){=}\frac{{q}}{{\mathrm{\gamma }}{}{a}}\right\}\right)$ (1)
 Heun's equation is an extension of the 2F1 hypergeometric equation in that it is a second-order Fuchsian equation with four regular singular points. The 2F1 equation has three regular singularities. The HeunG function, thus, contains as particular cases all the functions of the hypergeometric 2F1 class.
 • Another important case of Heun's equation, for $\left\{\mathrm{\alpha }=-\frac{\mathrm{\nu }}{2},\mathrm{\beta }=\frac{1}{2}+\frac{\mathrm{\nu }}{2},\mathrm{\delta }=\frac{1}{2},\mathrm{\gamma }=\frac{1}{2},q=-\frac{ah}{4}\right\}$, is Lame's equation in algebraic form,
 > diff(y(z),z,z) + 1/2*(1/z + 1/(z-1) + 1/(z-a))*diff(y(z),z) + (a*h-nu*(nu+1)*z)/(4*z*(z-1)*(z-a))*y(z) = 0;
 $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right){+}\frac{\left(\frac{{1}}{{z}}{+}\frac{{1}}{{z}{-}{1}}{+}\frac{{1}}{{z}{-}{a}}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({z}\right)\right)}{{2}}{+}\frac{\left({a}{}{h}{-}{\mathrm{\nu }}{}\left({1}{+}{\mathrm{\nu }}\right){}{z}\right){}{y}{}\left({z}\right)}{{4}{}{z}{}\left({z}{-}{1}\right){}\left({z}{-}{a}\right)}{=}{0}$ (2)
 where the parameter $\mathrm{\nu }$ is called the order of the equation and many special features arise when $\mathrm{\nu }$ is an integer. Lame's equation arises in the separation of variables in Laplace's equation.
 • The HeunG(a,q,$\mathrm{\alpha }$,$\mathrm{\beta }$,$\mathrm{\gamma }$,$\mathrm{\delta }$,z) function is a local (Frobenius) solution to Heun's equation, computed as a power series expansion around the origin, a regular singular point. The radius of convergence of this series is $\left|{z}_{s}\right|$ where ${z}_{s}$ is the location of the singularity closer to the origin, either a or 1. An analytic continuation of HeunG is obtained through identities, relating the values of the function in different regions, or by expanding the solution around the other singularities (a, 1 or $\mathrm{\infty }$). For example, the value of the function outside a circle of radius 2 is computable from the value of another HeunG function inside that circle using
 > HeunG(a,q,alpha,beta,gamma,delta,z) = (1-z)^(-alpha)*HeunG(a/(a-1),(-q+gamma*alpha*a)/(a-1),alpha,alpha-delta+1,gamma,alpha-beta+1,z/(z-1));
 ${\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}{z}\right)}^{{-}{\mathrm{\alpha }}}{}{\mathrm{HeunG}}{}\left(\frac{{a}}{{a}{-}{1}}{,}\frac{{\mathrm{\gamma }}{}{\mathrm{\alpha }}{}{a}{-}{q}}{{a}{-}{1}}{,}{\mathrm{\alpha }}{,}{\mathrm{\alpha }}{-}{\mathrm{\delta }}{+}{1}{,}{\mathrm{\gamma }}{,}{\mathrm{\alpha }}{-}{\mathrm{\beta }}{+}{1}{,}\frac{{z}}{{z}{-}{1}}\right)$ (3)
 • For certain values of the parameters, it can happen that the expansion around the origin is also a Frobenius solution around the next adjacent singularity, so the function is analytic in some domain including both singularities. In the literature, the term Heun function is sometimes reserved for these cases, important in physical applications.
 • A more special situation happens when the parameters entering HeunG are such that the function is, simultaneously, a Frobenius solution around three adjacent singularities and hence analytic in a domain containing all of them. In such a case the solution will also be a Frobenius solution around the fourth singularity and HeunG will be a polynomial. A necessary (not sufficient) condition for this case is that $\mathrm{\alpha }=-n$, with $n$ a positive integer, and $q$ has one of a finite number of characteristic values, in which case the function is a polynomial of degree $n$.

Examples

Heun's equation can be transformed into another version of itself, that is, an equation with four regular singularities three of which are located at $\left\{0,1,\mathrm{\infty }\right\}$, by any of 24 Mobius transformations $z$ -> $f\left(z\right)$ of the independent variable $z$; these forms of $f\left(z\right)$ are

 > $\mathrm{Matrix}\left(\left[\left[z,1-z,\frac{1}{z},\frac{1}{1-z}\right],\left[\frac{z}{z-1},\frac{z-1}{z},\frac{z}{a},\frac{a-z}{a}\right],\left[\frac{a}{z},\frac{a}{a-z},\frac{z}{z-a},\frac{z-a}{z}\right],\left[\frac{z-a}{1-a},\frac{z-1}{a-1},\frac{1-a}{z-a},\frac{a-1}{z-1}\right],\left[\frac{z-a}{z-1},\frac{z-1}{z-a},\frac{z-a}{a\left(z-1\right)},\frac{\left(a-1\right)z}{z-a}\right],\left[\frac{a\left(z-1\right)}{z-a},\frac{a\left(z-1\right)}{\left(a-1\right)z},\frac{z-a}{\left(1-a\right)z},\frac{\left(1-a\right)z}{z-a}\right]\right]\right)$
 $\left[\begin{array}{cccc}{z}& {1}{-}{z}& \frac{{1}}{{z}}& \frac{{1}}{{1}{-}{z}}\\ \frac{{z}}{{z}{-}{1}}& \frac{{z}{-}{1}}{{z}}& \frac{{z}}{{a}}& \frac{{a}{-}{z}}{{a}}\\ \frac{{a}}{{z}}& \frac{{a}}{{a}{-}{z}}& \frac{{z}}{{z}{-}{a}}& \frac{{z}{-}{a}}{{z}}\\ \frac{{z}{-}{a}}{{1}{-}{a}}& \frac{{z}{-}{1}}{{a}{-}{1}}& \frac{{1}{-}{a}}{{z}{-}{a}}& \frac{{a}{-}{1}}{{z}{-}{1}}\\ \frac{{z}{-}{a}}{{z}{-}{1}}& \frac{{z}{-}{1}}{{z}{-}{a}}& \frac{{z}{-}{a}}{{a}{}\left({z}{-}{1}\right)}& \frac{\left({a}{-}{1}\right){}{z}}{{z}{-}{a}}\\ \frac{{a}{}\left({z}{-}{1}\right)}{{z}{-}{a}}& \frac{{a}{}\left({z}{-}{1}\right)}{\left({a}{-}{1}\right){}{z}}& \frac{{z}{-}{a}}{\left({1}{-}{a}\right){}{z}}& \frac{\left({1}{-}{a}\right){}{z}}{{z}{-}{a}}\end{array}\right]$ (4)

Note that the location of the fourth singularity resulting from these transformations, say $\mathrm{\lambda }$, is in general different from $a$. The six possible values of $\mathrm{\lambda }$ are $\left\{a,\frac{1}{a},\frac{1}{1-a},\frac{a}{a-1},1-a\right\}$ and $\frac{a-1}{a}$.

Taking into account that Heun's equation has 4 regular singularities, that at around each one it is possible to construct 2 Frobenius solutions, and that there exist these 24 transformations mapping the equation into one of the same type, the solution to Heun's equation can be written in 192 different manners. This situation is equivalent to the one of the 2F1 hypergeometric equation, where instead of 4 there are 3 regular singularities, instead of 24 transformations there are only 6, and so the solution can be written in 24 different manners.

This group of transformations of order 24 admitted by Heun's equation also leads to a rather large number of identities for the function solution HeunG, among which you have

 > $\mathrm{FunctionAdvisor}\left(\mathrm{identities},\mathrm{HeunG}\right)$
 $\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}{z}\right)}^{{1}{-}{\mathrm{\delta }}}{}{\mathrm{HeunG}}{}\left({a}{,}{q}{-}\left({\mathrm{\delta }}{-}{1}\right){}{\mathrm{\gamma }}{}{a}{,}{\mathrm{\beta }}{-}{\mathrm{\delta }}{+}{1}{,}{\mathrm{\alpha }}{-}{\mathrm{\delta }}{+}{1}{,}{\mathrm{\gamma }}{,}{2}{-}{\mathrm{\delta }}{,}{z}\right){,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}\frac{{z}}{{a}}\right)}^{{-}{\mathrm{\alpha }}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}}{}{\mathrm{HeunG}}{}\left({a}{,}{q}{-}{\mathrm{\gamma }}{}\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}{-}{\mathrm{\gamma }}{-}{\mathrm{\delta }}\right){,}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}{,}{-}{\mathrm{\alpha }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){,}{a}{\ne }{0}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}{z}\right)}^{{1}{-}{\mathrm{\delta }}}{}{\left({1}{-}\frac{{z}}{{a}}\right)}^{{-}{\mathrm{\alpha }}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}}{}{\mathrm{HeunG}}{}\left({a}{,}{q}{-}{\mathrm{\gamma }}{}\left(\left({\mathrm{\delta }}{-}{1}\right){}{a}{+}{\mathrm{\alpha }}{+}{\mathrm{\beta }}{-}{\mathrm{\gamma }}{-}{\mathrm{\delta }}\right){,}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{1}{,}{-}{\mathrm{\alpha }}{+}{\mathrm{\gamma }}{+}{1}{,}{\mathrm{\gamma }}{,}{2}{-}{\mathrm{\delta }}{,}{z}\right){,}{a}{\ne }{0}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{HeunG}}{}\left(\frac{{1}}{{a}}{,}\frac{{q}}{{a}}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\alpha }}{+}{\mathrm{\beta }}{-}{\mathrm{\gamma }}{-}{\mathrm{\delta }}{+}{1}{,}\frac{{z}}{{a}}\right){,}{a}{\ne }{0}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}{z}\right)}^{{-}{\mathrm{\alpha }}}{}{\mathrm{HeunG}}{}\left(\frac{{a}}{{a}{-}{1}}{,}\frac{{a}{}{\mathrm{\alpha }}{}{\mathrm{\gamma }}{-}{q}}{{a}{-}{1}}{,}{\mathrm{\alpha }}{,}{\mathrm{\alpha }}{-}{\mathrm{\delta }}{+}{1}{,}{\mathrm{\gamma }}{,}{\mathrm{\alpha }}{-}{\mathrm{\beta }}{+}{1}{,}\frac{{z}}{{z}{-}{1}}\right){,}{a}{\ne }{1}{\wedge }{z}{\ne }{1}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}\frac{{z}}{{a}}\right)}^{{-}{\mathrm{\alpha }}}{}{\mathrm{HeunG}}{}\left({1}{-}{a}{,}{\mathrm{\alpha }}{}{\mathrm{\gamma }}{-}{q}{,}{\mathrm{\alpha }}{,}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}\frac{\left({1}{-}{a}\right){}{z}}{{z}{-}{a}}\right){,}{a}{\ne }{0}{\wedge }{z}{\ne }{a}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\left({1}{-}\frac{{z}}{{a}}\right)}^{{-}{\mathrm{\alpha }}}{}{\mathrm{HeunG}}{}\left(\frac{{1}}{{1}{-}{a}}{,}\frac{{-}{\mathrm{\alpha }}{}{\mathrm{\gamma }}{+}{q}}{{a}{-}{1}}{,}{\mathrm{\alpha }}{,}{-}{\mathrm{\beta }}{+}{\mathrm{\gamma }}{+}{\mathrm{\delta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\alpha }}{-}{\mathrm{\beta }}{+}{1}{,}\frac{{z}}{{z}{-}{a}}\right){,}{a}{\ne }{0}{\wedge }{a}{\ne }{1}{\wedge }{z}{\ne }{a}\right]\right]$ (5)

Some hypergeometric special cases of HeunG are

 > $\mathrm{FunctionAdvisor}\left(\mathrm{specialize},\mathrm{HeunG},\mathrm{hypergeom}\right)$
 $\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{hypergeom}}{}\left(\left[{\mathrm{\alpha }}{,}{\mathrm{\beta }}\right]{,}\left[{\mathrm{\alpha }}{-}{\mathrm{\delta }}{+}{1}{+}{\mathrm{\beta }}\right]{,}{z}\right){,}{a}{=}{0}{\wedge }{q}{=}{0}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{hypergeom}}{}\left(\left[{\mathrm{\alpha }}{,}{\mathrm{\beta }}\right]{,}\left[{\mathrm{\gamma }}\right]{,}{z}\right){,}\left({a}{=}{1}{\wedge }{q}{=}{\mathrm{\alpha }}{}{\mathrm{\beta }}\right){\vee }\left({q}{=}{a}{}{\mathrm{\alpha }}{}{\mathrm{\beta }}{\wedge }{\mathrm{\delta }}{=}{\mathrm{\alpha }}{+}{\mathrm{\beta }}{-}{\mathrm{\gamma }}{+}{1}\right)\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}\frac{{\mathrm{hypergeom}}{}\left(\left[\frac{\sqrt{{\left({\mathrm{\alpha }}{-}{\mathrm{\beta }}\right)}^{{2}}{-}{2}{}\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}\right){}{\mathrm{\gamma }}{+}{{\mathrm{\gamma }}}^{{2}}{+}{4}{}{q}}}{{2}}{+}\frac{{\mathrm{\gamma }}}{{2}}{+}\frac{{\mathrm{\alpha }}}{{2}}{-}\frac{{\mathrm{\beta }}}{{2}}{,}\frac{\sqrt{{\left({\mathrm{\alpha }}{-}{\mathrm{\beta }}\right)}^{{2}}{-}{2}{}\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}\right){}{\mathrm{\gamma }}{+}{{\mathrm{\gamma }}}^{{2}}{+}{4}{}{q}}}{{2}}{+}\frac{{\mathrm{\gamma }}}{{2}}{-}\frac{{\mathrm{\alpha }}}{{2}}{+}\frac{{\mathrm{\beta }}}{{2}}\right]{,}\left[{\mathrm{\gamma }}\right]{,}{z}\right)}{{\left({-}{1}{+}{z}\right)}^{{-}\frac{\sqrt{{\left({\mathrm{\alpha }}{-}{\mathrm{\beta }}\right)}^{{2}}{-}{2}{}\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}\right){}{\mathrm{\gamma }}{+}{{\mathrm{\gamma }}}^{{2}}{+}{4}{}{q}}}{{2}}{-}\frac{{\mathrm{\gamma }}}{{2}}{+}\frac{{\mathrm{\alpha }}}{{2}}{+}\frac{{\mathrm{\beta }}}{{2}}}{}{{ⅇ}}^{{-}\frac{{I}}{{2}}{}{\mathrm{\pi }}{}\left({-}\sqrt{{\left({\mathrm{\alpha }}{-}{\mathrm{\beta }}\right)}^{{2}}{-}{2}{}\left({\mathrm{\alpha }}{+}{\mathrm{\beta }}\right){}{\mathrm{\gamma }}{+}{{\mathrm{\gamma }}}^{{2}}{+}{4}{}{q}}{-}{\mathrm{\gamma }}{+}{\mathrm{\alpha }}{+}{\mathrm{\beta }}\right)}}{,}{a}{=}{1}{\wedge }{0}{\le }{\mathrm{\Im }}{}\left({z}\right)\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{hypergeom}}{}\left(\left[\frac{{\mathrm{\beta }}}{{2}}{,}\frac{{\mathrm{\alpha }}}{{2}}\right]{,}\left[{\mathrm{\gamma }}\right]{,}{-}{z}{}\left({z}{-}{2}\right)\right){,}{a}{=}{2}{\wedge }{q}{=}{\mathrm{\alpha }}{}{\mathrm{\beta }}{\wedge }{\mathrm{\delta }}{=}{\mathrm{\alpha }}{+}{\mathrm{\beta }}{-}{2}{}{\mathrm{\gamma }}{+}{1}{\wedge }{-1}{<}{\mathrm{\Re }}{}\left({z}\right){\wedge }{\mathrm{\Re }}{}\left({z}\right){<}{1}\right]{,}\left[{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{\mathrm{\alpha }}{,}{\mathrm{\beta }}{,}{\mathrm{\gamma }}{,}{\mathrm{\delta }}{,}{z}\right){=}{\mathrm{hypergeom}}{}\left(\left[\frac{{\mathrm{\beta }}}{{3}}{,}\frac{{\mathrm{\alpha }}}{{3}}\right]{,}\left[\frac{{1}}{{2}}\right]{,}\frac{{z}{}{\left({z}{-}{3}\right)}^{{2}}}{{4}}\right){,}{a}{=}{4}{\wedge }{q}{=}{\mathrm{\alpha }}{}{\mathrm{\beta }}{\wedge }{\mathrm{\gamma }}{=}\frac{{1}}{{2}}{\wedge }{\mathrm{\delta }}{=}\frac{{2}{}{\mathrm{\alpha }}}{{3}}{+}\frac{{2}{}{\mathrm{\beta }}}{{3}}{\wedge }{-1}{<}{\mathrm{\Re }}{}\left({z}\right){\wedge }{\mathrm{\Re }}{}\left({z}\right){<}{1}{\wedge }{-}{\mathrm{\pi }}{<}{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{\mathrm{\pi }}\right]$ (6)

When $\mathrm{\alpha }=-n$, with $n$ a positive integer, the $n$th + 1 coefficient in the series expansion is a polynomial in $q$ of order $n+1$. If $q$ is a root of that polynomial, that coefficient is zero and with it all the following ones, so the series truncates and HeunG is a polynomial. For example, for $\mathrm{\alpha }=-1$

 > $\mathrm{HG}≔\mathrm{HeunG}\left(a,q,-1,\mathrm{β},g,\mathrm{δ},z\right)$
 ${\mathrm{HG}}{≔}{\mathrm{HeunG}}{}\left({a}{,}{q}{,}{-1}{,}{\mathrm{\beta }}{,}{g}{,}{\mathrm{\delta }}{,}{z}\right)$ (7)
 > $Q≔\mathrm{simplify}\left(\mathrm{series}\left(\mathrm{HG},z,3\right),\mathrm{size}\right)$
 ${Q}{≔}{1}{+}\frac{{q}}{{g}{}{a}}{}{z}{+}\frac{{1}}{{2}}{}\frac{{{q}}^{{2}}{+}\left(\left({g}{+}{\mathrm{\delta }}\right){}{a}{-}{\mathrm{\delta }}{+}{\mathrm{\beta }}\right){}{q}{+}{\mathrm{\beta }}{}{g}{}{a}}{{g}{}{{a}}^{{2}}{}\left({g}{+}{1}\right)}{}{{z}}^{{2}}{+}{O}{}\left({{z}}^{{3}}\right)$ (8)

So the coefficient of ${z}^{2}$ is

 > $\mathrm{c2}≔\mathrm{coeff}\left(Q,z,2\right)$
 ${\mathrm{c2}}{≔}\frac{{{q}}^{{2}}{+}\left(\left({g}{+}{\mathrm{\delta }}\right){}{a}{-}{\mathrm{\delta }}{+}{\mathrm{\beta }}\right){}{q}{+}{\mathrm{\beta }}{}{g}{}{a}}{{2}{}{g}{}{{a}}^{{2}}{}\left({g}{+}{1}\right)}$ (9)

solving for $q$, requesting from solve to return using RootOf we have

 > $\mathrm{_EnvExplicit}≔\mathrm{false}$
 ${\mathrm{_EnvExplicit}}{≔}{\mathrm{false}}$ (10)
 > $q=\mathrm{solve}\left(\mathrm{c2},q\right)$
 ${q}{=}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}\left({a}{}{\mathrm{\delta }}{+}{g}{}{a}{+}{\mathrm{\beta }}{-}{\mathrm{\delta }}\right){}{\mathrm{_Z}}{+}{\mathrm{\beta }}{}{g}{}{a}\right)$ (11)

substituting in $\mathrm{HG}$ we have

 > $\mathrm{HG_polynomial}≔\mathrm{subs}\left(,\mathrm{HG}\right)$
 ${\mathrm{HG_polynomial}}{≔}{\mathrm{HeunG}}{}\left({a}{,}{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}\left({a}{}{\mathrm{\delta }}{+}{g}{}{a}{+}{\mathrm{\beta }}{-}{\mathrm{\delta }}\right){}{\mathrm{_Z}}{+}{\mathrm{\beta }}{}{g}{}{a}\right){,}{-1}{,}{\mathrm{\beta }}{,}{g}{,}{\mathrm{\delta }}{,}{z}\right)$ (12)

When the function admits a polynomial form, as is the case of $\mathrm{HG_polynomial}$ by construction, to obtain the actual polynomial of degree $n$ (in this case $n=1$) use

 > $\genfrac{}{}{0}{}{\phantom{\mathrm{HeunG}=\mathrm{HeunG}:-\mathrm{SpecialValues}:-\mathrm{Polynomial}}}{}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{}}{\mathrm{HeunG}=\mathrm{HeunG}:-\mathrm{SpecialValues}:-\mathrm{Polynomial}}$
 ${1}{+}\frac{{\mathrm{RootOf}}{}\left({{\mathrm{_Z}}}^{{2}}{+}\left({a}{}{\mathrm{\delta }}{+}{g}{}{a}{+}{\mathrm{\beta }}{-}{\mathrm{\delta }}\right){}{\mathrm{_Z}}{+}{\mathrm{\beta }}{}{g}{}{a}\right){}{z}}{{g}{}{a}}$ (13)

References

 Ronveaux, A. ed. Heun's Differential Equations. Oxford University Press, 1995.
 Slavyanov, S.Y., and Lay, W. Special Functions, A Unified Theory Based on Singularities. Oxford Mathematical Monographs, 2000.
{"ft_lang_label":"__label__en","ft_lang_prob":0.86760503,"math_prob":1.0000094,"size":5049,"snap":"2019-51-2020-05","text_gpt3_token_len":1300,"char_repetition_ratio":0.15718533,"word_repetition_ratio":0.049142856,"special_character_ratio":0.26638937,"punctuation_ratio":0.12747253,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9998777,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-11T20:37:00Z\",\"WARC-Record-ID\":\"<urn:uuid:b95afa67-83b1-4d86-a881-e7b9d35d9365>\",\"Content-Length\":\"766686\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:df48680f-2c17-40cb-b573-707c17d258ea>\",\"WARC-Concurrent-To\":\"<urn:uuid:9e0fca10-5ef6-40b2-8a70-cf43e3f66211>\",\"WARC-IP-Address\":\"199.71.183.28\",\"WARC-Target-URI\":\"https://www.maplesoft.com/support/help/maple/view.aspx?path=HeunG\",\"WARC-Payload-Digest\":\"sha1:5RR5Y4XLA7RDQ73UG6OPMWPUE4HCQL5G\",\"WARC-Block-Digest\":\"sha1:7ZRRUENCACIM7MSWNII37IWAI4M4TU3Q\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540532624.3_warc_CC-MAIN-20191211184309-20191211212309-00393.warc.gz\"}"}