87.5.23 problem 30

Internal problem ID [23316]
Book : Ordinary differential equations with modern applications. Ladas, G. E. and Finizio, N. Wadsworth Publishing. California. 1978. ISBN 0-534-00552-7. QA372.F56
Section : Chapter 1. Elementary methods. First order differential equations. Exercise at page 47
Problem number : 30
Date solved : Thursday, October 02, 2025 at 09:31:50 PM
CAS classification : [_rational, _Bernoulli]

\begin{align*} x^{2}-y^{2}+x +2 x y y^{\prime }&=0 \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 33
ode:=x^2-y(x)^2+x+2*x*y(x)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {-x \left (\ln \left (x \right )-c_1 +x \right )} \\ y &= -\sqrt {-x \left (\ln \left (x \right )-c_1 +x \right )} \\ \end{align*}
Mathematica. Time used: 0.231 (sec). Leaf size: 41
ode=(x^2-y[x]^2+x)+(2*x*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {-x (x+\log (x)-c_1)}\\ y(x)&\to \sqrt {-x (x+\log (x)-c_1)} \end{align*}
Sympy. Time used: 0.348 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + 2*x*y(x)*Derivative(y(x), x) + x - y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = \sqrt {x \left (C_{1} - x - \log {\left (x \right )}\right )}, \ y{\left (x \right )} = - \sqrt {x \left (C_{1} - x - \log {\left (x \right )}\right )}\right ] \]