7.4.13 problem 13

Internal problem ID [85]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 1. First order differential equations. Section 1.5 (linear equations). Problems at page 54
Problem number : 13
Date solved : Tuesday, March 04, 2025 at 10:42:37 AM
CAS classification : [[_linear, `class A`]]

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

With initial conditions

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

Maple. Time used: 0.009 (sec). Leaf size: 15
ode:=diff(y(x),x)+y(x) = exp(x); 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {{\mathrm e}^{x}}{2}+\frac {{\mathrm e}^{-x}}{2} \]
Mathematica. Time used: 0.041 (sec). Leaf size: 21
ode=D[y[x],x]+y[x]==Exp[x]; 
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.145 (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} \]