80.3.40 problem 43

Internal problem ID [21204]
Book : A Textbook on Ordinary Differential Equations by Shair Ahmad and Antonio Ambrosetti. Second edition. ISBN 978-3-319-16407-6. Springer 2015
Section : Chapter 3. First order nonlinear differential equations. Excercise 3.7 at page 67
Problem number : 43
Date solved : Thursday, October 02, 2025 at 07:26:34 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} x^{\prime }&=\frac {x-t +1}{x-t +2} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 35
ode:=diff(x(t),t) = (x(t)-t+1)/(x(t)-t+2); 
dsolve(ode,x(t), singsol=all);
 
\begin{align*} x &= t -2-\sqrt {2 c_1 -2 t +4} \\ x &= t -2+\sqrt {2 c_1 -2 t +4} \\ \end{align*}
Mathematica. Time used: 0.063 (sec). Leaf size: 49
ode=D[x[t],t]==(x[t]-t+1)/(x[t]-t+2); 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\begin{align*} x(t)&\to t-i \sqrt {2 t-4-c_1}-2\\ x(t)&\to t+i \sqrt {2 t-4-c_1}-2 \end{align*}
Sympy. Time used: 0.656 (sec). Leaf size: 27
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(Derivative(x(t), t) + (t - x(t) - 1)/(-t + x(t) + 2),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ \left [ x{\left (t \right )} = t - \sqrt {C_{1} - 2 t} - 2, \ x{\left (t \right )} = t + \sqrt {C_{1} - 2 t} - 2\right ] \]