32.8.18 problem Exercise 21.22, page 231

Internal problem ID [5967]
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.22, page 231
Date solved : Monday, January 27, 2025 at 01:29:19 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\sin \left (x \right )+{\mathrm e}^{-x} \end{align*}

Solution by Maple

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

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

Solution by Mathematica

Time used: 0.317 (sec). Leaf size: 36

DSolve[D[y[x],{x,2}]+y[x]==Sin[x]+Exp[-x],y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {1}{4} \left (2 e^{-x}+\sin (x)-2 x \cos (x)+4 c_1 \cos (x)+4 c_2 \sin (x)\right ) \]