4.25.48 \(-2 \tan (a) y'(x)+\csc ^2(a) y(x)+y''(x)=x^2 e^{x \tan (a)}\)

ODE
\[ -2 \tan (a) y'(x)+\csc ^2(a) y(x)+y''(x)=x^2 e^{x \tan (a)} \] ODE Classification

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.241353 (sec), leaf count = 250

\[\left \{\left \{y(x)\to \frac {64 \cos ^4(a) \exp \left (-x \sqrt {\frac {8 \cos (2 a)-\cos (4 a)+1}{\cos (4 a)-1}}\right ) \left (\cos (2 a) \tan ^2(a) \left (2 c_1 e^{x \tan (a)}+2 c_2 e^{x \left (\tan (a)+2 \sqrt {\tan ^2(a)-\csc ^2(a)}\right )}+x^2 e^{x \left (\tan (a)+\sqrt {\tan ^2(a)-\csc ^2(a)}\right )}\right )+\sin ^4(a) \left (c_1 e^{x \tan (a)}+c_2 e^{x \left (\tan (a)+2 \sqrt {\tan ^2(a)-\csc ^2(a)}\right )}+\left (x^2-2\right ) e^{x \left (\tan (a)+\sqrt {\tan ^2(a)-\csc ^2(a)}\right )}\right )+\cos ^2(2 a) \sec ^4(a) \left (c_1 e^{x \tan (a)}+c_2 e^{x \left (\tan (a)+2 \sqrt {\tan ^2(a)-\csc ^2(a)}\right )}\right )\right )}{(-8 \cos (2 a)+\cos (4 a)-1)^2}\right \}\right \}\]

Maple
cpu = 0.105 (sec), leaf count = 181

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

DSolve[Csc[a]^2*y[x] - 2*Tan[a]*y'[x] + y''[x] == E^(x*Tan[a])*x^2,y[x],x]

Mathematica raw output

{{y[x] -> (64*Cos[a]^4*((E^(x*Tan[a])*C[1] + E^(x*(Tan[a] + 2*Sqrt[-Csc[a]^2 + T
an[a]^2]))*C[2])*Cos[2*a]^2*Sec[a]^4 + (E^(x*(Tan[a] + Sqrt[-Csc[a]^2 + Tan[a]^2
]))*(-2 + x^2) + E^(x*Tan[a])*C[1] + E^(x*(Tan[a] + 2*Sqrt[-Csc[a]^2 + Tan[a]^2]
))*C[2])*Sin[a]^4 + (E^(x*(Tan[a] + Sqrt[-Csc[a]^2 + Tan[a]^2]))*x^2 + 2*E^(x*Ta
n[a])*C[1] + 2*E^(x*(Tan[a] + 2*Sqrt[-Csc[a]^2 + Tan[a]^2]))*C[2])*Cos[2*a]*Tan[
a]^2))/(E^(x*Sqrt[(1 + 8*Cos[2*a] - Cos[4*a])/(-1 + Cos[4*a])])*(-1 - 8*Cos[2*a]
 + Cos[4*a])^2)}}

Maple raw input

dsolve(diff(diff(y(x),x),x)-2*diff(y(x),x)*tan(a)+y(x)*csc(a)^2 = x^2*exp(x*tan(a)), y(x),'implicit')

Maple raw output

y(x) = exp(-(cos(a)*sin(a)^2-(cos(a)^2*sin(a)^4-sin(a)^4+2*sin(a)^2-1)^(1/2))*x/
(sin(a)^3-sin(a)))*_C2+exp(-(cos(a)*sin(a)^2+(cos(a)^2*sin(a)^4-sin(a)^4+2*sin(a
)^2-1)^(1/2))*x/(sin(a)^3-sin(a)))*_C1-(cos(a)^4*x^2-2*cos(a)^4-3*x^2*cos(a)^2+2
*cos(a)^2+x^2)*exp(x*sin(a)/cos(a))*cos(a)^2*sin(a)^2/(cos(a)^2+cos(a)-1)^2/(cos
(a)^2-cos(a)-1)^2