TITLE: Solving differential equation $x y^2 y' = x+1$
QUESTION [5 upvotes]: I am asked to solve the following differential equation:
$$
x y^2 y' = x+1
$$
My process was
$$
\begin{align*}
x y^2 y' &= x+1\\
xy^2 \frac{dy}{dx} &= x+1\\
y^2 dy &= \frac{x+1}{x} dx\\
\int y^2 dy &= \int \frac{x+1}{x} dx\\
\int y^2 dy &= \int dx + \int \frac{1}{x} dx\\
\frac{y^3}{3} &= x + \ln |x| + C\\
y &= \sqrt[3]{3 \left( x + \ln |x| + C \right)}
\end{align*}
$$
but when I was checking my result on Wolfram I noticed that it was given in a different way.

Is my result incorrect? What caused the results to be different? Is it the absolute value sign of the $\ln$?
Thank you.

REPLY [6 votes]: So, every real number has three cube roots: a real one, and two complex ones. The cube roots of 1, for instance, are $1, -\frac{1}{2}+\frac{\sqrt{3}}{2}i$, and $-\frac{1}{2}-\frac{\sqrt{3}}{2}i$. When you took the cube root in solving for $y$, you only considered the real cube root (which is totally fine if you're only interested in real-values functions); WolframAlpha was more general, and gave solutions for all three cube roots. Sort of like how when you have $y^2 = x$, this gives two solutions for $y$: $y = \sqrt{x}$ and $y = -\sqrt{x}$. 
Also, with regards to the absolute value, both $\ln(x)$ and $\ln(|x|)$ are valid antiderivatives of $\frac{1}{x}$, so you're correct there.