\[ y(x) \left (a \text {sn}(x|k)^2+b\right )+y''(x)=0 \] ✓ Mathematica : cpu = 0.768449 (sec), leaf count = 235
DSolve[(b + a*JacobiSN[x, k]^2)*y[x] + Derivative[2][y][x] == 0,y[x],x]
\[\left \{\left \{y(x)\to c_1 \sqrt {k \text {sn}(x|k)^2-1} \text {HeunG}\left [\frac {1}{k},-\frac {b-k}{4 k},\frac {\sqrt {k-4 a}+3 \sqrt {k}}{4 \sqrt {k}},\frac {\sqrt {k} \sqrt {k-4 a}+2 a+k}{2 \sqrt {k} \left (\sqrt {k-4 a}+\sqrt {k}\right )},\frac {1}{2},\frac {1}{2},\text {sn}(x|k)^2\right ]+c_2 \text {sn}(x|k) \sqrt {k \text {sn}(x|k)^2-1} \text {HeunG}\left [\frac {1}{k},-\frac {b-4 k-1}{4 k},\frac {\sqrt {k-4 a}+5 \sqrt {k}}{4 \sqrt {k}},\frac {\sqrt {k} \sqrt {k-4 a}+a+k}{\sqrt {k} \left (\sqrt {k-4 a}+\sqrt {k}\right )},\frac {3}{2},\frac {1}{2},\text {sn}(x|k)^2\right ]\right \}\right \}\] ✓ Maple : cpu = 0.332 (sec), leaf count = 69
dsolve(diff(diff(y(x),x),x)-(n*(n+1)*k^2*JacobiSN(x,k)^2+b)*y(x)=0,y(x))
\[y \left (x \right ) = c_{1} \mathit {HG}\left (\frac {1}{k^{2}}, \frac {b}{4 k^{2}}, -\frac {n}{2}, \frac {n}{2}+\frac {1}{2}, \frac {1}{2}, \frac {1}{2}, \mathrm {sn}\left (x | k \right )^{2}\right )+c_{2} \mathit {HG}\left (\frac {1}{k^{2}}, \frac {k^{2}+b +1}{4 k^{2}}, \frac {n}{2}+1, -\frac {n}{2}+\frac {1}{2}, \frac {3}{2}, \frac {1}{2}, \mathrm {sn}\left (x | k \right )^{2}\right ) \mathrm {sn}\left (x | k \right )\]