82.30.2 problem Ex. 2

Internal problem ID [18886]
Book : Introductory Course On Differential Equations by Daniel A Murray. Longmans Green and Co. NY. 1924
Section : Chapter VI. Linear equations with constant coefficients. problems at page 77
Problem number : Ex. 2
Date solved : Tuesday, January 28, 2025 at 12:33:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.007 (sec). Leaf size: 29

dsolve(diff(y(x),x$2)+a^2*y(x)=cos(a*x),y(x), singsol=all)
 
\[ y \left (x \right ) = \frac {\left (2 a c_{2} +x \right ) \sin \left (a x \right )+2 \cos \left (a x \right ) c_{1} a}{2 a} \]

Solution by Mathematica

Time used: 0.050 (sec). Leaf size: 41

DSolve[D[y[x],{x,2}]+a^2*y[x]==Cos[a*x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {\left (1+4 a^2 c_1\right ) \cos (a x)+2 a (x+2 a c_2) \sin (a x)}{4 a^2} \]