18.2.13 problem Problem 15.24(a)

Internal problem ID [3496]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 15, Higher order ordinary differential equations. 15.4 Exercises, page 523
Problem number : Problem 15.24(a)
Date solved : Monday, January 27, 2025 at 07:39:44 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=x^{n} \end{align*}

Solution by Maple

Time used: 0.007 (sec). Leaf size: 85

dsolve(diff(y(x),x$2)-y(x)=x^n,y(x), singsol=all)
 
\[ y \left (x \right ) = -\frac {{\mathrm e}^{-x} \left (-{\mathrm e}^{\frac {3 x}{2}} x^{\frac {n}{2}} \operatorname {WhittakerM}\left (\frac {n}{2}, \frac {n}{2}+\frac {1}{2}, x\right )+\left (x^{n} \left (n \Gamma \left (n , -x \right )-\Gamma \left (n +1\right )\right ) \left (-x \right )^{-n}-2 \,{\mathrm e}^{2 x} c_{2} +{\mathrm e}^{x} x^{n}-2 c_{1} \right ) \left (n +1\right )\right )}{2 n +2} \]

Solution by Mathematica

Time used: 0.066 (sec). Leaf size: 58

DSolve[D[y[x],{x,2}]-y[x]==x^n,y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to -\frac {1}{2} e^{-x} x^n (-x)^{-n} \Gamma (n+1,-x)-\frac {1}{2} e^x \Gamma (n+1,x)+c_1 e^x+c_2 e^{-x} \]