DIFFERENTIAL EQUATIONS 02

Separation of Variables

Separation of variables solves certain first-order differential equations by separating the variables and then integrating.

The main idea

Consider a differential equation of the form

\[ \frac{dy}{dx}=g(x)h(y). \]

The \(x\)-dependence and \(y\)-dependence can be separated.

If \(h(y)\neq0\), write

\[ \boxed{ \frac{1}{h(y)}\,dy = g(x)\,dx } \]

We can then integrate both sides.

1. Why separate the variables?

The original equation contains \(x\), \(y\), and the derivative \(dy/dx\) together.

Separation rearranges the equation so that all expressions involving \(y\) are associated with \(dy\), while all expressions involving \(x\) are associated with \(dx\).

\[ \boxed{ \text{\(y\)-terms}\,dy = \text{\(x\)-terms}\,dx } \]

Each side can then be integrated in its own variable.

2. A simple example

Consider

\[ \frac{dy}{dx}=2x. \]

Write

\[ dy=2x\,dx. \]

Integrate both sides:

\[ \int dy = \int2x\,dx. \]

Therefore,

\[ y=x^2+C. \]

So

\[ \boxed{ y=x^2+C } \]

3. Example with both variables

Consider

\[ \frac{dy}{dx}=xy. \]

Now \(x\) and \(y\) both appear.

For \(y\neq0\), divide by \(y\):

\[ \frac{1}{y}\frac{dy}{dx}=x. \]

Using differential notation, write

\[ \frac{1}{y}\,dy=x\,dx. \]

4. Integrate both sides

Now integrate:

\[ \int\frac{1}{y}\,dy = \int x\,dx. \]

This gives

\[ \ln|y| = \frac{x^2}{2}+C. \]

This is already an implicit form of the solution.

5. Solve explicitly for \(y\)

Exponentiate both sides:

\[ |y| = e^{x^2/2+C}. \]

Using

\[ e^{a+b}=e^ae^b, \]

we obtain

\[ |y| = e^C e^{x^2/2}. \]

The arbitrary constant and possible sign can be absorbed into a new constant \(A\).

Therefore,

\[ \boxed{ y=Ae^{x^2/2} } \]

6. A solution can be lost during division

In the previous example we divided by \(y\).

But division by \(y\) assumes

\[ y\neq0. \]

The original differential equation

\[ \frac{dy}{dx}=xy \]

also has the solution

\[ \boxed{y=0}. \]

Therefore, whenever we divide by an expression involving the unknown function, we should check whether setting that expression equal to zero gives an additional solution.

7. General separable form

A first-order equation is separable if it can be written as

\[ \frac{dy}{dx}=g(x)h(y). \]

For \(h(y)\neq0\),

\[ \frac{1}{h(y)}\frac{dy}{dx}=g(x). \]

Then

\[ \frac{1}{h(y)}\,dy=g(x)\,dx. \]

Integrating,

\[ \boxed{ \int\frac{1}{h(y)}\,dy = \int g(x)\,dx } \]

8. Where does the constant go?

We could write

\[ \int\frac{1}{h(y)}\,dy = H(y)+C_1 \]

and

\[ \int g(x)\,dx = G(x)+C_2. \]

Then

\[ H(y)+C_1 = G(x)+C_2. \]

Rearranging,

\[ H(y) = G(x)+(C_2-C_1). \]

Since the difference of two arbitrary constants is another arbitrary constant, we simply write

\[ \boxed{ H(y)=G(x)+C } \]

So only one arbitrary constant is needed.

9. Example: exponential growth

Consider

\[ \frac{dP}{dt}=kP, \]

where \(k\) is constant.

For \(P\neq0\), separate:

\[ \frac{1}{P}\,dP=k\,dt. \]

Integrate:

\[ \int\frac1P\,dP = \int k\,dt. \]

Therefore,

\[ \ln|P|=kt+C. \]

Exponentiating,

\[ P=Ae^{kt}. \]

Hence,

\[ \boxed{ P(t)=Ae^{kt} } \]

