ODE
\[ y''(x)+2 \tan (x) y'(x)-y(x)=(x+1) \sec (x) \] ODE Classification
[[_2nd_order, _linear, _nonhomogeneous]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.244391 (sec), leaf count = 60
\[\left \{\left \{y(x)\to c_1 \sqrt {\sin ^2(x)}+c_2 \left (\cos (x)-\sqrt {\sin ^2(x)} \sin ^{-1}(\cos (x))\right )+\frac {1}{2} \left (\sqrt {\sin ^2(x)}-\cos ^{-1}(\cos (x)) \cos (x)-\cos (x)\right )\right \}\right \}\]
Maple ✓
cpu = 0.649 (sec), leaf count = 114
\[ \left \{ y \left ( x \right ) ={\frac {1}{2\, \left ( \cos \left ( x \right ) \right ) ^{2}} \left ( 2\,i\int \!{\frac { \left ( 1+x \right ) \left ( \ln \left ( \sin \left ( x \right ) +i\cos \left ( x \right ) \right ) \sin \left ( x \right ) -i\cos \left ( x \right ) \right ) }{ \left ( \cos \left ( x \right ) \right ) ^{3}}}\,{\rm d}x\sin \left ( x \right ) \left ( \cos \left ( x \right ) \right ) ^{2}+ \left ( -i \left ( \cos \left ( x \right ) \right ) ^{3}+2\,\sin \left ( x \right ) \left ( \cos \left ( x \right ) \right ) ^{2}{\it \_C1}+i\cos \left ( x \right ) -i\sin \left ( x \right ) \left ( 1+x \right ) \right ) \ln \left ( \sin \left ( x \right ) +i\cos \left ( x \right ) \right ) -2\,\cos \left ( x \right ) \left ( i{\it \_C1}\, \left ( \cos \left ( x \right ) \right ) ^{2}- \left ( {\it \_C2}+1/2 \right ) \sin \left ( x \right ) \cos \left ( x \right ) +x/2+1/2 \right ) \right ) } \right \} \] Mathematica raw input
DSolve[-y[x] + 2*Tan[x]*y'[x] + y''[x] == (1 + x)*Sec[x],y[x],x]
Mathematica raw output
{{y[x] -> C[1]*Sqrt[Sin[x]^2] + (-Cos[x] - ArcCos[Cos[x]]*Cos[x] + Sqrt[Sin[x]^2
])/2 + C[2]*(Cos[x] - ArcSin[Cos[x]]*Sqrt[Sin[x]^2])}}
Maple raw input
dsolve(diff(diff(y(x),x),x)+2*diff(y(x),x)*tan(x)-y(x) = sec(x)*(1+x), y(x),'implicit')
Maple raw output
y(x) = 1/2*(2*I*Int((1+x)*(ln(sin(x)+I*cos(x))*sin(x)-I*cos(x))/cos(x)^3,x)*sin(
x)*cos(x)^2+(-I*cos(x)^3+2*sin(x)*cos(x)^2*_C1+I*cos(x)-I*sin(x)*(1+x))*ln(sin(x
)+I*cos(x))-2*cos(x)*(I*_C1*cos(x)^2-(_C2+1/2)*sin(x)*cos(x)+1/2*x+1/2))/cos(x)^
2