38.1.12 problem 12

Internal problem ID [6429]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Test excercise 24. page 1067
Problem number : 12
Date solved : Sunday, March 30, 2025 at 10:58:08 AM
CAS classification : [[_homogeneous, `class G`], _rational, _Bernoulli]

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

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