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

ODE
$y''(x)+4 y(x)=2 \tan (x)$ ODE Classiﬁcation

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.162172 (sec), leaf count = 33

$\{\{y(x)\to (-x+c_1) \cos (2 x)+\sin (x) \cos (x) (2 \log (\cos (x))-1+2 c_2)\}\}$

Maple
cpu = 0.373 (sec), leaf count = 47

$[y \left (x \right ) = \sin \left (2 x \right ) \textit {\_C2} +\cos \left (2 x \right ) \textit {\_C1} +\left (\cos \left (x \right ) \sin \left (x \right )-x \right ) \cos \left (2 x \right )-\sin \left (2 x \right ) \left (\cos ^{2}\left (x \right )-\ln \left (\cos \left (x \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] + Cos[x]*(-1 + 2*C[2] + 2*Log[Cos[x]])*Sin[x]}}

Maple raw input

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

Maple raw output

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