72.5.19 problem 6

Internal problem ID [14634]
Book : DIFFERENTIAL EQUATIONS by Paul Blanchard, Robert L. Devaney, Glen R. Hall. 4th edition. Brooks/Cole. Boston, USA. 2012
Section : Chapter 1. First-Order Differential Equations. Exercises section 1.6 page 89
Problem number : 6
Date solved : Monday, March 31, 2025 at 12:45:09 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.002 (sec). Leaf size: 33
ode:=diff(y(t),t) = 1/(y(t)-2); 
dsolve(ode,y(t), singsol=all);
 
\begin{align*} y &= 2-\sqrt {4+2 c_1 +2 t} \\ y &= 2+\sqrt {4+2 c_1 +2 t} \\ \end{align*}
Mathematica. Time used: 0.081 (sec). Leaf size: 44
ode=D[y[t],t]==1/(y[t]-2); 
ic={}; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)\to 2-\sqrt {2} \sqrt {t+2+c_1} \\ y(t)\to 2+\sqrt {2} \sqrt {t+2+c_1} \\ \end{align*}
Sympy. Time used: 0.249 (sec). Leaf size: 24
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(Derivative(y(t), t) - 1/(y(t) - 2),0) 
ics = {} 
dsolve(ode,func=y(t),ics=ics)
 
\[ \left [ y{\left (t \right )} = 2 - \sqrt {C_{1} + 2 t}, \ y{\left (t \right )} = \sqrt {C_{1} + 2 t} + 2\right ] \]