23.2.24 problem 9

Internal problem ID [4141]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 3. Linear differential equations of second order. Exercises at page 31
Problem number : 9
Date solved : Monday, January 27, 2025 at 08:39:57 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+2 n y^{\prime }+n^{2} y&=A \cos \left (p x \right ) \end{align*}

With initial conditions

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

Solution by Maple

Time used: 0.069 (sec). Leaf size: 109

dsolve([diff(y(x),x$2)+2*n*diff(y(x),x)+n^2*y(x)=A*cos(p*x),y(0) = 9, D(y)(0) = 0],y(x), singsol=all)
 
\[ y \left (x \right ) = \frac {\left (9 n^{5} x +9 n^{4}-x \left (-18 p^{2}+A \right ) n^{3}+\left (18 p^{2}-A \right ) n^{2}-p^{2} x \left (-9 p^{2}+A \right ) n +p^{2} \left (9 p^{2}+A \right )\right ) {\mathrm e}^{-n x}+\left (\left (n^{2}-p^{2}\right ) \cos \left (p x \right )+2 \sin \left (p x \right ) n p \right ) A}{\left (n^{2}+p^{2}\right )^{2}} \]

Solution by Mathematica

Time used: 0.046 (sec). Leaf size: 76

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