# How is this differential obtained by substitution?

Given the differential equation $$xdy/dx=2y$$ my textbook says that applying the existence and uniqueness theorem obtains us $$y(x)=Cx^2$$ since $$f(x,y)=2y/x$$ and the partial derivative of f with respect to y is $$2/x$$.

I don’t understand at all what kind of substitution happened to get a general solution for $$y$$

• Actually, the general solution is $y(x)=C x^2$ for $x \ge 0$, $y(x)=D x^2$ for $x < 0$, where $C$ and $D$ can be different constants. The existence and uniqueness theorem for $dy/dx = f(x,y) = 2y/x$ doesn't hold at $x=0$, since $f$ is undefined there. Sep 3 at 6:04
• Also, the phrase “my textbook” is rather useless information. If you're going to mention a book, please tell us which book it is (and which page). Sep 3 at 6:05

Assuming that $$y\not\equiv 0$$, it results that:
\begin{align*} xy' = 2y & \Longleftrightarrow \frac{y'}{y} = \frac{2}{x}\\\\ & \Longleftrightarrow \ln|y| = 2\ln|x| + c\\\\ & \Longleftrightarrow \ln|y| = \ln|x|^{2} + c\\\\ & \Longleftrightarrow y(x) = \pm \exp(c)x^{2}\\\\ & \Longleftrightarrow y(x) = Cx^{2} \end{align*} where $$C\in\mathbb{R}\backslash\{0\}$$.
However $$y\equiv 0$$ is also a solution. Hence $$y(x) = Cx^{2}$$, for every $$C\in\mathbb{R}$$.