Article objectives

  • This article introduces the integrating factor technique as a method to solve linear, first-order differential equations.
  • Introduction

    Differential equations can be solved with many different methods. Many of these methods are exclusive to one form of a differential equation. One, the Integrating Factor Technique, requires the differential equation to be of the form:

    $$y' + f(x)y = g(x)$$

    These are linear, first-order differential equations. In the case where \(g(x) = 0\), the equation is also called homogeneous, and in this case solving the equation will usually be even easier.

    The Integrating Factor Technique is not just a formula; rather, there is an entire process that must be understood, and it is reliant on much of what is typically studied in calculus courses before differential equations, requiring both differential and integral calculus. Each step of the process will be detailed individually, and then they will be combined to show examples of solving differential equations of this class.

    The "Magic" Function

    The Magic function is a special function which must be used as part of the integrating factor technique. It is defined as

    $$M(x) = e^{\int{f(x)dx}}$$

    where \(f(x)\) is defined in the original form of the differential equation. Once \(M(x)\) is found, you multiply both sides of the differential equation by \(M(x)\).

    Example 1: Find \(M(x)\) for the differential equation

    $$y' + 7xy = 2x$$

    Solution: The differential equation is in the desired form, so \(f(x) = 7x\). Now we can find \(M(x)\):

    $$M(x) = e^{\int{7xdx}} = e^{\frac{7}{2}x^2}$$

    The next step in solving this differential equation would be to multiply both sides of the equation by \(M(x)\):

    $$y'e^{\frac{7}{2}x^2} + 7xye^{\frac{7}{2}x^2} = 2xe^{\frac{7}{2}x^2}$$

    Here is another example of calculating the Magic Function.

    Example 2: Find \(M(x)\) for the differential equation

    $$y' + 3y\cos x = 1$$

    Solution: Again, the differential equation is already in the correct form. We see that \(f(x) = 3\cos x\). Find \(M(x)\):

    $$M(x) = e^{\int{3\cos xdx}} = e^{3\sin x}$$

    Here is another example that is slightly more difficult. Study it carefully.

    Example 3: Find \(M(x)\) for the differential equation

    $$\frac{y'}{x} + 2x^5y = 12x - 4$$

    Solution: We must perform one intermediate step before proceeding to find \(M(x)\): we must write the differential equation in the required form where the \(y'\) is not multiplied by anything. To do so, multiply both sides of the equation by \(x\):

    $$y' + 2x^6y = 12x^2 - 4x$$

    Now find \(M(x)\), given that we can see \(f(x) = 2x^6\):

    $$M(x) = e^{\int{2x^6dx}} = e^{\frac{2}{7}x^7}$$

    Backwards Product Rule

    The next step of the Integrating Factor Technique is an iffy one, because it requires careful observation. You must be able to condense a sum of terms into the derivative of a product. Luckily, since these terms will usually have exponential factors (due to the Magic Function introducing exponential factors into the equation), the product rule application is usually easy to spot.

    Example 4: Write \(e^{x^2} + 2x^2e^{x^2}\) as the derivative of a product.

    Solution: Notice that there is an exponential factor in both terms. Upon differentiation of an exponential term, the argument of the exponent will not change. This means the sum can be written as

    $$(f(x)e^{x^2})'$$

    While observation is usually sufficient to find \(f(x)\), we will show a more thorough way to find \(f(x)\). Differentiate the above expression with the Product Rule and Chain Rule, then set it equal to the original expression:

    $$f'(x)e^{x^2} + 2xf(x)e^{x^2} = e^{x^2} + 2x^2e^{x^2}$$

    Divide both sides of the equation by \(e^{x^2}\) (which never equals zero):

    $$f'(x) + 2xf(x) = 1 + 2x^2$$

    From here it is obvious that the left-hand side must contain a constant term and a quadratic term. \(f(x)\) must be linear to make this true.

    $$2xf(x) = 2x^2 \Rightarrow$$ $$f(x) = x \Rightarrow$$ $$f'(x) = 1$$

    This makes the equation true, so the condensed form of the original expression is \((xe^{x^2})'\). Feel free to check this by expanding and differentiating.

    Example 5: Write the expression \(x^5e^x + 5x^4e^x\) as the derivative of a product.

    Solution: Here we will show a different method. See that each term in the sum has two factors that can be paired up: \(x^5\) with \(5x^4\), and \(e^x\) with \(e^x\). Each pair of factors differs only by one differentiation, which suggests, by the Product Rule, that

    $$(x^5e^x)' = x^5e^x + 5x^4e^x$$

    Differentiating the left-hand side confirms that this is true.

    Example 5 makes it worthwhile to recall that the derivative of the product of two factors is in terms of the factors and their derivatives. That is why the methods shown in Examples 4 and 5 are viable.

    Example 6: Write the expression \(2e^{2x}\sin x + e^{2x}\cos x\) as the derivative of a product of two factors.

    Solution 1: We use the method shown in Example 4. Because both terms have the same exponential factor, that must be one of the factors, so

    $$(f(x)e^{2x})' = 2e^{2x}\sin x + e^{2x}\cos x$$

    Expand the left side with the Product Rule and the Chain Rule:

    $$f'(x)e^{2x} + 2f(x)e^{2x} = 2e^{2x}\sin x + e^{2x}\cos x$$

    The second term on the left side must be equivalent to one of the two terms on the right side. If

    $$2f(x)e^{2x} = 2e^{2x}\sin x$$

    then \(f(x) = \sin x\) and \(f'(x) = \cos x\). Substituting gives

    $$\cos x e^{2x} + 2\sin x e^{2x} = 2e^{2x}\sin x + e^{2x}\cos x$$

    That means that \(f(x) = \sin x\) and the desired form of the expression is \((e^{2x}\sin x)'\).

    Solution 2: This solution mirrors the given solution for Example 5. Pair up the factors between the two terms as \(2e^{2x}\) with \(e^{2x}\) and \(\sin x\) with \(\cos x\). This is a logical pairing because the two pieces to each pair differ by one differentiation. Differentiating \(e^{2x}\) gives \(2e^{2x}\) and differentiating \(\sin(x)\) gives \(\cos(x)\). Therefore, in the Product Rule we let \(f(x) = e^{2x}\), \(f'(x) = 2e^{2x}\), \(g(x) = \sin(x)\), and \(g'(x) = \cos(x)\), implying that the desired form of the sum is \((e^{2x}\sin(x))'\).

    Integrating the Derivative

    The last major step in the Integrating Factor Technique is to integrate the equation. At this point one side of the equation will contain a derivative of a product. Integrating this side of the equation will result in the argument of the derivative plus a constant. The other side of the equation should be pretty easy to integrate.

    Example 7: Integrate and solve for \(y\):

    $$(ye^x\tan x)' = 2\sin x$$

    Solution: Integrate both sides:

    $$\int {(ye^x\tan x)' dx} = \int{2\sin x dx} \Rightarrow$$ $$ye^x\tan x + C_1 = -2\cos x + C_2$$

    Move the constants to one side, and rename \(C_2 - C_1\) as \(C\):

    $$ye^x\tan x = -2\cos x + C$$

    Now isolate \(y\):

    $$y = \frac{-2\cos x + C}{e^x\tan x}$$

    Combining the Steps

    Now we will put the steps together to get the entire Integrating Factor Technique. Here are the steps for reference:

    1. Ensure that the differential equation is of the appropriate type (linear and first-order) and that it is of the form \(y' + f(x)y = g(x)\).
    2. Determine the Magic Function and multiply both sides of the differential equation by it.
    3. Write one side of the differential equation as the derivative of a product of two factors.
    4. Solve for \(y\) by integrating the derivative.

    With this in mind, let's look at some examples.

    Example 8: Solve the differential equation

    $$y' + 6y = x$$

    Solution: The equation is of the appropriate form. Use the \(y\) term to find \(M(x)\):

    $$M(x) = e^{\int{6dx}} = e^{6x}$$

    Multiply both sides of the differential equation by this function:

    $$e^{6x}y' + 6e^{6x}y = xe^{6x}$$

    For the derivative of a product, \(y\) will be one of the factors. Obviously, \(e^{6x}\) must be the other factor because it will not vanish upon differentiation (\(\frac{d}{dx}(e^{6x}) = 6e^{6x}\)). Therefore,

    $$(ye^{6x})' = xe^{6x}$$

    Integrate:

    $$\int{(ye^{6x})'dx} = \int{xe^{6x}dx}$$

    The right side must be simplified with integration by parts:

    $$\int{xe^{6x}dx} = \frac{1}{6}xe^{6x} - \int{\frac{1}{6}e^{6x}dx} = \frac{1}{6}xe^{6x} - \frac{1}{36}e^{6x} + C_1$$

    That means

    $$ye^{6x} + C_2 = \frac{1}{6}xe^{6x} - \frac{1}{36}e^{6x} + C_1$$

    Isolate \(y\):

    $$y = \frac{1}{6}x - \frac{1}{36} + C_1e^{-6x}$$

    Here is another example. However, this one is an initial value problem, meaning there is a specific value of \(C\) that needs to be found.

    Example 9: Solve the following differential equation at the point \((1, 4)\):

    $$xy' + 2xy = x^3$$

    Solution: The equation is not in the appropriate form. Divide both sides of the equation by \(x\):

    $$y' + 2y = x^2$$

    Now find \(M(x)\):

    $$M(x) = e^{\int{2dx}} = e^{2x}$$

    Multiply both sides of the equation by \(M(x)\):

    $$y'e^{2x} + 2ye^{2x} = x^2$$

    For the same reason as in Example 8, obviously the two factors of the derivative that we need are \(y\) and \(e^{2x}\):

    $$(ye^{2x})' = x^2$$

    Integrate:

    $$\int{(ye^{2x})'dx} = \int{x^2dx} \Rightarrow$$ $$ye^{2x} + C_1 = \frac{1}{3}x^3 + C_2$$

    Solve for \(y\):

    $$ye^{2x} = \frac{1}{3}x^3 + C \Rightarrow$$ $$y = \frac{1}{3}x^3e^{-2x} + Ce^{-2x}$$

    From now on always assume that \(C\) represents the difference of the two constants that are formed upon integration of the differential equation. Now we must consider the initial value \((1, 4)\). Plug these values in for \(x\) and \(y\) to solve for \(C\):

    $$4 = \frac{1}{3}(1)^3e^{-2(1)} + Ce^{-2(1)} \Rightarrow$$ $$4 = \frac{1}{3}(1)e^{-2} + Ce^{-2} \Rightarrow$$ $$4 - \frac{e^{-2}}{3} = Ce^{-2} \Rightarrow$$ $$4e^2 - \frac{1}{3} = C \Rightarrow$$ $$C = \frac{12e^2 - 1}{3}$$

    This means the solution to the differential equation is

    $$y = \frac{1}{3}x^3e^{-2x} + \frac{e^{-2x}(12e^2 - 1)}{3}$$

    Here is one more example.

    Example 10: Solve the differential equation

    $$(y' - 5x^4)^3 = 27x^6y^3$$

    Solution: It will take some work to get this differential equation into the appropriate form. Take the cube root of both sides of the equation:

    $$y' - 5x^4 = 3x^2y$$

    Now move the \(x\) term to the right side of the equation:

    $$y' = 3x^2y + 5x^4$$

    Finally, move the term with the \(y\) to the left side of the equation:

    $$y' - 3x^2y = 5x^4$$

    The equation is now in the appropriate form. Find \(M(x)\):

    $$M(x) = e^{\int{-3x^2dx}} = e^{-x^3}$$

    Multiply both sides of the equation by \(M(x)\):

    $$y'e^{-x^3} - 3x^2ye^{-x^3} = 5x^4e^{-x^3}$$

    Write the left side as the derivative of a product:

    $$(ye^{-x^3})' = 5x^4e^{-x^3}$$

    Integrate:

    $$\int{(ye^{-x^3})'dx} = \int{5x^4e^{-x^3}dx}$$

    The left side is easy to integrate due to the derivative in the integrand. However, the right side is not integrable without a computer (see http://www.wolframalpha.com/input/?i=Integrate+5x%5E4e%5E%7B-x%5E3%7D for the actual antiderivative, but the expression is far beyond what you would need to understand for a high-school class) Multiplying both sides of the equation by \(e^{x^3}\) isolates \(y\).

    Reference, courtesy of www.wolframalpha.com