83.14.2 problem 2

Internal problem ID [19181]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter III. Ordinary linear differential equations with constant coefficients. Exercise III (F) at page 42
Problem number : 2
Date solved : Tuesday, January 28, 2025 at 01:11:35 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.008 (sec). Leaf size: 81

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

Solution by Mathematica

Time used: 0.571 (sec). Leaf size: 79

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