48.2.6 problem Example 3.23

Internal problem ID [7522]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.3 SECOND ORDER ODE. Page 147
Problem number : Example 3.23
Date solved : Monday, January 27, 2025 at 03:04:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.026 (sec). Leaf size: 20

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