<s>[INST] First-Order Differential Equation by Substitution Solve the differential equation by the appropriate substitution
$$x^2\frac{dy}{dx}+2xy=x^4y^2+1$$ .
 [/INST] $x^2\dfrac{dy}{dx}+2xy=x^4y^2+1$
$x^2\dfrac{dy}{dx}=x^4y^2-2xy+1$
$\dfrac{dy}{dx}=x^2y^2-\dfrac{2y}{x}+\dfrac{1}{x^2}$
Note that this belongs to a Riccati equation and cannot find an obvious particular solution, so we should follow the method in http://en.wikipedia.org/wiki/Riccati_equation#Reduction_to_a_second_order_linear_equation.
Let $u=x^2y$ ,
Then $y=\dfrac{u}{x^2}$
$\dfrac{dy}{dx}=\dfrac{1}{x^2}\dfrac{du}{dx}-\dfrac{2u}{x^3}$
$\therefore\dfrac{1}{x^2}\dfrac{du}{dx}-\dfrac{2u}{x^3}=x^2\left(\dfrac{u}{x^2}\right)^2-\dfrac{2}{x}\dfrac{u}{x^2}+\dfrac{1}{x^2}$
$\dfrac{1}{x^2}\dfrac{du}{dx}-\dfrac{2u}{x^3}=\dfrac{u^2}{x^2}-\dfrac{2u}{x^3}+\dfrac{1}{x^2}$
$\dfrac{1}{x^2}\dfrac{du}{dx}=\dfrac{u^2}{x^2}+\dfrac{1}{x^2}$
$\dfrac{du}{dx}=u^2+1$
But luckily we get a separable ODE.
$\dfrac{du}{u^2+1}=dx$
$\int\dfrac{du}{u^2+1}=\int dx$
$\tan^{-1}u=x+C$
$u=\tan(x+C)$
$\therefore y=\dfrac{\tan(x+C)}{x^2}$
</s>