HeunC - Maple Programming Help

HeunC

The Heun Confluent function

HeunCPrime

The derivative of the Heun Confluent function

 Calling Sequence HeunC($\mathrm{\alpha }$, $\mathrm{\beta }$, $\mathrm{\gamma }$, $\mathrm{\delta }$, $\mathrm{\eta }$, z) HeunCPrime($\mathrm{\alpha }$, $\mathrm{\beta }$, $\mathrm{\gamma }$, $\mathrm{\delta }$, $\mathrm{\eta }$, z)

Parameters

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

Description

 • The HeunC function is the solution of the Heun Confluent equation. Following the first reference (at the end), the equation and the conditions at the origin satisfied by HeunC are
 ${\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){=}{\mathrm{DESol}}{}\left(\left\{\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{\mathrm{_Y}}{}\left({z}\right){-}\frac{\left({-}{{z}}^{{2}}{}{\mathrm{α}}{+}\left({-}{\mathrm{β}}{+}{\mathrm{α}}{-}{\mathrm{γ}}{-}{2}\right){}{z}{+}{\mathrm{β}}{+}{1}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{\mathrm{_Y}}{}\left({z}\right)\right)}{{z}{}\left({z}{-}{1}\right)}{-}\frac{{1}}{{2}}{}\frac{\left(\left(\left({-}{\mathrm{β}}{-}{\mathrm{γ}}{-}{2}\right){}{\mathrm{α}}{-}{2}{}{\mathrm{δ}}\right){}{z}{+}\left({\mathrm{β}}{+}{1}\right){}{\mathrm{α}}{+}\left({-}{\mathrm{γ}}{-}{1}\right){}{\mathrm{β}}{-}{2}{}{\mathrm{η}}{-}{\mathrm{γ}}\right){}{\mathrm{_Y}}{}\left({z}\right)}{{z}{}\left({z}{-}{1}\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{{1}}{{2}}{}\frac{\left({-}{\mathrm{α}}{+}{1}{+}{\mathrm{γ}}\right){}{\mathrm{β}}{+}{\mathrm{γ}}{-}{\mathrm{α}}{+}{2}{}{\mathrm{η}}}{{\mathrm{β}}{+}{1}}\right\}\right)$ (1)
 • This Heun (singly) Confluent equation is obtained from the Heun General equation through a confluence process, that is, a process where two singularities coalesce, performed by redefining parameters and taking limits, resulting in a single (typically irregular) singularity. The Heun Confluent equation thus has two regular singularities and one irregular singularity, and includes as particular cases both the 2F1 and 1F1 hypergeometric equations. The solution to the 2F1 equation,
 > DEtools[hyperode]( hypergeom([a,b],[c],z), y(z) ) = 0;
 ${y}{}\left({z}\right){}{a}{}{b}{+}\left(\left({a}{+}{b}{+}{1}\right){}{z}{-}{c}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{y}{}\left({z}\right)\right){+}\left({{z}}^{{2}}{-}{z}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{y}{}\left({z}\right)\right){=}{0}$ (2)
 can then be expressed in terms of HeunC functions
 > dsolve((2), [HeunC]);
 ${y}{}\left({z}\right){=}{\mathrm{_C1}}{}{\mathrm{HeunC}}{}\left({0}{,}{-}{b}{+}{a}{,}{c}{-}{1}{,}{0}{,}\frac{{1}}{{2}}{}\left({-}{2}{}{a}{+}{c}\right){}{b}{+}\frac{{1}}{{2}}{}{a}{}{c}{-}\frac{{1}}{{2}}{}{c}{+}\frac{{1}}{{2}}{,}{-}\frac{{1}}{{z}{-}{1}}\right){}{\left({z}{-}{1}\right)}^{{-}{a}}{+}{\mathrm{_C2}}{}{\mathrm{HeunC}}{}\left({0}{,}{b}{-}{a}{,}{c}{-}{1}{,}{0}{,}\frac{{1}}{{2}}{}\left({-}{2}{}{a}{+}{c}\right){}{b}{+}\frac{{1}}{{2}}{}{a}{}{c}{-}\frac{{1}}{{2}}{}{c}{+}\frac{{1}}{{2}}{,}{-}\frac{{1}}{{z}{-}{1}}\right){}{\left({z}{-}{1}\right)}^{{-}{b}}$ (3)
 and the same for the 1F1 hypergeometric confluent equation
 > DEtools[hyperode]( hypergeom([a],[c],z), y(z) ) = 0;
 ${a}{}{y}{}\left({z}\right){+}\left({-}{c}{+}{z}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{y}{}\left({z}\right)\right){-}{z}{}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{y}{}\left({z}\right)\right){=}{0}$ (4)
 > dsolve((4), [HeunC]);
 ${y}{}\left({z}\right){=}{\mathrm{_C1}}{}{{ⅇ}}^{{z}}{}{\mathrm{HeunC}}{}\left({1}{,}{c}{-}{1}{,}{-}{1}{,}{-}{a}{+}\frac{{1}}{{2}}{}{c}{,}{-}\frac{{1}}{{2}}{}{c}{+}{a}{+}\frac{{1}}{{2}}{,}{z}\right){+}{\mathrm{_C2}}{}{{ⅇ}}^{{z}}{}{{z}}^{{-}{c}{+}{1}}{}{\mathrm{HeunC}}{}\left({1}{,}{-}{c}{+}{1}{,}{-}{1}{,}{-}{a}{+}\frac{{1}}{{2}}{}{c}{,}{-}\frac{{1}}{{2}}{}{c}{+}{a}{+}\frac{{1}}{{2}}{,}{z}\right)$ (5)
 HeunC, thus, contains as particular cases all the hypergeometric functions of the 2F1 and 1F1 classes - some of these specializations are listed at the end of the Examples section.
 • Two other important non-hypergeometric case of Heun's Confluent equation, are the "spheroidal wave function" equation
 > diff(y(z),z,z) + 2*(gamma+1)*z*diff(y(z),z)/(z^2-1) + (4*delta*z^2-c)/(z^2-1)*y(z) = 0;
 $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{y}{}\left({z}\right){+}\frac{{2}{}\left({\mathrm{γ}}{+}{1}\right){}{z}{}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{y}{}\left({z}\right)\right)}{{{z}}^{{2}}{-}{1}}{+}\frac{\left({4}{}{\mathrm{δ}}{}{{z}}^{{2}}{-}{c}\right){}{y}{}\left({z}\right)}{{{z}}^{{2}}{-}{1}}{=}{0}$ (6)
 obtained from Heun's Confluent equation taking $\left\{\mathrm{\alpha }=0,\mathrm{\beta }=-\frac{1}{2},\mathrm{\eta }=\frac{\left(1-\mathrm{\gamma }-c\right)}{4}\right\}$ and changing $z$ -> ${z}^{2}$;
 and the rational form of Mathieu's equation,
 > diff(y(z),z,z) + z/(z^2-1)*diff(y(z),z) + (2*delta*(2*z^2-1)-a)/(z^2-1)*y(z) = 0;
 $\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{y}{}\left({z}\right){+}\frac{{z}{}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{y}{}\left({z}\right)\right)}{{{z}}^{{2}}{-}{1}}{+}\frac{\left({2}{}{\mathrm{δ}}{}\left({2}{}{{z}}^{{2}}{-}{1}\right){-}{a}\right){}{y}{}\left({z}\right)}{{{z}}^{{2}}{-}{1}}{=}{0}$ (7)
 obtained from the spheroidal wave function equation above by taking $c=a+2\mathrm{\delta }$ and further specializing $\mathrm{\gamma }=-\frac{1}{2}$.
 • The HeunC($\mathrm{\alpha }$,$\mathrm{\beta }$,$\mathrm{\gamma }$,$\mathrm{\delta }$,$\mathrm{\eta }$, z) function is a local (Frobenius) solution to Heun's Confluent equation, computed as a power series expansion around the origin, a regular singular point. The series converges for $\left|z\right|<1$, where the second regular singularity is located. An analytic continuation of HeunC is obtained through identities, relating the values of the function in different regions of the $z$ plane, for given values of the other parameters, or by expanding the solution around 1, the other regular singularity, and overlapping the series. General formulas relating these series expansions at different singularities and for arbitrary values of the other parameters, however, are not known at present.
 • A special case happens when the parameters entering HeunC are such that the function is, simultaneously, a Frobenius solution around the two regular singularities and hence analytic in a domain containing both of them. In such a case the series expansion for HeunC truncates and the function becomes a polynomial. A necessary (not sufficient) condition for this case is that $\mathrm{\delta }=-\left(n+\frac{\left(\mathrm{\gamma }+\mathrm{\beta }+2\right)}{2}\right)\mathrm{\alpha }$, with $n$ a positive integer, and $\mathrm{\eta }$ has one of a finite number of characteristic values, so that the function is a polynomial of degree $n$.

