69.12.1 problem 275

Internal problem ID [18154]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 12. Miscellaneous problems. Exercises page 93
Problem number : 275
Date solved : Thursday, October 02, 2025 at 03:03:40 PM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (x -y\right )^{2}+1 \end{align*}
Maple. Time used: 0.003 (sec). Leaf size: 18
ode:=diff(y(x),x) = (x-y(x))^2+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_1 x +x^{2}-1}{x +c_1} \]
Mathematica. Time used: 0.098 (sec). Leaf size: 20
ode=D[y[x],x]==(x-y[x])^2+1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x+\frac {1}{-x+c_1}\\ y(x)&\to x \end{align*}
Sympy. Time used: 0.154 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-(x - y(x))**2 + Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} x + x^{2} - 1}{C_{1} + x} \]