28.2.40 problem 40

Internal problem ID [4483]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 4. Linear Differential Equations. Page 183
Problem number : 40
Date solved : Monday, January 27, 2025 at 09:21:00 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.069 (sec). Leaf size: 24

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