##### 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 Classiﬁcation

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 2.77456 (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 (x^2 e^{x \left (\tan (a)+\sqrt {\tan ^2(a)-\csc ^2(a)}\right )}+2 c_1 e^{x \tan (a)}+2 c_2 e^{x \left (\tan (a)+2 \sqrt {\tan ^2(a)-\csc ^2(a)}\right )}\right )+\sin ^4(a) \left (\left (x^2-2\right ) e^{x \left (\tan (a)+\sqrt {\tan ^2(a)-\csc ^2(a)}\right )}+c_1 e^{x \tan (a)}+c_2 e^{x \left (\tan (a)+2 \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.432 (sec), leaf count = 176

$\left [y \left (x \right ) = {\mathrm e}^{-\frac {\left (\cos \left (a \right ) \left (\sin ^{2}\left (a \right )\right )-\sqrt {\left (\cos ^{2}\left (a \right )\right ) \left (\sin ^{4}\left (a \right )\right )-\left (\sin ^{4}\left (a \right )\right )+2 \left (\sin ^{2}\left (a \right )\right )-1}\right ) x}{\left (\sin ^{2}\left (a \right )-1\right ) \sin \left (a \right )}} \textit {\_C2} +{\mathrm e}^{-\frac {\left (\cos \left (a \right ) \left (\sin ^{2}\left (a \right )\right )+\sqrt {\left (\cos ^{2}\left (a \right )\right ) \left (\sin ^{4}\left (a \right )\right )-\left (\sin ^{4}\left (a \right )\right )+2 \left (\sin ^{2}\left (a \right )\right )-1}\right ) x}{\left (\sin ^{2}\left (a \right )-1\right ) \sin \left (a \right )}} \textit {\_C1} -\frac {{\mathrm e}^{\frac {x \sin \left (a \right )}{\cos \left (a \right )}} \left (\cos ^{2}\left (a \right )\right ) \left (\sin ^{2}\left (a \right )\right ) \left (\left (x^{2}-2\right ) \left (\cos ^{4}\left (a \right )\right )+\left (-3 x^{2}+2\right ) \left (\cos ^{2}\left (a \right )\right )+x^{2}\right )}{\left (\cos ^{2}\left (a \right )+\cos \left (a \right )-1\right )^{2} \left (\cos ^{2}\left (a \right )-\cos \left (a \right )-1\right )^{2}}\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))

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))/(
sin(a)^2-1)/sin(a)*x)*_C2+exp(-(cos(a)*sin(a)^2+(cos(a)^2*sin(a)^4-sin(a)^4+2*si
n(a)^2-1)^(1/2))/(sin(a)^2-1)/sin(a)*x)*_C1-exp(x*sin(a)/cos(a))*cos(a)^2*sin(a)
^2*((x^2-2)*cos(a)^4+(-3*x^2+2)*cos(a)^2+x^2)/(cos(a)^2+cos(a)-1)^2/(cos(a)^2-co
s(a)-1)^2]