23.2.17 problem 6(f)

Internal problem ID [4134]
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 : 6(f)
Date solved : Monday, January 27, 2025 at 08:37:14 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+2 y&={\mathrm e}^{x}+2 \end{align*}

Solution by Maple

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

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

Solution by Mathematica

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

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