65.2.1 problem 7.1 (i)

Internal problem ID [13635]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 7, Scalar autonomous ODEs. Exercises page 56
Problem number : 7.1 (i)
Date solved : Wednesday, March 05, 2025 at 10:05:44 PM
CAS classification : [_quadrature]

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

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