4.24.35 \(y''(x)+y(x)=\sec (x)\)

ODE
\[ y''(x)+y(x)=\sec (x) \] ODE Classification

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.158985 (sec), leaf count = 22

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

Maple
cpu = 0.381 (sec), leaf count = 26

\[\left [y \left (x \right ) = \sin \left (x \right ) \textit {\_C2} +\textit {\_C1} \cos \left (x \right )+x \sin \left (x \right )-\ln \left (\frac {1}{\cos \left (x \right )}\right ) \cos \left (x \right )\right ]\] Mathematica raw input

DSolve[y[x] + y''[x] == Sec[x],y[x],x]

Mathematica raw output

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

Maple raw input

dsolve(diff(diff(y(x),x),x)+y(x) = sec(x), y(x))

Maple raw output

[y(x) = sin(x)*_C2+_C1*cos(x)+x*sin(x)-ln(1/cos(x))*cos(x)]