47.1.11 problem 11

Internal problem ID [7392]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.1 Separable equations problems. page 7
Problem number : 11
Date solved : Wednesday, March 05, 2025 at 04:25:14 AM
CAS classification : [_separable]

\begin{align*} y^{\prime }-x y^{2}&=2 x y \end{align*}

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