1.4.1 problem 1

Internal problem ID [73]
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 : 1
Date solved : Tuesday, September 30, 2025 at 03:42:32 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }+y&=2 \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.022 (sec). Leaf size: 12
ode:=diff(y(x),x)+y(x) = 2; 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = 2-2 \,{\mathrm e}^{-x} \]
Mathematica. Time used: 0.015 (sec). Leaf size: 14
ode=D[y[x],x]+ y[x]==2; 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 2-2 e^{-x} \end{align*}
Sympy. Time used: 0.065 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - 2,0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 2 - 2 e^{- x} \]