Skip to content
Published on

Engineering Math Series 3: Separation of Variables, Integrating Factor, Exact Equations

Authors

Engineering Math Series 3: Separation of Variables, Integrating Factor, Exact Equations

First-order differential equations may seem to come in many varieties, but at the introductory level, learning three representative patterns first is sufficient. The key is to develop the eye to classify "what form is this" as soon as you see an equation.

1. Separation of Variables

The first form to look at is

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

This equation can be solved if you can separate the terms involving xx and yy to opposite sides.

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

Integrating both sides gives

1h(y)dy=g(x)dx+C\int \frac{1}{h(y)} \, dy = \int g(x) \, dx + C

Example

If

dydx=xy\frac{dy}{dx} = xy

then

1ydy=xdx\frac{1}{y}dy = xdx

and integrating,

lny=x22+C\ln |y| = \frac{x^2}{2} + C

Therefore

y=Cex2/2y = Ce^{x^2/2}

Intuition

Separation of variables is powerful "when the rate of change decomposes into a product of two factors." It frequently appears in situations where the growth rate splits into the effect of time and the effect of the current state.

2. Integrating Factor Method

The following standard form of a first-order linear equation is solved using the integrating factor method.

dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x)

The key idea is to multiply by some function μ(x)\mu(x) to make the left side into a form that can be differentiated all at once.

The integrating factor is

μ(x)=eP(x)dx\mu(x) = e^{\int P(x)\,dx}

Multiplying both sides gives

μ(x)dydx+μ(x)P(x)y=μ(x)Q(x)\mu(x)\frac{dy}{dx} + \mu(x)P(x)y = \mu(x)Q(x)

and the left side becomes

ddx[μ(x)y]=μ(x)Q(x)\frac{d}{dx}\left[\mu(x)y\right] = \mu(x)Q(x)

Example

For

dydx+y=x\frac{dy}{dx} + y = x

we have P(x)=1P(x) = 1, so

μ(x)=e1dx=ex\mu(x) = e^{\int 1\,dx} = e^x

Multiplying both sides by exe^x gives

ddx(exy)=xex\frac{d}{dx}(e^x y) = xe^x

Integrating,

exy=xexdx=ex(x1)+Ce^x y = \int xe^x \, dx = e^x(x-1) + C

Therefore

y=x1+Cexy = x - 1 + Ce^{-x}

Engineering Significance

The integrating factor method frequently appears in systems with a "term that pulls the current state," such as RC and RL circuits or simple thermal equilibrium models.

3. Exact Equations

Consider the following form.

M(x,y)dx+N(x,y)dy=0M(x, y)dx + N(x, y)dy = 0

If this equation can be interpreted as the total differential of some scalar function F(x,y)F(x, y)

dF=Fxdx+FydydF = \frac{\partial F}{\partial x}dx + \frac{\partial F}{\partial y}dy

then the solution is simply

F(x,y)=CF(x, y) = C

In this case, the equation is called an exact equation.

The test condition is

My=Nx\frac{\partial M}{\partial y} = \frac{\partial N}{\partial x}

Example

Consider

(2xy+1)dx+(x2+3y2)dy=0(2xy + 1)dx + (x^2 + 3y^2)dy = 0

We have

M(x,y)=2xy+1,N(x,y)=x2+3y2M(x, y) = 2xy + 1, \quad N(x, y) = x^2 + 3y^2

and

My=2x,Nx=2x\frac{\partial M}{\partial y} = 2x, \quad \frac{\partial N}{\partial x} = 2x

so it is exact.

Integrating MM with respect to xx,

F(x,y)=(2xy+1)dx=x2y+x+g(y)F(x, y) = \int (2xy + 1)\,dx = x^2y + x + g(y)

Differentiating with respect to yy and comparing with NN,

Fy=x2+g(y)=x2+3y2\frac{\partial F}{\partial y} = x^2 + g'(y) = x^2 + 3y^2

so

g(y)=3y2,g(y)=y3g'(y) = 3y^2, \quad g(y) = y^3

Therefore the solution is

x2y+x+y3=Cx^2y + x + y^3 = C

How to Distinguish

When you see a problem, think in the following order.

  1. Can xx and yy be cleanly separated
  2. Does it look like the linear standard form dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x)
  3. Can you write it in differential form and check the exactness condition

At the beginning, these three alone can handle a great many introductory problems.

A Short Worked Example

The initial value problem

dydx=3x2,y(0)=4\frac{dy}{dx} = 3x^2, \quad y(0)=4

is easier to solve by direct integration than by separation of variables.

dy=3x2dxdy = 3x^2 dx

Integrating,

y=x3+Cy = x^3 + C

Applying the initial condition,

4=0+C4 = 0 + C

so

y=x3+4y = x^3 + 4

This example is very simple, but it is good for confirming the basic procedure of "find the general solution and then determine the constant using the initial condition."

Common Mistakes

Forcing the wrong form

Trying to force separation on an equation that is not separable will derail the calculation. Classification must come first.

Computing the integrating factor incorrectly

The integrating factor is eP(x)dxe^{\int P(x)\,dx}. A common mistake is to integrate Q(x)Q(x) along with it.

Integrating without checking the exactness condition

For exact equations, you must verify the condition first. Otherwise, you end up trying to force-find a potential function that does not exist.

One-Line Summary

For first-order differential equations, the key is to identify whether it is separable, linear, or exact before starting any computation.

Next Post Preview

In the next post, we will move beyond first-order to second-order linear differential equations, where we will begin seriously exploring vibration and response of engineering systems.

References

  • Erwin Kreyszig, Advanced Engineering Mathematics, 10th Edition
  • William E. Boyce, Richard C. DiPrima, Elementary Differential Equations and Boundary Value Problems
  • MIT OpenCourseWare, Differential Equations