2.6 problem Example 3.23

Internal problem ID [5854]

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.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

\[ \boxed {y^{\prime \prime }+y=4 \sin \left (x \right )} \]

Solution by Maple

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

dsolve(diff(y(x),x$2)+y(x)=4*sin(x),y(x), singsol=all)
 

\[ y \left (x \right ) = \sin \left (x \right ) c_{2} +\cos \left (x \right ) c_{1} +2 \sin \left (x \right )-2 \cos \left (x \right ) x \]

Solution by Mathematica

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

DSolve[y''[x]+y[x]==4*Sin[x],y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to (-2 x+c_1) \cos (x)+c_2 \sin (x) \]