10. Apply an initial condition

Suppose

\[ P(0)=P_0. \]

Using

\[ P(t)=Ae^{kt}, \]

set \(t=0\):

\[ P_0=Ae^0. \]

Since

\[ e^0=1, \]

we obtain

\[ A=P_0. \]

Therefore,

\[ \boxed{ P(t)=P_0e^{kt} } \]

11. Growth and decay

For

\[ \frac{dP}{dt}=kP, \]

if

\[ k>0, \]

then \(P(t)\) grows exponentially.

If

\[ k<0, \]

then \(P(t)\) decays exponentially.

\[ \boxed{ k>0 \Rightarrow \text{growth} } \] \[ \boxed{ k<0 \Rightarrow \text{decay} } \]

12. Another example

Solve

\[ \frac{dy}{dx}=x(1+y^2). \]

Separate:

\[ \frac{1}{1+y^2}\,dy = x\,dx. \]

Integrate:

\[ \int\frac{1}{1+y^2}\,dy = \int x\,dx. \]

Therefore,

\[ \arctan y = \frac{x^2}{2}+C. \]

Apply the tangent function:

\[ \boxed{ y= \tan\left( \frac{x^2}{2}+C \right) } \]

The solution is valid on intervals where the tangent expression is defined.

13. Implicit solutions

It is not always necessary or possible to isolate \(y\).

For example, separation may produce

\[ H(y)=G(x)+C. \]

This equation can itself describe the solution.

Such a form is called an implicit solution.

14. Is \(dy/dx\) really a fraction?

The notation

\[ \frac{dy}{dx} \]

looks like an ordinary fraction, but a derivative is defined through a limit and should not generally be treated as an ordinary algebraic fraction.

However, for a separable differential equation, the familiar manipulation

\[ \frac{dy}{dx}=g(x)h(y) \]

to

\[ \frac{1}{h(y)}\,dy=g(x)\,dx \]

is mathematically justified through the chain rule and substitution in integration.

So the notation is useful, but the validity comes from calculus rather than ordinary fraction cancellation.

15. Why the manipulation works

Suppose

\[ H'(y)=\frac{1}{h(y)}. \]

By the chain rule,

\[ \frac{d}{dx}H(y(x)) = H'(y)\frac{dy}{dx}. \]

Therefore,

\[ \frac{d}{dx}H(y(x)) = \frac{1}{h(y)} \frac{dy}{dx}. \]

Using the differential equation

\[ \frac{dy}{dx}=g(x)h(y), \]

we obtain

\[ \frac{d}{dx}H(y(x)) = g(x). \]

Integrating with respect to \(x\),

\[ H(y)=\int g(x)\,dx+C. \]

This is exactly the result obtained by separation of variables.

16. Not every ODE is separable

Separation works only when the equation can be rearranged into the appropriate form.

For example,

\[ \frac{dy}{dx}=x+y \]

cannot generally be written as

\[ g(x)h(y). \]

So a different solution method is required.

17. The practical method

\[ \boxed{ 1.\; \text{Check whether the equation is separable} } \] \[ \boxed{ 2.\; \text{Separate the \(x\)- and \(y\)-dependence} } \] \[ \boxed{ 3.\; \text{Check whether division could lose a solution} } \] \[ \boxed{ 4.\; \text{Integrate both sides} } \] \[ \boxed{ 5.\; \text{Simplify or solve for the unknown function} } \] \[ \boxed{ 6.\; \text{Use any initial condition} } \] \[ \boxed{ 7.\; \text{Check the solution in the original equation} } \]

18. The central idea

Separation of variables converts a differential equation into two ordinary integrals.

\[ \boxed{ \frac{dy}{dx}=g(x)h(y) } \] \[ \downarrow \] \[ \boxed{ \frac{1}{h(y)}\,dy=g(x)\,dx } \] \[ \downarrow \] \[ \boxed{ \int\frac{1}{h(y)}\,dy = \int g(x)\,dx } \]

It is one of the simplest and most important methods for solving first-order differential equations.