80.3.42 problem 45

Internal problem ID [21206]
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 : 45
Date solved : Thursday, October 02, 2025 at 07:26:36 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} x^{\prime }&=-\frac {x+t +1}{x-t +1} \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 27
ode:=diff(x(t),t) = -(x(t)+t+1)/(x(t)-t+1); 
dsolve(ode,x(t), singsol=all);
 
\[ x = -1-\tan \left (\operatorname {RootOf}\left (2 \textit {\_Z} +\ln \left (\sec \left (\textit {\_Z} \right )^{2}\right )+2 \ln \left (t \right )+2 c_1 \right )\right ) t \]
Mathematica. Time used: 0.031 (sec). Leaf size: 51
ode=D[x[t],t]==-(x[t]+t+1)/(x[t]-t+1); 
ic={}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [2 \arctan \left (\frac {x(t)+t+1}{x(t)-t+1}\right )+\log \left (\frac {t^2+x(t)^2+2 x(t)+1}{2 t^2}\right )+2 \log (t)+c_1=0,x(t)\right ] \]
Sympy. Time used: 1.522 (sec). Leaf size: 29
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(Derivative(x(t), t) + (t + x(t) + 1)/(-t + x(t) + 1),0) 
ics = {} 
dsolve(ode,func=x(t),ics=ics)
 
\[ \log {\left (t \right )} = C_{1} - \log {\left (\sqrt {1 + \frac {\left (x{\left (t \right )} + 1\right )^{2}}{t^{2}}} \right )} + \operatorname {atan}{\left (\frac {x{\left (t \right )} + 1}{t} \right )} \]