Examples

Heun's Confluent equation,

 > $\mathrm{CHE}≔\frac{{ⅆ}^{2}}{ⅆ{z}^{2}}y\left(z\right)=\frac{\left(-{z}^{2}\mathrm{α}+\left(-2-\mathrm{β}-\mathrm{γ}+\mathrm{α}\right)z+1+\mathrm{β}\right)\left(\frac{ⅆ}{ⅆz}y\left(z\right)\right)}{z\left(z-1\right)}+\frac{1\left(\left(\left(-\mathrm{β}-\mathrm{γ}-2\right)\mathrm{α}-2\mathrm{δ}\right)z+\left(\mathrm{β}+1\right)\mathrm{α}+\left(-\mathrm{γ}-1\right)\mathrm{β}-\mathrm{γ}-2\mathrm{η}\right)y\left(z\right)}{2z\left(z-1\right)}$
 ${\mathrm{CHE}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{z}}^{{2}}}{}{y}{}\left({z}\right){=}\frac{\left({-}{{z}}^{{2}}{}{\mathrm{α}}{+}\left({-}{2}{-}{\mathrm{β}}{-}{\mathrm{γ}}{+}{\mathrm{α}}\right){}{z}{+}{1}{+}{\mathrm{β}}\right){}\left(\frac{{ⅆ}}{{ⅆ}{z}}{}{y}{}\left({z}\right)\right)}{{z}{}\left({z}{-}{1}\right)}{+}\frac{{1}}{{2}}{}\frac{\left(\left(\left({-}{\mathrm{β}}{-}{\mathrm{γ}}{-}{2}\right){}{\mathrm{α}}{-}{2}{}{\mathrm{δ}}\right){}{z}{+}\left({\mathrm{β}}{+}{1}\right){}{\mathrm{α}}{+}\left({-}{\mathrm{γ}}{-}{1}\right){}{\mathrm{β}}{-}{\mathrm{γ}}{-}{2}{}{\mathrm{η}}\right){}{y}{}\left({z}\right)}{{z}{}\left({z}{-}{1}\right)}$ (8)

