15.14.4 problem 4

Internal problem ID [3176]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 23, page 106
Problem number : 4
Date solved : Sunday, March 30, 2025 at 01:20:27 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)+diff(y(x),x)-2*y(x) = exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\left (-3 c_1 \,{\mathrm e}^{3 x}-3 c_2 +x \right ) {\mathrm e}^{-2 x}}{3} \]
Mathematica. Time used: 0.028 (sec). Leaf size: 32
ode=D[y[x],{x,2}]+D[y[x],x]-2*y[x]==Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{9} e^{-2 x} \left (-3 x+9 c_2 e^{3 x}-1+9 c_1\right ) \]
Sympy. Time used: 0.186 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*y(x) + Derivative(y(x), x) + Derivative(y(x), (x, 2)) - exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{x} + \left (C_{1} - \frac {x}{3}\right ) e^{- 2 x} \]