32.8.23 problem Exercise 21.31, page 231

Internal problem ID [5972]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 21. Undetermined Coefficients
Problem number : Exercise 21.31, page 231
Date solved : Monday, January 27, 2025 at 01:29:34 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+9 y&=8 \cos \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.039 (sec). Leaf size: 17

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

Solution by Mathematica

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

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