81.5.11 problem 11

Internal problem ID [18674]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter IV. Ordinary linear differential equations with constant coefficients. Exercises at page 58
Problem number : 11
Date solved : Tuesday, January 28, 2025 at 12:09:14 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

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

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

Solution by Mathematica

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

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