15.11.32 problem 32

Internal problem ID [3142]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 19, page 86
Problem number : 32
Date solved : Monday, January 27, 2025 at 07:23:24 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

\begin{align*} y \left (0\right )&=2\\ y^{\prime }\left (0\right )&=1 \end{align*}

Solution by Maple

Time used: 0.013 (sec). Leaf size: 23

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

Solution by Mathematica

Time used: 0.038 (sec). Leaf size: 28

DSolve[{D[y[x],{x,2}]+y[x]==3*x*Sin[x],{y[0]==2,Derivative[1][y][0] ==1}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \left (2-\frac {3 x^2}{4}\right ) \cos (x)+\left (\frac {3 x}{4}+1\right ) \sin (x) \]