47.2.50 problem 46

Internal problem ID [7466]
Book : Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section : Chapter 1. First order differential equations. Section 1.2 Homogeneous equations problems. page 12
Problem number : 46
Date solved : Sunday, March 30, 2025 at 12:09:33 PM
CAS classification : [[_homogeneous, `class G`], _rational, [_Riccati, _special]]

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

Maple. Time used: 0.204 (sec). Leaf size: 24
ode:=diff(y(x),x) = y(x)^2-2/x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 x^{3}+c_1}{x \left (-x^{3}+c_1 \right )} \]
Mathematica. Time used: 0.145 (sec). Leaf size: 32
ode=D[y[x],x]==y[x]^2-2/x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {-2 x^3+c_1}{x \left (x^3+c_1\right )} \\ y(x)\to \frac {1}{x} \\ \end{align*}
Sympy. Time used: 0.243 (sec). Leaf size: 24
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**2 + Derivative(y(x), x) + 2/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \frac {- 3 i \tan {\left (C_{1} + \frac {3 i \log {\left (x \right )}}{2} \right )} + 1}{2 x} \]