49.11.4 problem 1(d)

Internal problem ID [7668]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 2. Linear equations with constant coefficients. Page 93
Problem number : 1(d)
Date solved : Monday, January 27, 2025 at 03:09:23 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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

Solution by Maple

Time used: 0.003 (sec). Leaf size: 34

dsolve(diff(y(x),x$2)-diff(y(x),x)-2*y(x)=x^2+cos(x),y(x), singsol=all)
 
\[ y = c_{2} {\mathrm e}^{-x}+{\mathrm e}^{2 x} c_{1} -\frac {x^{2}}{2}-\frac {3 \cos \left (x \right )}{10}-\frac {\sin \left (x \right )}{10}+\frac {x}{2}-\frac {3}{4} \]

Solution by Mathematica

Time used: 0.125 (sec). Leaf size: 44

DSolve[D[y[x],{x,2}]-D[y[x],x]-2*y[x]==x^2+Cos[x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {1}{20} \left (-10 x^2+10 x-2 \sin (x)-6 \cos (x)-15\right )+c_1 e^{-x}+c_2 e^{2 x} \]