71.3.3 problem 2 (C)

Internal problem ID [14274]
Book : Ordinary Differential Equations by Charles E. Roberts, Jr. CRC Press. 2010
Section : Chapter 2. The Initial Value Problem. Exercises 2.1, page 40
Problem number : 2 (C)
Date solved : Wednesday, March 05, 2025 at 10:42:10 PM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=1-y \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 12
ode:=diff(y(x),x) = 1-y(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 1+c_{1} {\mathrm e}^{-x} \]
Mathematica. Time used: 0.027 (sec). Leaf size: 20
ode=D[y[x],x]==1-y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to 1+c_1 e^{-x} \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.116 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} e^{- x} + 1 \]