3.9 problem 9

Internal problem ID [6446]

Book: Own collection of miscellaneous problems
Section: section 3.0
Problem number: 9.
ODE order: 2.
ODE degree: 1.

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

Solve \begin {gather*} \boxed {y^{\prime \prime }+y-\sin \relax (x )=0} \end {gather*} With initial conditions \begin {align*} [y^{\prime }\relax (1) = 0, y \relax (2) = 0] \end {align*}

Solution by Maple

Time used: 0.088 (sec). Leaf size: 77

dsolve([diff(y(x),x$2)+y(x)=sin(x),D(y)(1) = 0, y(2) = 0],y(x), singsol=all)
 

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

Solution by Mathematica

Time used: 0.011 (sec). Leaf size: 35

DSolve[{y''[x]+y[x]==Sin[x],{y'[1] == 0,y[2]==0}},y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to \frac {1}{4} (-2 (1+\sin (2)) (\tan (1)-1) \sin (x)-2 \cos (x) (x-1+\sin (2)-\cos (2))) \\ \end{align*}