# Finding the function solution of the ODE $xy'=2y$

I have $$xy'=2y$$

Through separation of the variables I get $$\frac{1}{2y}dy=\frac{1}{x}dx$$ Integrating both sides I get $$\frac{1}{2}\ln y=\ln x$$ which leads to $$\ln y=2\ln x$$ Hence I get $$y=2x$$

But the solutions say the answer is $$y=cx^2$$ Have I made a mistake or are the solutions wrong?

• when you go from $ln y = 2ln x$ to $y = 2x$ you are making a mistake. it should be $\ln y = \ln x^2$ and then to $y = x^2.$ – abel Feb 14 '15 at 22:53
• By the way, you should be able to tell that $y = 2x$ isn't a solution by substituting back into the original equation. – Simon S Feb 14 '15 at 22:58

Firstly, don't forget the constant of integration. $\ln(y) = 2\ln(x) + c$.
The step from $$\ln(y) = 2\ln(x)$$ to $$y = 2x$$ is incorrect. You need to exponentiate both sides, that is $$e^{\ln(y)} = e^{2\ln(x) + c}$$
Since $\exp$ and $\ln$ are inverses of each other, the result follows.
• Why does $e^2ln(x)$ become $e^{x^2}$? – user204450 Feb 14 '15 at 23:00
• Because of the property of indices: $(a^p)^q = a^{pq} = (a^q)^p$. So $e^{2\ln(x)} = (e^{\ln(x)})^2$. – Michael Cromer Feb 14 '15 at 23:02
• But that would give $e^2x$ but the solutions want $e^{x^2}$ – user204450 Feb 14 '15 at 23:04
• No, $e^{2\ln(x)} = (e^{\ln(x)})^2 = x^2$, since $e^{\ln(x)} = x$. Note that the result is not $e^y = e^{x^2}$. Exponentiation undoes the logarithm. – Michael Cromer Feb 14 '15 at 23:08
$$\frac{y'}{2y}=\frac{1}{x}$$ $$\frac{1}{2}\ln(y)=\ln(x)+c$$ $$\frac{1}{2}\ln(y)=\ln(Cx)$$ $$\ln(y)=2\ln(Cx)$$ $$\ln(y)=ln(Cx)^2$$ Now you can take the exponential for both sides $$y=kx^2$$