12.5.47 problem 46

Internal problem ID [1671]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Transformation of Nonlinear Equations into Separable Equations. Section 2.4 Page 68
Problem number : 46
Date solved : Saturday, March 29, 2025 at 11:25:30 PM
CAS classification : [[_homogeneous, `class G`], _rational, _Riccati]

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

Maple. Time used: 0.004 (sec). Leaf size: 17
ode:=x^3*diff(y(x),x) = 2*y(x)^2+2*x^2*y(x)-2*x^4; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tanh \left (-2 \ln \left (x \right )+2 c_1 \right ) x^{2} \]
Mathematica. Time used: 0.913 (sec). Leaf size: 62
ode=x^3*D[y[x],x]==2*(y[x]^2+x^2*y[x]-x^4); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to i x^2 \tan (2 i \log (x)+c_1) \\ y(x)\to \frac {x^2 \left (-x^4+e^{2 i \text {Interval}[\{0,\pi \}]}\right )}{x^4+e^{2 i \text {Interval}[\{0,\pi \}]}} \\ \end{align*}
Sympy. Time used: 0.302 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x**4 + x**3*Derivative(y(x), x) - 2*x**2*y(x) - 2*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2} \left (C_{1} - x^{4} - 1\right )}{C_{1} + x^{4} - 1} \]