20.3.19 problem Problem 19

Internal problem ID [3628]
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 19
Date solved : Tuesday, March 04, 2025 at 04:55:15 PM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \end{align*}

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