# Is it mathematically valid to separate variables in a differential equation? [duplicate]

I read the following statement in a book on Calculus, as part of my mathematics course:

Technically this separation of $$\frac{dy}{dx}$$ is not mathematically valid. However, the resulting integration leads to correct answer.

The book also contains the following:

To solve a differential equation by separation of variables:

• get all the $$x$$ values on one side and all the $$y$$ values on the other side by multiplication and division.
• separate $$\frac{dy}{dx}$$ as if it were a fraction.
• integrate both sides.

Note: This box doesn’t refer to a particular problem. It refers to a class of problems of differential equations which can be solved using the Method of Separation of Variables.

My high school mathematics teacher told me that this is the most fundamental way to solve differential equations but the textbook says it is not mathematically valid. I am not able to understand why are certain methods being followed without having a mathematical proof. Or am I wrong?

The problem with this form of separation of variables (I say “this form” because “separation of variables” can refer to multiple things) is that treating the derivative $dy/dx$ as a ratio is a purely formal algebraic manipulation. There is a way to arrive at the same results in a rigorous fashion, but textbooks often don’t address this.

To elaborate, separation of variables in ODEs most commonly refers to a method of solving the ODE
$$\frac{dy}{dx} = g(x)h(y)$$
for the unknown function $y(x)$. Introductory textbooks often tell you to split the “fraction” $dy/dx”$ and unite common variables, like so:
$$\frac{dy}{h(y)} = g(x)dx$$
and then integrate both sides, as long as $h(y)\neq 0$, to obtain
$$H(y(x)) = \int g(x)~dx + C,$$
where $H(y)$ is an antiderivative of $\frac{1}{h(y)}$.

Unfortunately “$dy$” and “$dx$” have no actual mathematical meaning in this context, so all we’ve done is pull a little algebraic trick without understanding why it works. To resolve this, we rearrange:
$$\frac{1}{h(y)}\frac{dy}{dx} = g(x).$$
Integrating in $x$,
$$\int \frac{1}{h(y(x))}\frac{dy}{dx}(x)~dx = \int g(x)~dx + C.$$
Now if $H(y)$ is an antiderivative of $1/h(y)$, then by the chain rule
$$\frac{d}{dx}H(y(x)) = \frac{1}{h(y(x))}\frac{dy}{dx}(x)$$
so the left-hand integral is
$$\int \frac{1}{h(y(x))}\frac{dy}{dx}(x)~dx = \int \frac{d}{dx}H(y(x))~dx = H(y(x))$$
leading us to our desired conclusion,
$$H(y(x)) = \int g(x)~dx + C.$$

Doing it this way gives a rigorous justification of the result, but frankly the abuse of notation with the symbolic approach is much easier for most to memorize, so it is often the way it is taught to students. However, I think not explaining why the abuse of notation works confuses many students, both about the method and about their already flimsy understanding of the derivative.