can be transformed into another version of itself, that is, an equation with two regular singularities and one irregular singularity respectively located at $\left\{0,1,\mathrm{\infty }\right\}$, through transformations of the form

 > $y\left(z\right)={z}^{\frac{\left(\mathrm{μ}-1\right)\mathrm{β}}{2}}{\left(z-1\right)}^{\frac{\left(\mathrm{ν}-1\right)\mathrm{γ}}{2}}{ⅇ}^{\frac{\left(\mathrm{ρ}-1\right)\mathrm{α}z}{2}}u\left(z\right)$
 ${y}{}\left({z}\right){=}{{z}}^{\frac{{1}}{{2}}{}\left({\mathrm{μ}}{-}{1}\right){}{\mathrm{β}}}{}{\left({z}{-}{1}\right)}^{\frac{{1}}{{2}}{}\left({\mathrm{ν}}{-}{1}\right){}{\mathrm{γ}}}{}{{ⅇ}}^{\frac{{1}}{{2}}{}\left({\mathrm{ρ}}{-}{1}\right){}{\mathrm{α}}{}{z}}{}{u}{}\left({z}\right)$ (9)

where ${\mathrm{\lambda }}^{2}=1$, ${\mathrm{\mu }}^{2}=1$ and ${\mathrm{\nu }}^{2}=1$. Under this transformation, the HeunC parameters transform according to $\mathrm{\alpha }$ -> $\mathrm{\alpha }\mathrm{\lambda }$, $\mathrm{\beta }$ -> $\mathrm{\beta }\mathrm{\mu }$ and $\mathrm{\gamma }$ -> $\mathrm{\gamma }\mathrm{\nu }$. These transformations form a group of eight elements and imply on a number of identities, among which you have

 > $\mathrm{FunctionAdvisor}\left(\mathrm{identities},\mathrm{HeunC}\right)$
 $\left[\left[{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){=}{\left({1}{-}{z}\right)}^{{-}{\mathrm{γ}}}{}{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{-}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){,}{\mathrm{And}}{}\left({\mathrm{β}}{::}\left({\mathrm{Not}}{}\left({\mathrm{integer}}\right)\right){,}\left|{z}\right|{<}{1}\right)\right]{,}\left[{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){=}{{ⅇ}}^{{-}{z}{}{\mathrm{α}}}{}{\mathrm{HeunC}}{}\left({-}{\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){,}{\mathrm{And}}{}\left({\mathrm{β}}{::}\left({\mathrm{Not}}{}\left({\mathrm{integer}}\right)\right){,}\left|{z}\right|{<}{1}\right)\right]\right]$ (10)

Changing $z$ -> $1-t$ also results in a HeunC equation with the singularities located at $\left\{0,1,\mathrm{\infty }\right\}$; this permits rewriting the solution to the CHE in different manners. For example, the general solution returned by default by dsolve is

 > $\mathrm{dsolve}\left(\mathrm{CHE}\right)$
 ${y}{}\left({z}\right){=}{\mathrm{_C1}}{}{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right){+}{\mathrm{_C2}}{}{{z}}^{{-}{\mathrm{β}}}{}{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{-}{\mathrm{β}}{,}{\mathrm{γ}}{,}{\mathrm{δ}}{,}{\mathrm{η}}{,}{z}\right)$ (11)

When $\mathrm{\beta }$ is an integer, however, these two "independent" solutions are not independent, yet a second pair of independent solutions can be constructed exploring this invariance in form under $z$ -> $1-t$

 > $\mathrm{dsolve}\left(\mathrm{CHE}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}assuming\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{β}::\mathrm{integer}$
 ${y}{}\left({z}\right){=}{\mathrm{_C1}}{}{\mathrm{HeunC}}{}\left({-}{\mathrm{α}}{,}{\mathrm{γ}}{,}{\mathrm{β}}{,}{-}{\mathrm{δ}}{,}{\mathrm{η}}{+}{\mathrm{δ}}{,}{1}{-}{z}\right){+}{\mathrm{_C2}}{}{\left({z}{-}{1}\right)}^{{-}{\mathrm{γ}}}{}{\mathrm{HeunC}}{}\left({-}{\mathrm{α}}{,}{-}{\mathrm{γ}}{,}{\mathrm{β}}{,}{-}{\mathrm{δ}}{,}{\mathrm{η}}{+}{\mathrm{δ}}{,}{1}{-}{z}\right)$ (12)

For $z$ different from 1, the 2F1 and the confluent 1F1 hypergeometric functions are related to HeunC by

 > $\mathrm{FunctionAdvisor}\left(\mathrm{specialize},\mathrm{hypergeom},\mathrm{HeunC}\right)$
 $\left[{\mathrm{hypergeom}}{}\left(\left[{a}{,}{b}\right]{,}\left[{c}\right]{,}{z}\right){=}\frac{{\mathrm{HeunC}}{}\left({0}{,}{c}{-}{1}{,}{b}{-}{a}{,}{0}{,}\frac{{1}}{{2}}{}\left({a}{+}{b}{-}{1}\right){}{c}{-}{b}{}{a}{+}\frac{{1}}{{2}}{,}\frac{{z}}{{z}{-}{1}}\right)}{{\left({1}{-}{z}\right)}^{{b}}}{,}{\mathrm{And}}{}\left({z}{\ne }{1}\right)\right]{,}\left[{\mathrm{hypergeom}}{}\left(\left[{a}\right]{,}\left[{b}\right]{,}{z}\right){=}{\mathrm{HeunC}}{}\left({1}{,}{b}{-}{1}{,}{1}{,}{-}\frac{{1}}{{2}}{}{b}{+}{a}{,}\frac{{1}}{{2}}{}{b}{-}{a}{+}\frac{{1}}{{2}}{,}{-}{z}\right){}\left({z}{+}{1}\right){,}{\mathrm{And}}{}\left({z}{\ne }{-}{1}\right)\right]$ (13)

When $\mathrm{\delta }=-\left(n+\frac{\left(\mathrm{\gamma }+\mathrm{\beta }+2\right)}{2}\right)\mathrm{\alpha }$, with $n$ a positive integer, the $n$th + 1 coefficient in the series expansion is a polynomial in $\mathrm{\eta }$ of order $n+1$. If $\mathrm{\delta }$ is a root of that polynomial, that coefficient is zero and with it all the following ones; the series then truncates and HeunC is a polynomial. For example, the necessary condition for a polynomial form is

 > $\mathrm{HeunC}\left(\mathrm{α},\mathrm{β},\mathrm{γ},-\mathrm{α}\left(n+\frac{\mathrm{γ}+2+\mathrm{β}}{2}\right),\mathrm{η},z\right)$
 ${\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{-}{\mathrm{α}}{}\left({n}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}{+}\frac{{1}}{{2}}{}{\mathrm{β}}{+}{1}\right){,}{\mathrm{η}}{,}{z}\right)$ (14)

