Why does the "separation of variables" method for DEs work? [duplicate]
Heyho,
I am using the separation-of-variables method for quite a while now, but what was always bothering me a bit, is why is it possible to do those operations. I'll give a concrete example (source Wikipedia):
$$\frac{dy}{dx}=xy^2 + x \Rightarrow \frac{dy}{1+y^2} = x \:dx \Rightarrow \int{\frac{dy}{1+y^2}} = \int{x \:dx} \Rightarrow \cdots$$
and so on. My problem lies in step 2. Why can I just treat the differential operator like a variable?
And besides all those "technical" answers: For a differential equation, once you have an alleged solution, you can easily check it. So even if you used strange, non-rigorous, mystical methods, that last step shows whether or not your solution is correct.
Maybe the best way to see what's going on is to write it as an "almost separation of variables", where you separate the variables except that you keep the derivative intact: $$\frac{\mathrm dy}{\mathrm dx}=xy^2 + x \implies \frac{1}{1+y^2}\frac{\mathrm dy}{\mathrm dx} = x$$ This is clearly a valid transformation. And it is also valid to integrate both sides over the same variable: $$\frac{1}{1+y^2}\frac{\mathrm dy}{\mathrm dx} = x \implies \int \frac{1}{1+y^2}\frac{\mathrm dy}{\mathrm dx}\,\mathrm dx = \int x\,\mathrm dx$$ Now on the integral of the left hand side, you can do a variable substitution from $x$ to $y$. This gives $$\int \frac{1}{1+y^2}\frac{\mathrm dy}{\mathrm dx}\,\mathrm dx = \int \frac{1}{1+y^2}\,\mathrm dy$$ and therefore you get $$\int \frac{1}{1+y^2}\,\mathrm dy = \int x\,\mathrm dx$$ But that's exactly what you get by doing separation of variables the usual way.
To split the derivative $\frac{dy}{dx}$ in $dy$ and $dx$ is just a convenient formal way to solve the equation. If you do not want to go far into differentials etc, you can justify this splitting by the chain rule. For example, your equation can be rewritten as $$ y'(x)=xy(x)^2 + x \Rightarrow \frac{1}{1+y(x)^2}\cdot y'(x) =x \Rightarrow \arctan(y(x))' = x \Rightarrow \dots $$ since $\arctan(y)=\int\frac{dy}{1+y^2}$. Compare to see that the last expression looks exactly like in your post.
The "recipe" you are unhappy with can be validated as follows:
After step 1 your ODE has the form $$f(y)\>dy=g(x)\>dx\ .$$ This is saying that the quantities $x$ and $y$, when considered as functions of a "hidden" variable $t$, satisfy $$f\bigl(y(t)\bigr)\>\dot y(t)\ \equiv\ g\bigl(x(t)\bigr)\>\dot x(t)\tag{1}$$ for all $t$. Integrating $(1)$ with respect to $t$ from $t=0$ to some chosen upper limit $T$ we obtain $$\int_0^T f\bigl(y(t)\bigr)\>\dot y(t)\>dt=\int_0^T g\bigl(x(t)\bigr)\>\dot x(t)\>dt\ .$$ Assume that $f$ and $g$ have known primitives $F$ and $G$. Then a simple substitution in $(2)$ shows that we have $$F\bigl(y(T)\bigr)-F\bigl(y(0)\bigr)=G\bigl(x(T)\bigr)-G\bigl(x(0)\bigr)$$ for all $T$ in a suitable neighborhood of $0$. But this is saying that for all such $T$ the values $y:=y(T)$ and $x:=x(T)$ are related by $$F(y)-F(y_0)=G(x)-G(x_0)\ .$$