# Solving differential equation $x y^2 y' = x+1$

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 \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.

• Looks the same to me.
– A.Γ.
Aug 12, 2016 at 21:15
• Well, that is simply because there are three cubic roots of most numbers. If $y=y_1$ is a solution, then $y=\exp\left(\frac{2\pi\text{i}}{3}\right)y_1$ and $y=\exp\left(-\frac{2\pi\text{i}}{3}\right)y_1$ are also solutions. Only when you put a restriction that the solution be real-valued, then you will get only one of them. For Wolfram Alpha, $(-1)^{1/3}=\exp\left(\frac{\pi\text{i}}{3}\right)$. Aug 12, 2016 at 21:16
• Your answer is correct. Wolfram Alpha just simplified it.
– user322313
Aug 12, 2016 at 21:17

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.