Considering the first non-trivial case, for $n=1$, the function is

 > $\mathrm{HC}≔\mathrm{subs}\left(n=1,\right)$
 ${\mathrm{HC}}{≔}{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{-}{\mathrm{α}}{}\left({2}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}{+}\frac{{1}}{{2}}{}{\mathrm{β}}\right){,}{\mathrm{η}}{,}{z}\right)$ (15)

So the coefficient of ${z}^{2}$ in the series expansion is

 > $Q≔\mathrm{simplify}\left(\mathrm{series}\left(\mathrm{HC},z,3\right),\mathrm{size}\right)$
 ${Q}{≔}{1}{+}\frac{\left({-}{\mathrm{α}}{+}{1}{+}{\mathrm{γ}}\right){}{\mathrm{β}}{+}{\mathrm{γ}}{-}{\mathrm{α}}{+}{2}{}{\mathrm{η}}}{{2}{}{\mathrm{β}}{+}{2}}{}{z}{+}\frac{{1}}{{8}}{}\frac{\left({\mathrm{α}}{-}{\mathrm{γ}}{-}{1}\right){}\left({\mathrm{α}}{-}{\mathrm{γ}}{-}{3}\right){}{{\mathrm{β}}}^{{2}}{+}\left({4}{}{{\mathrm{α}}}^{{2}}{+}\left({-}{4}{}{\mathrm{η}}{-}{8}{}{\mathrm{γ}}{-}{14}\right){}{\mathrm{α}}{+}{4}{}\left({\mathrm{γ}}{+}{2}\right){}\left({\mathrm{γ}}{+}{\mathrm{η}}{+}\frac{{1}}{{2}}\right)\right){}{\mathrm{β}}{+}{3}{}{{\mathrm{α}}}^{{2}}{+}\left({-}{8}{}{\mathrm{η}}{-}{6}{}{\mathrm{γ}}{-}{8}\right){}{\mathrm{α}}{+}{4}{}\left({\mathrm{η}}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}\right){}\left({\mathrm{η}}{+}\frac{{3}}{{2}}{}{\mathrm{γ}}{+}{2}\right)}{\left({\mathrm{β}}{+}{1}\right){}\left({\mathrm{β}}{+}{2}\right)}{}{{z}}^{{2}}{+}{\mathrm{O}}\left({{z}}^{{3}}\right)$ (16)
 > $\mathrm{c2}≔\mathrm{coeff}\left(Q,z,2\right)$
 ${\mathrm{c2}}{≔}\frac{{1}}{{8}}{}\frac{\left({\mathrm{α}}{-}{\mathrm{γ}}{-}{1}\right){}\left({\mathrm{α}}{-}{\mathrm{γ}}{-}{3}\right){}{{\mathrm{β}}}^{{2}}{+}\left({4}{}{{\mathrm{α}}}^{{2}}{+}\left({-}{4}{}{\mathrm{η}}{-}{8}{}{\mathrm{γ}}{-}{14}\right){}{\mathrm{α}}{+}{4}{}\left({\mathrm{γ}}{+}{2}\right){}\left({\mathrm{γ}}{+}{\mathrm{η}}{+}\frac{{1}}{{2}}\right)\right){}{\mathrm{β}}{+}{3}{}{{\mathrm{α}}}^{{2}}{+}\left({-}{8}{}{\mathrm{η}}{-}{6}{}{\mathrm{γ}}{-}{8}\right){}{\mathrm{α}}{+}{4}{}\left({\mathrm{η}}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}\right){}\left({\mathrm{η}}{+}\frac{{3}}{{2}}{}{\mathrm{γ}}{+}{2}\right)}{\left({\mathrm{β}}{+}{1}\right){}\left({\mathrm{β}}{+}{2}\right)}$ (17)

