20.3.24 problem Problem 31

Internal problem ID [3633]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.6, First-Order Linear Differential Equations. page 59
Problem number : Problem 31
Date solved : Tuesday, March 04, 2025 at 04:55:23 PM
CAS classification : [[_linear, `class A`]]

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

Maple. Time used: 0.002 (sec). Leaf size: 17
ode:=diff(y(x),x)+y(x) = exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \left (-{\mathrm e}^{-x}+c_{1} \right ) {\mathrm e}^{-x} \]
Mathematica. Time used: 0.058 (sec). Leaf size: 19
ode=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+c_1 e^x\right ) \]
Sympy. Time used: 0.147 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} - e^{- x}\right ) e^{- x} \]