4.24.50 \(y''(x)+4 y(x)=2 \tan (x)\)

ODE
\[ y''(x)+4 y(x)=2 \tan (x) \] ODE Classification

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.0145926 (sec), leaf count = 28

\[\left \{\left \{y(x)\to \left (c_1-x\right ) \cos (2 x)+\sin (2 x) \left (c_2+\log (\cos (x))\right )\right \}\right \}\]

Maple
cpu = 0.02 (sec), leaf count = 36

\[ \left \{ y \left ( x \right ) = \left ( \cos \left ( x \right ) \sin \left ( x \right ) -x+{\it \_C1} \right ) \cos \left ( 2\,x \right ) +\sin \left ( 2\,x \right ) \left ( - \left ( \cos \left ( x \right ) \right ) ^{2}+{\it \_C2}+\ln \left ( \cos \left ( x \right ) \right ) \right ) \right \} \] Mathematica raw input

DSolve[4*y[x] + y''[x] == 2*Tan[x],y[x],x]

Mathematica raw output

{{y[x] -> (-x + C[1])*Cos[2*x] + (C[2] + Log[Cos[x]])*Sin[2*x]}}

Maple raw input

dsolve(diff(diff(y(x),x),x)+4*y(x) = 2*tan(x), y(x),'implicit')

Maple raw output

y(x) = (cos(x)*sin(x)-x+_C1)*cos(2*x)+sin(2*x)*(-cos(x)^2+_C2+ln(cos(x)))