23.3.17 problem 17

Internal problem ID [5731]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 17
Date solved : Tuesday, September 30, 2025 at 02:02:13 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y+y^{\prime \prime }&={\mathrm e}^{-x} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=y(x)+diff(diff(y(x),x),x) = exp(-x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) c_2 +\cos \left (x \right ) c_1 +\frac {{\mathrm e}^{-x}}{2} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 25
ode=y[x] + D[y[x],{x,2}] == E^(-x); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {e^{-x}}{2}+c_1 \cos (x)+c_2 \sin (x) \end{align*}
Sympy. Time used: 0.038 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - exp(-x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )} + \frac {e^{- x}}{2} \]