18.1.3 problem Problem 14.2 (c)

Internal problem ID [3459]
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.2 (c)
Date solved : Tuesday, March 04, 2025 at 04:40:01 PM
CAS classification : [_separable]

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

Maple. Time used: 0.003 (sec). Leaf size: 17
ode:=x^2*diff(y(x),x)+x*y(x)^2 = 4*y(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {x}{4+x \ln \left (x \right )+c_{1} x} \]
Mathematica. Time used: 0.166 (sec). Leaf size: 25
ode=D[y[x],x]+x*y[x]^2==4*y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {2}{x^2-8 x-2 c_1} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.185 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) + x*y(x)**2 - 4*y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{C_{1} x + x \log {\left (x \right )} + 4} \]