solving for $\mathrm{\eta }$, requesting from solve to return using RootOf, you have

 > $\mathrm{_EnvExplicit}≔\mathrm{false}$
 ${\mathrm{_EnvExplicit}}{≔}{\mathrm{false}}$ (18)
 > $\mathrm{η}=\mathrm{solve}\left(\mathrm{c2},\mathrm{η}\right)$
 ${\mathrm{η}}{=}{\mathrm{RootOf}}{}\left({4}{}{{\mathrm{_Z}}}^{{2}}{+}\left({-}{4}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{β}}{}{\mathrm{γ}}{-}{8}{}{\mathrm{α}}{+}{8}{}{\mathrm{β}}{+}{8}{}{\mathrm{γ}}{+}{8}\right){}{\mathrm{_Z}}{+}{{\mathrm{α}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{-}{2}{}{\mathrm{γ}}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{+}{{\mathrm{γ}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{α}}}^{{2}}{}{\mathrm{β}}{-}{4}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{-}{8}{}{\mathrm{γ}}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{γ}}}^{{2}}{}{\mathrm{β}}{+}{3}{}{{\mathrm{α}}}^{{2}}{-}{14}{}{\mathrm{α}}{}{\mathrm{β}}{-}{6}{}{\mathrm{α}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{β}}}^{{2}}{+}{10}{}{\mathrm{β}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{γ}}}^{{2}}{-}{8}{}{\mathrm{α}}{+}{4}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}\right)$ (19)

