Interchanging the variable while integrating - Allowed? Suppose we have this equation:
$$\frac{dy}{dx} = \frac{y}{2x}$$
The next step usually is:
$$\frac{dy}{y} = \frac{dx}{2x}$$
And then you integrate :
$$\int\frac{dy}{y} = \int\frac{dx}{2x}$$
$$\ln(y) = \ln(\sqrt{x}) + c$$
But can we integrate like this? (i feel you can't, but can't find the reasoning):
$$\int2x \ dy = \int y \ dx$$
$$2xy = xy + c$$
Can you tell if this is also plausible? If so, why? and If not, why not?
Thanks!
 A: No you can't do that since $y=y(x)$ is a function of the variable $x$. But you can use integrating factor method:
$$2xy'-y=0$$
$$\sqrt xy'-\dfrac 12 \dfrac y {\sqrt x}=0$$
$$\left ( \dfrac y {\sqrt x} \right)'=0$$
A: Let's write the equation a little differently,
$$y'(x)=\frac{y(x)}{2x}$$
So,
$$\frac{y'(x)}{y(x)}=\frac{1}{2x}$$
So now we can integrate both sides w.r.t $x$.
$$\int_1^s\frac{y'(x)}{y(x)}\mathrm dx=\int_1^s\frac{1}{2x}\mathrm dx$$
In the left integral, we make the change of variable $u=\log(y(x))$. This means that
$$\mathrm du=\frac{y'(x)}{y(x)}\mathrm dx$$
The limits of integration transform as
$$x=1\implies u=\log(y(1)):=c_1\\ x=s\implies u=\log(y(s))$$
Therefore,
$$\int_{c_1}^{\log(y(s))}\mathrm du=\int_1^s\frac{1}{2x}\mathrm dx\\ \log(y(s))-c_1=\frac{\log(s)}{2}\\ \log(y(s))=\frac{\log(s)}{2}+c_1$$
So finally taking the exponential of both sides
$$y(s)=C_1\sqrt{s}$$
Where $C_1:=e^{c_1}$.
IN SUMMARY: You should try to write $y(x)$ instead of just $y$ as often as possible! $y$ is a function, not a number. So we can't really "integrate with respect to $y$".
