2.6 problem Example 3.23

Internal problem ID [5101]

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]]

Solve \begin {gather*} \boxed {y^{\prime \prime }+y-4 \sin \relax (x )=0} \end {gather*}

Solution by Maple

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

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

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

Solution by Mathematica

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

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

\begin{align*} y(x)\to (-2 x+c_1) \cos (x)+c_2 \sin (x) \\ \end{align*}