substituting in $\mathrm{HC}$ we have

 > $\mathrm{HC_polynomial}≔\mathrm{subs}\left(,\mathrm{HC}\right)$
 ${\mathrm{HC_polynomial}}{≔}{\mathrm{HeunC}}{}\left({\mathrm{α}}{,}{\mathrm{β}}{,}{\mathrm{γ}}{,}{-}{\mathrm{α}}{}\left({2}{+}\frac{{1}}{{2}}{}{\mathrm{γ}}{+}\frac{{1}}{{2}}{}{\mathrm{β}}\right){,}{\mathrm{RootOf}}{}\left({4}{}{{\mathrm{_Z}}}^{{2}}{+}\left({-}{4}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{β}}{}{\mathrm{γ}}{-}{8}{}{\mathrm{α}}{+}{8}{}{\mathrm{β}}{+}{8}{}{\mathrm{γ}}{+}{8}\right){}{\mathrm{_Z}}{+}{{\mathrm{α}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{-}{2}{}{\mathrm{γ}}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{+}{{\mathrm{γ}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{α}}}^{{2}}{}{\mathrm{β}}{-}{4}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{-}{8}{}{\mathrm{γ}}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{γ}}}^{{2}}{}{\mathrm{β}}{+}{3}{}{{\mathrm{α}}}^{{2}}{-}{14}{}{\mathrm{α}}{}{\mathrm{β}}{-}{6}{}{\mathrm{α}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{β}}}^{{2}}{+}{10}{}{\mathrm{β}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{γ}}}^{{2}}{-}{8}{}{\mathrm{α}}{+}{4}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}\right){,}{z}\right)$ (20)

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

 > $\genfrac{}{}{0}{}{\phantom{\mathrm{HeunC}=\mathrm{HeunC}:-\mathrm{SpecialValues}:-\mathrm{Polynomial}}}{}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{}}{\mathrm{HeunC}=\mathrm{HeunC}:-\mathrm{SpecialValues}:-\mathrm{Polynomial}}$
 ${1}{+}\frac{\left(\left({-}{\mathrm{α}}{+}{1}{+}{\mathrm{γ}}\right){}{\mathrm{β}}{+}{\mathrm{γ}}{-}{\mathrm{α}}{+}{2}{}{\mathrm{RootOf}}{}\left({4}{}{{\mathrm{_Z}}}^{{2}}{+}\left({-}{4}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{β}}{}{\mathrm{γ}}{-}{8}{}{\mathrm{α}}{+}{8}{}{\mathrm{β}}{+}{8}{}{\mathrm{γ}}{+}{8}\right){}{\mathrm{_Z}}{+}{{\mathrm{α}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{-}{2}{}{\mathrm{γ}}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{+}{{\mathrm{γ}}}^{{2}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{α}}}^{{2}}{}{\mathrm{β}}{-}{4}{}{\mathrm{α}}{}{{\mathrm{β}}}^{{2}}{-}{8}{}{\mathrm{γ}}{}{\mathrm{α}}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}{}{{\mathrm{β}}}^{{2}}{+}{4}{}{{\mathrm{γ}}}^{{2}}{}{\mathrm{β}}{+}{3}{}{{\mathrm{α}}}^{{2}}{-}{14}{}{\mathrm{α}}{}{\mathrm{β}}{-}{6}{}{\mathrm{α}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{β}}}^{{2}}{+}{10}{}{\mathrm{β}}{}{\mathrm{γ}}{+}{3}{}{{\mathrm{γ}}}^{{2}}{-}{8}{}{\mathrm{α}}{+}{4}{}{\mathrm{β}}{+}{4}{}{\mathrm{γ}}\right)\right){}{z}}{{2}{}{\mathrm{β}}{+}{2}}$ (21)

References

 Decarreau, A.; Dumont-Lepage, M.C.; Maroni, P.; Robert, A.; and Ronveaux, A. "Formes Canoniques de Equations confluentes de l'equation de Heun." Annales de la Societe Scientifique de Bruxelles. Vol. 92 I-II, (1978): 53-78.
 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.