18.1.10 problem Problem 14.6

Internal problem ID [3466]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.6
Date solved : Tuesday, March 04, 2025 at 04:40:29 PM
CAS classification : [_rational, _Bernoulli]

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

Maple. Time used: 0.006 (sec). Leaf size: 49
ode:=diff(y(x),x) = -(2*x^2+y(x)^2+x)/x/y(x); 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= -\frac {\sqrt {-9 x^{4}-6 x^{3}+9 c_{1}}}{3 x} \\ y \left (x \right ) &= \frac {\sqrt {-9 x^{4}-6 x^{3}+9 c_{1}}}{3 x} \\ \end{align*}
Mathematica. Time used: 0.281 (sec). Leaf size: 56
ode=D[y[x],x] == - (2*x^2+y[x]^2+x)/(x*y[x]); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\sqrt {-x^4-\frac {2 x^3}{3}+c_1}}{x} \\ y(x)\to \frac {\sqrt {-x^4-\frac {2 x^3}{3}+c_1}}{x} \\ \end{align*}
Sympy. Time used: 0.480 (sec). Leaf size: 42
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + (2*x**2 + x + y(x)**2)/(x*y(x)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {\sqrt {C_{1} - 9 x^{4} - 6 x^{3}}}{3 x}, \ y{\left (x \right )} = \frac {\sqrt {C_{1} - 9 x^{4} - 6 x^{3}}}{3 x}\right ] \]