23.3.21 problem 9(b)

Internal problem ID [4162]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 4. The general linear differential equation of order n. Exercises at page 63
Problem number : 9(b)
Date solved : Monday, January 27, 2025 at 08:41:03 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

With initial conditions

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

Solution by Maple

Time used: 0.032 (sec). Leaf size: 19

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

Solution by Mathematica

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

DSolve[{D[y[x],{x,2}]+9*y[x]==8*Sin[x],{y[Pi/2]==-1,Derivative[1][y][Pi/2] ==1}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \sin (x)+2 \sin (3 x)+\frac {1}{3} \cos (3 x) \]