# Why does separation of variables work?

1. Apr 18, 2009

### Kaylee!

To solve a separable ODE like this I would simply multiply each side by dx and then integrate both sides. However, I know that it is only notational convenience that allows me to do this, and what's really going on is slightly more complicated.

Take this DE for example:

$$y^{2}\frac{dy}{dx}=x+1$$

$$\int{(y^{2}\frac{dy}{dx})}dx=\int{(x+1)}dx$$

$$\int{y^{2}}dy=\int{(x+1)}dx$$

$$\frac{y^{3}}{3} = \frac{x^{2}}{2} + x + c$$

What I don't understand, is how the LHS simplified like this:
$$\int{(y^{2}\frac{dy}{dx})}dx = \int{y^{2}}dy$$

I'm sorry for asking such a basic questions, but my book does not explain this well at all :(

2. Apr 18, 2009

### Pengwuino

You simplify multiply the dx by the dx in the denominator of dy/dx. Of course, it's not rigorously mathematically legal but i as well have never found out why we can actually do that.

3. May 27, 2009

### Mittir

What you need to do is do an integration by parts. It is not simply canceling out the $$dx$$ on the numerator and denominator, although it does give the same answer.

$$\int{(y^{2}\frac{dy}{dx})}dx = y^2 y - \int{2 y \frac{dy}{dx}y}dx$$.
$$\Rightarrow 3 \int{(y^{2}\frac{dy}{dx})}dx = y^3$$
$$\Rightarrow \int{(y^{2}\frac{dy}{dx})}dx = \frac{y^3}{3}$$

4. May 27, 2009

### slider142

It is simply the chain rule (in integral form). Consider f(x) = g(h(x)).
We then have f'(x) = g'(h(x))*h'(x). In Leibnitz notation, we thus have df/dx = (dg/dh)(dh/dx). By the Fundamental Theorem of Calculus, we then have
$$\int g'(h(x))*h'(x) = \int f'(x) = f(x) + C$$
In Leibnitz notation:
$$\int \frac{dg}{dh} \frac{dh}{dx} = f(x) + C = g(h(x)) + C$$
Suppressing the dependency of h on x, we get the abusive notation:
$$\int \frac{dg}{dh} dh = g(h) + C$$
It is common for physics and engineering oriented texts to gloss over this and rely on an often undefined algebra of differentials.

Last edited: May 27, 2009
5. May 28, 2009

### Tac-Tics

It seems that most of calculus and DE is based on some amazing notational conveniences which magically work. The underlying mechanics is a little more annoying.

If you restate the problem, what you really have is an equation of an unknown function of x called y. Your goal is to figure out what values y can take on to make the equation true for ALL real x.

$$y^2(x) y'(x) = x + 1$$

Both sides of this equation are a function of x, so we can take the anti-derivative of both sides. The right is easy, $$\int(x + 1)dx = \frac{1}{2} x^2 + x$$.

The other side is a pain: $$\int y^2(x) y'(x) dx$$. Use integration by parts, you can prove $$\int y^2(x) y'(x) dx = y(x)^3 - \int y(x)^2 y'(x) dx$$, and moving over the common expression to one side, and dividing by the 3, you get $$\int y^2(x) y'(x) dx = \frac{1}{3} y(x)^3$$.

So our equation is now $$\frac{1}{3} y^3(x) = \frac{1}{2} x^2 + x$$

All these steps are legal, so the final equation there is a true statement, but it's not the answer to the question asked. This is a SINGLE solution to the DE. To arrive at the family of solutions, we recognize that one of our steps (the anti-derivative) is not one-to-one, and with a little informal rationalization, you can also see where the hell the stupid constant of integration comes in. If you really wanted to formalize away the constant as well, you can think of the result of an anti-derivative as a set-valued operation instead of a function-valued one.

And that's how we can reduce separable ODE to first-year calculus =-) How the hell the notation works is nothing short of miraculous. Infinitesimal "dx's" are not how it works under the hood. What the hell is a "dx" anyway? It's not quite a number. Not quite a function. It's not well-typed. Infinitesimal calculus is amazing at explaining derivation (dividing by one zero is easy) but it sucks at integration (summing an infinite number of zeroes is hard!)

Too many people do this kind of math without really understanding how it really works, so it's good to ask such things ;-)

