4.36.19 \(\left (1-a^2 \cos ^2(x)\right ) y''(x)+a^2 \sin (x) \cos (x) y'(x)+y(x) \left (\text {a0}+\text {a1} \cos ^2(x)\right )=0\)

ODE
\[ \left (1-a^2 \cos ^2(x)\right ) y''(x)+a^2 \sin (x) \cos (x) y'(x)+y(x) \left (\text {a0}+\text {a1} \cos ^2(x)\right )=0 \] ODE Classification

[[_2nd_order, _with_linear_symmetries]]

Book solution method
TO DO

Mathematica
cpu = 14.5543 (sec), leaf count = 0 , could not solve

DSolve[(a0 + a1*Cos[x]^2)*y[x] + a^2*Cos[x]*Sin[x]*Derivative[1][y][x] + (1 - a^2*Cos[x]^2)*Derivative[2][y][x] == 0, y[x], x]

Maple
cpu = 0.863 (sec), leaf count = 217

\[ \left \{ y \left ( x \right ) ={1\sqrt {{a}^{2}\cos \left ( 2\,x \right ) +{a}^{2}-2} \left ( \sqrt [4]{-2\,\cos \left ( 2\,x \right ) +2}{\it HeunG} \left ( {a}^{-2},{\frac {4\,{a}^{2}-{\it a0}+1}{4\,{a}^{2}}},{\frac {1}{4\,a} \left ( 5\,a+\sqrt {{a}^{2}-4\,{\it a1}} \right ) },{\frac {1}{a} \left ( \sqrt {{a}^{2}-4\,{\it a1}}a+{a}^{2}+{\it a1} \right ) \left ( a+\sqrt {{a}^{2}-4\,{\it a1}} \right ) ^{-1}},{\frac {3}{2}},{\frac {1}{2}},{\frac {\cos \left ( 2\,x \right ) }{2}}+{\frac {1}{2}} \right ) \left ( 2\,\cos \left ( 2\,x \right ) +2 \right ) ^{{\frac {3}{4}}}{\it \_C2}+{\it HeunG} \left ( {a}^{-2},{\frac {{a}^{2}-{\it a0}}{4\,{a}^{2}}},{\frac {1}{4\,a} \left ( 3\,a+\sqrt {{a}^{2}-4\,{\it a1}} \right ) },{\frac {1}{2\,a} \left ( \sqrt {{a}^{2}-4\,{\it a1}}a+{a}^{2}+2\,{\it a1} \right ) \left ( a+\sqrt {{a}^{2}-4\,{\it a1}} \right ) ^{-1}},{\frac {1}{2}},{\frac {1}{2}},{\frac {\cos \left ( 2\,x \right ) }{2}}+{\frac {1}{2}} \right ) \sqrt {\sin \left ( 2\,x \right ) }{\it \_C1} \right ) {\frac {1}{\sqrt {\sin \left ( 2\,x \right ) }}}} \right \} \] Mathematica raw input

DSolve[(a0 + a1*Cos[x]^2)*y[x] + a^2*Cos[x]*Sin[x]*y'[x] + (1 - a^2*Cos[x]^2)*y''[x] == 0,y[x],x]

Mathematica raw output

DSolve[(a0 + a1*Cos[x]^2)*y[x] + a^2*Cos[x]*Sin[x]*Derivative[1][y][x] + (1 - a^
2*Cos[x]^2)*Derivative[2][y][x] == 0, y[x], x]

Maple raw input

dsolve((1-a^2*cos(x)^2)*diff(diff(y(x),x),x)+a^2*diff(y(x),x)*cos(x)*sin(x)+(a0+a1*cos(x)^2)*y(x) = 0, y(x),'implicit')

Maple raw output

y(x) = (a^2*cos(2*x)+a^2-2)^(1/2)*((-2*cos(2*x)+2)^(1/4)*HeunG(1/a^2,1/4*(4*a^2-
a0+1)/a^2,1/4/a*(5*a+(a^2-4*a1)^(1/2)),1/a/(a+(a^2-4*a1)^(1/2))*((a^2-4*a1)^(1/2
)*a+a^2+a1),3/2,1/2,1/2*cos(2*x)+1/2)*(2*cos(2*x)+2)^(3/4)*_C2+HeunG(1/a^2,1/4/a
^2*(a^2-a0),1/4*(3*a+(a^2-4*a1)^(1/2))/a,1/2/a/(a+(a^2-4*a1)^(1/2))*((a^2-4*a1)^
(1/2)*a+a^2+2*a1),1/2,1/2,1/2*cos(2*x)+1/2)*sin(2*x)^(1/2)*_C1)/sin(2*x)^(1/2)