32.6.21 problem Exercise 12.21, page 103

Internal problem ID [5886]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 2. Special types of differential equations of the first kind. Lesson 12, Miscellaneous Methods
Problem number : Exercise 12.21, page 103
Date solved : Sunday, March 30, 2025 at 10:23:47 AM
CAS classification : [_separable]

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

Maple. Time used: 0.004 (sec). Leaf size: 11
ode:=x*diff(y(x),x)-y(x)^2+1 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\tanh \left (\ln \left (x \right )+c_1 \right ) \]
Mathematica. Time used: 0.52 (sec). Leaf size: 43
ode=x*D[y[x],x]-y[x]^2+1==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1-e^{2 c_1} x^2}{1+e^{2 c_1} x^2} \\ y(x)\to -1 \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.347 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - y(x)**2 + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- x^{2} e^{2 C_{1}} - 1}{x^{2} e^{2 C_{1}} - 1} \]