75.12.1 problem 275

Internal problem ID [16788]
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, March 13, 2025 at 08:46:59 AM
CAS classification : [[_homogeneous, `class C`], _Riccati]

\begin{align*} y^{\prime }&=\left (x -y\right )^{2}+1 \end{align*}

Maple. Time used: 0.006 (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.142 (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.246 (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} \]