Differential Equation Magic

Recall the method of separable variables, which solves

\displaystyle \frac{\mathrm dy}{\mathrm dx} = f(x)g(y)

by separating the x from the y, and integrating on both sides:

\displaystyle \int \frac{1}{g(y)}\, \mathrm dy = \int f(x)\, \mathrm dx.

In particular, we have solved the following equation in a similar manner.

Theorem 1. For any continuous P, the general solution to the differential equation

\displaystyle \frac{\mathrm dy}{\mathrm dx} + P(x)y = 0

is given by \displaystyle y = Ae^{-\int P(x)\, \mathrm dx}, where A = \pm 1.

Proof. Exercise.

How do we solve more general equations? For instance, we want to solve the equation

\displaystyle \frac{\mathrm dy}{\mathrm dx} + P(x)y = Q(x),

where P and Q are continuous so that they can be integrated. There are multiple perspectives to approach this problem, but the approach we will take will connect this problem with the separable variables method.

Let’s first recall the product rule. Given any function \mu(x), the product rule tells us that

\displaystyle \frac{\mathrm d}{\mathrm dx}(y \mu(x)) = \frac{\mathrm dy}{\mathrm dx} \mu(x) + y \mu'(x).

Dividing by \mu(x) yields

\displaystyle \frac 1{\mu(x)} \cdot \frac{\mathrm d}{\mathrm dx}(y \mu(x)) = \frac{\mathrm dy}{\mathrm dx}+ \frac{\mu'(x)}{\mu(x)} y.

Now, cue the key insight: If we specially chose some \mu such that \mu'(x)/\mu(x) = P(x), then

\displaystyle \frac 1{\mu(x)} \cdot \frac{\mathrm d}{\mathrm dx}(y \mu(x)) = \frac{\mathrm dy}{\mathrm dx}+ P(x) y = Q(x).

Then doing a little bit of algebra and integration yields

\displaystyle \begin{aligned}\frac 1{\mu(x)} \cdot \frac{\mathrm d}{\mathrm dx}(y \mu(x))  &= Q(x) \\ \frac{\mathrm d}{\mathrm dx}(y \mu(x)) &= \mu(x) Q(x) \\y \mu(x) &= \int \mu(x) Q(x)\, \mathrm dx. \end{aligned}

We call \mu(x) an integrating factor, since it is the factor multiplied to help us integrate the expression. What should \mu \equiv \mu(x) be, though? Remember our key insight? Well, writing \displaystyle \mu' = \frac{\mathrm d \mu}{\mathrm dx},

\displaystyle \frac{\mathrm d\mu}{\mathrm dx} - P(x)\mu = 0.

Then Theorem 1 gives us the result

\displaystyle \mu = Ae^{-\int (-P(x))\, \mathrm dx} = Ae^{\int P(x)\, \mathrm dx},

where A is any arbitrary nonzero constant. Denote \mu_0(x) = e^{\int P(x)\, \mathrm dx} so that \mu = A \mu_0. Making the substitution,

\displaystyle \begin{aligned} y \mu(x) &= \int \mu(x) Q(x)\, \mathrm dx\\ y \cdot A\mu_0(x) &= \int A\mu_0(x) Q(x)\, \mathrm dx \\ y \mu_0(x) &= \int \mu_0(x) Q(x)\, \mathrm dx \end{aligned}

This means that A eventually cancels out, and therefore without loss of generality, we can assume \mu(x) = \mu_0(x) = e^{\int P(x)\, \mathrm dx}. This yields the method of integrating factors.

Theorem 2. For any continuous P, Q, the general solution to the differential equation

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

is given by

\displaystyle y \mu(x) = \int \mu(x) Q(x)\, \mathrm dx,\quad \mu(x) = e^{\int P(x)\, \mathrm dx}.

Example 1. Given \alpha \neq \beta, find the general solution to the differential equation

\displaystyle \frac{\mathrm dy}{\mathrm dx} - \beta y = Ae^{\alpha x}.

Solution. By the method of integrating factors, P(x) = -\beta and Q(x) = Ae^{\alpha x}. Then the integrating factor is given by

\mu(x) = e^{\int P(x)\, \mathrm dx} = e^{\int -\beta\, \mathrm dx} = e^{-\beta x}.

Thus, the general solution is given by

\displaystyle \begin{aligned} y \mu(x) &= \int \mu(x) Q(x)\, \mathrm dx \\ y e^{-\beta x} &= \int e^{-\beta x} \cdot Ae^{\alpha x}\, \mathrm dx \\ &= \int A e^{(\alpha-\beta) x}\, \mathrm dx \\ &= \frac{A}{\alpha - \beta}\cdot e^{(\alpha-\beta) x} + C \\ y &= \frac{A}{\alpha - \beta}\cdot e^{(\alpha-\beta) x} \cdot e^{\beta x} + Ce^{\beta x} \\ &= \frac{A}{\alpha - \beta}\cdot e^{\alpha x}+ Ce^{\beta x} \\ &= C_1 e^{\alpha x} + C_2 e^{\beta x}, \end{aligned}

where C_1 := A/(\alpha - \beta), C_2 := C are arbitrary constants.

In fact, Example 1 is the key motivating result for us to study the next idea in a course in differential equations: second-order differential equations.

—Joel Kindiak, 27 Jan 25, 1712H


Responses

  1. The Power of Substitutions – KindiakMath

    […] Thus, the equation can be solved via the method of integrating factors. In fact, using the integrating factor […]

    Like

  2. The Separable Variables Method – KindiakMath

    […] the next post, we apply the method of separable variables to solve more general differential equations, known as linear differential […]

    Like

  3. Two-Dimensional Differential Equations – KindiakMath

    […] By the method of integrating factors, […]

    Like

  4. Mutated Integrating Factors – KindiakMath

    […] where we need to evaluate the right-hand side. For a derivation of this solving technique, click here. […]

    Like

  5. Kindiak Gauntlet (Differential Equations) – KindiakMath

    […] Compute the integrating factor […]

    Like

Leave a comment