6. May 28, 2009

### AiRAVATA

There is no need to integrate by parts. As slider142 pointed out, is simply the chain rule. Suppose you have the separable differential equation

$$f\bigl(y(x)\bigr)y'(x) = g(x),$$

Let $F(\eta)$ be the primitive of $f(\eta)$. Then, by the chain rule

$$\frac{d}{d x} F\bigl(y(x)\bigr)=f\bigl(y(x)\bigr)y'(x),$$

now, integrating both sides of the separable ode,

$$\int_{x_0}^x f\bigl(y(\xi)\bigr)y'(\xi)dx = \int_{x_0}^x \frac{d}{d\xi} F\bigl(y(\xi)\bigr)d\ix = F\bigl(y(x)\bigr)- F\bigl(y(x_0)\bigr),$$

so

$$F\bigl(y(x)\bigr) = F\bigl(y(x_0)\bigr) + \int_{x_0}^x g(\xi) d\xi,$$

wich is the solution of the ode in implicit form.

7. Jun 20, 2009

### zpconn

This is one reason why I hate the way that many introductions to calculus encourage sloppy interpretations of the symbols $$dx$$ and $$dy$$ and so forth. It leads to much confusion when one tries to actually prove the change of variables theorem; it leads to confusion in solving separable ODEs; and it leads to confusion if one still hasn't figured it out by the time one studies calculus on manifolds.

In my opinion, which may be somewhat rare, the differential symbols $$dx$$ and so on should simply not be used ever in introductory calculus and differential equations except to form the symbol $$d/dx$$ for derivatives. The reason is simply that this would avoid many sources of confusion, such as the one that prompted this thread, and it would make the transition to calculus on manifolds less annoying, which is often the first time that these symbols are given actual meanings.

In the case of separable first-order ODEs, the general first-order equation is

$$\frac{dy}{dx} = f(x,y)$$

Any such equation can be rewritten in the form

$$M(x,y) + N(x,y) \frac{dy}{dx} = 0$$

Choose, for example, $$M = -f(x,y)$$ and $$N = 1$$. However, if $$M$$ and $$N$$ turn out to be functions of only x and y, respectively, then we obtain

$$M(x) + N(y)\frac{dy}{dx} = 0$$

Now suppose that $$A$$ and $$B$$ are any antiderivatives of $$M$$ and $$N$$. Then the equation is

$$A'(x) + B'(y) \frac{dy}{dx} = 0$$

By the chain rule,

$$B'(y) \frac{dy}{dx} = \frac{d}{dx} B(y)$$

Thus, the equation can be written as

$$\frac{d}{dx} (A(x) + B(y)) = 0$$

Integrating yields the implicit solution

$$A(x) + B(y) = c$$

Last edited: Jun 20, 2009
8. Jun 22, 2009

### ronaldor9

thanks a lot for the description of the theory behind the method of separable ODE's zpconn, much appreciated.

9. Jun 29, 2009

### matematikawan

I don't understand why it is so difficult to understand the statement.
$$\int{y^{2}}dy=\int{(x+1)}dx$$

Is the statement incorrect? Attempt to elaborate it further makes life more difficult.

10. Jul 1, 2009

### AiRAVATA

Is not exactly incorrect, but is an abuse of notation (as we say in my country).

11. Jul 1, 2009

### BobbyBear

Um, which country would that be? (just curious . . . I know, I know, curiosity killed the cat :> *bites tongue*)
I think in my country they say something like that too :P

12. Jul 1, 2009

### AiRAVATA

Well, as $y = y(x)$, then

$$dy = \frac{dy}{dx} dx,$$

so

$$\int y^2 dy=\int y^2(x) y'(x) dx = \int \frac{d}{dx} \left(\frac{y^3(x)}{3}\right) dx = \frac{y^3(x)}{3} + C$$

13. Jul 3, 2009

### matematikawan

Oh it is the abuse of notation. Did you meant

y2 dy = (x+1) dx ?

I hate Machiavellian ( you know The End Justifies The Means). But I think I can tolerate this one. It is not a sin to be hypocrite in mathematics.

14. Jul 3, 2009

### AiRAVATA

Thats right, because if you don't specify what are x and y, then that equality is ambiguous (in the context of the ode you want to solve).

P.S. You can also see separation of variables as an example of the implicit function theorem.