78.14.9 problem 4 (a)

Internal problem ID [18345]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 4 (a)
Date solved : Tuesday, January 28, 2025 at 11:47:47 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\sec \left (x \right ) \end{align*}

Solution by Maple

Time used: 0.003 (sec). Leaf size: 22

dsolve(diff(y(x),x$2)+y(x)=sec(x),y(x), singsol=all)
 
\[ y = -\ln \left (\sec \left (x \right )\right ) \cos \left (x \right )+\cos \left (x \right ) c_{1} +\left (c_{2} +x \right ) \sin \left (x \right ) \]

Solution by Mathematica

Time used: 0.018 (sec). Leaf size: 22

DSolve[D[y[x],{x,2}] +y[x]==Sec[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to (x+c_2) \sin (x)+\cos (x) (\log (\cos (x))+c_1) \]