Solve the ordinary differential equation:

$\displaystyle xy^2 + 4\frac{dy}{dx} = 4x$

Attempt:

$\displaystyle \frac{dy}{dx} + \frac{xy^2}{4} = x$

(I tried to get it into the form of $\displaystyle \frac{dy}{dx} + p(x)y = q(x)$ of a first-order linear ode, but in this case the $\displaystyle y$ is $\displaystyle y^2$)

I then found $\displaystyle e^{P(x)}$, where $\displaystyle P(x)$ is an anti-derivative of $\displaystyle p(x)$

In this case $\displaystyle p(x) = \frac{x}{4}$ therefore I got $\displaystyle e^{P(x)} =e^{\frac{x^2}{8}}$

$\displaystyle e^\frac{x^2}{8}\frac{dy}{dx} + \frac{xy^2e^{\frac{x^2}{8}}}{4} = xe^{\frac{x^2}{8}}$

$\displaystyle

\frac{d}{dx}(ye^\frac{x^2}{8}) = xe^{\frac{x^2}{8}}$

but this doesnt seem correct