40.3.30 problem 26 (d)

Internal problem ID [6634]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 5. Equations of first order and first degree (Exact equations). Supplemetary problems. Page 33
Problem number : 26 (d)
Date solved : Sunday, March 30, 2025 at 11:12:59 AM
CAS classification : [[_homogeneous, `class G`], _rational]

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

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