38.3.3 problem 3

Internal problem ID [6481]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 25. Second order differential equations. Test Excercise 25. page 1093
Problem number : 3
Date solved : Sunday, March 30, 2025 at 11:05:14 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 19
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+y(x) = exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{-x}+{\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 24
ode=D[y[x],{x,2}]+2*D[y[x],x]+y[x]==Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (1+e^x (c_2 x+c_1)\right ) \]
Sympy. Time used: 0.211 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + 2*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 )} = \left (C_{1} + C_{2} x + e^{- x}\right ) e^{- x} \]