36.2.18 problem 18

Internal problem ID [6311]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 18
Date solved : Wednesday, March 05, 2025 at 12:33:45 AM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

\begin{align*} y \left (0\right )&={\frac {4}{3}} \end{align*}

Maple. Time used: 0.010 (sec). Leaf size: 16
ode:=diff(y(x),x)+4*y(x)-exp(-x) = 0; 
ic:=y(0) = 4/3; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {\left ({\mathrm e}^{3 x}+3\right ) {\mathrm e}^{-4 x}}{3} \]
Mathematica. Time used: 0.058 (sec). Leaf size: 21
ode=D[y[x],x]+4*y[x]-Exp[-x]==0; 
ic={y[0]==4/3}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {1}{3} e^{-4 x} \left (e^{3 x}+3\right ) \]
Sympy. Time used: 0.157 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) + Derivative(y(x), x) - exp(-x),0) 
ics = {y(0): 4/3} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (\frac {1}{3} + e^{- 3 x}\right ) e^{- x} \]