35.3.2 problem 2

Internal problem ID [6106]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number : 2
Date solved : Sunday, March 30, 2025 at 10:38:58 AM
CAS classification : [_linear]

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

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