# Non-constant-coefficient second-order linear ODE

I came across this equation in my research (related to reaction diffusion system): $$\frac{d^2y}{dr^2}+B\operatorname{sech}^2(r) \frac{dy}{dr} + Cy = 0$$ where $$B$$ and $$C$$ are constants. Can it be solved analytically?

Making the change of the independent variable $$x=e^{it}$$, we obtain $$x^2w''+xw'+\frac{4iBx^3}{(x^2+1)^2}w'-Cw=0.$$ This equation has $$2$$ regular singularities $$0,\infty$$, and irregular at $$\pm i$$. Therefore for generic $$B$$ and $$C$$ its solutions cannot be expressed in terms of functions of hypergeometric type, or any other usual special functions.

Mathematica cannot solve this ODE even when $$B=C=1$$:

So, it seems very unlikely that this ODE can be solved explicitly.

Maple gives the solution in terms of the Heun confluent function. $$y \! \left(r \right) = c_1 \mathit{HeunC}\! \left(2 B , \mathrm{i} \sqrt{C}, \mathrm{i} \sqrt{C}, -2 B , -\frac{C}{2}+B , \frac{\tanh \! \left(r \right)}{2}+\frac{1}{2}\right) \left(\cosh^{\mathrm{-i} \sqrt{C}}\left(r \right)\right)+c_2 \mathit{HeunC}\! \left(2 B , \mathrm{-i} \sqrt{C}, \mathrm{i} \sqrt{C}, -2 B , -\frac{C}{2}+B , \frac{\tanh \! \left(r \right)}{2}+\frac{1}{2}\right) \left(\frac{\tanh \! \left(r \right)}{2}+\frac{1}{2}\right)^{-\frac{\mathrm{i}}{2} \sqrt{C}} \left(-\frac{1}{2}+\frac{\tanh \! \left(r \right)}{2}\right)^{\frac{\mathrm{i}}{2} \sqrt{C}}$$

Like Josif Pinelis, I use the substitution $$e^{2r}=x$$. This leads to the equation $$C(1 + x)^2 y + 4 x (1 + 2 (1 + B) x + x^2) y' + 4x^2 (1 + x)^2 y''=0.$$ This has regular singular points at 0 and $$\infty$$ and an irregular singular point at $$-1$$, so it is a confluent Heun equation.

• With that said, even though software packages include Heun functions, actually using them may be tricky due to branch cuts. Determining where the software puts branch cuts and how to change it is far from easy. I once tried and got nowhere. Commented Feb 3, 2022 at 4:27
• This cannot be a confluent Heun equation since Heun equation has 4 singularities, and under the "confluence" some of them must collide. So you will obtain less than 4. Commented Feb 4, 2022 at 21:12
• 0, $\infty$, and $-1$ ... Commented Feb 4, 2022 at 23:55
• You are right, it is a confluent Heun equation. Commented Feb 5, 2022 at 3:16