✓ Mathematica : cpu = 0.0605519 (sec), leaf count = 18
DSolve[-y[x] + x*y[x]^2 + x*Derivative[1][y][x] == 0,y[x],x]
✓ Maple : cpu = 0.013 (sec), leaf count = 16
dsolve(x*diff(y(x),x)+x*y(x)^2-y(x) = 0,y(x))
Hand solution
This is of the form \(y^{\prime }=f_{0}+f_{1}y+f_{2}y^{2}\) with \(f_{0}=0,f_{1}=\frac {1}{x},f_{2}=-1\). Since \(f_{0}=0\) this is Bernoulli differential equation. We always start by dividing by \(y^{2}\)
Then \(u=\frac {1}{y}\) or \(y=\frac {1}{u}\), therefore \(y^{\prime }=-\frac {u^{\prime }}{u^{2}}\). Equating this to RHS of (1) gives
Integrating factor is \(e^{\int \frac {1}{x}dx}=x\) and the above becomes
Integrating
Hence
Verification
restart; ode:=x*diff(y(x),x)+x*y(x)^2-y=0; my_solution:=2*x/(x^2+2*_C1); odetest(y(x)=my_solution,ode); 0