The Integrating Factor

One factor turns the left side into a product rule.

An equation that will not separate

A first-order linear equation has the form dy/dx + P(x)y = Q(x), where P and Q are functions of x alone. An example is dy/dx + 2y/x = x.

Separating the variables needs every y on one side with dy and every x on the other with dx. Here dy/dx = x − 2y/x, and the right side is a difference, not a product of a function of x and a function of y. The y and the x will not come apart, so another method is needed.

Make the left side one derivative

The left side looks almost like the product rule. For a function I of x, the product rule gives d/dx (I y) = I dy/dx + I' y.

Multiply the equation through by I and its left side becomes I dy/dx + I P y. That is exactly d/dx (I y) when the second terms agree, that is when I' = I P.

Finding the factor

The condition I' = I P is itself a separable equation. Divide by I to get I'/I = P, and integrate both sides: ln I = ∫P dx. So I = e^(∫P dx). This I is called the integrating factor.

No constant is needed in ∫P dx. Adding a constant k multiplies I by eᵏ, and multiplying the whole equation by a constant does not change its solutions, so the simplest choice will do.

Multiply through and integrate

Multiply every term by I: I dy/dx + I P y = I Q. The left side is now the single derivative d/dx (I y), so the equation reads d/dx (I y) = I Q.

Integrate both sides: I y = ∫ I Q dx + c. Then divide by I to find y. There is one constant, and it arrives when the right side is integrated, before the division.

The equation must be in this form first, with dy/dx standing alone. For x dy/dx + 2y = x², divide every term by x to get dy/dx + 2y/x = x, and only then read off P = 2/x.

An example

Solve dy/dx + 2y/x = x for x > 0. Here P = 2/x, so ∫P dx = 2 ln x, and the integrating factor is I = e^(2 ln x) = e^(ln x²) = x².

Multiply through by x²: x² dy/dx + 2xy = x³. The left side is d/dx (x²y), so x²y = ∫x³ dx = x⁴/4 + c, and dividing by x² gives y = x²/4 + c/x².

Check it. With y = x²/4 + c/x², dy/dx = x/2 − 2c/x³ and 2y/x = x/2 + 2c/x³. Adding them, the c terms cancel and the sum is x, as the equation says.

A known value fixes c. If y = 1 when x = 1, then 1 = 1/4 + c, so c = 3/4 and y = x²/4 + 3/4x². At x = 2 this gives y = 1 + 3/16 = 1.1875.

xy

Three solutions of dy/dx + 2y/x = x. The gold curve is y = x²/4 + 3/4x², the one through (1, 1). The dashed curves have c = 0, which is y = x²/4, and c = −1. Each value of c gives a different curve, and all of them come close to y = x²/4 as x grows, because c/x² shrinks.

A second example: the factor eˣ

Solve dy/dx + y = x. Here P = 1, so ∫P dx = x and the integrating factor is eˣ.

Multiply through: eˣ dy/dx + eˣy = x eˣ, and the left side is d/dx (eˣy). Integrating x eˣ by parts gives x eˣ − eˣ + c, so eˣy = x eˣ − eˣ + c. Divide by eˣ: y = x − 1 + c e^(−x).

If y = 1 when x = 0, then 1 = −1 + c, so c = 2 and y = x − 1 + 2e^(−x). Check at x = 1: y = 2e^(−1), about 0.736, and dy/dx = 1 − 2e^(−1), about 0.264. Their sum is 1, which is x.

As x grows, c e^(−x) shrinks toward 0 whatever c is, so every solution comes closer and closer to the line y = x − 1.

xy(0, 0)dy/dx = 0−3−3−2−2−1−1112233

every dash has gradient x − y, and the curve through the probe is tangent to each dash it crosses: one equation, a whole family of solutions

Put the probe on (0, 1) and read the solution it selects

The equation dy/dx + y = x, rearranged as dy/dx = x − y: each dash has gradient x − y at its point. The gold curve is the solution through the probe, at (0, 0) the curve y = x − 1 + e^(−x). Drag the probe to (0, 1) and it picks y = x − 1 + 2e^(−x), which starts with gradient −1 and runs alongside the line y = x − 1. Each position of the probe sets the constant c and picks one curve of the family.

The usual mistakes

Building the factor from Q. The integrating factor is e^(∫P dx), made from the coefficient of y. Q only appears on the right after the multiplication.

Leaving out the exponential. ∫P dx on its own does not make the left side a product rule; e^(∫P dx) does.

Multiplying only the left side by I. Every term is multiplied, so the right side becomes I Q.

Adding the constant after dividing by I. For the first example that gives y = x²/4 + c, and then dy/dx + 2y/x = x + 2c/x, which is not x unless c = 0. The constant is added at the integration, so it is divided by x² as well.

A hospital’s technetium generator

In the application below, the number of technetium atoms y satisfies a linear equation of this form, with the time h in hours in place of x. P is the constant b, the technetium’s decay constant, and Q is a N e^(−a h), the rate at which it is made. The model method tries a multiple of e^(−a h) for y.

The integrating factor reaches the same answer. Here I = e^(b h), and multiplying through makes the left side the derivative of y e^(b h), so y e^(b h) = K e^((b − a)h) + C, where K = a N/(b − a). Dividing by e^(b h) gives y = K e^(−a h) + C e^(−b h), the model method’s solution.

Worked example: A Hospital's Technetium Generator: The Technetium Building Up From Decaying Molybdenum, and When to Draw It Off

Question A hospital's generator holds molybdenum-99, which decays with a half-life of 66 hours into technetium-99m, which itself decays with a half-life of 6 hours. Assume that every molybdenum atom that decays becomes a technetium-99m atom. Just after the technetium is drawn off, the generator holds N molybdenum atoms and no technetium. Let x and y be the numbers of molybdenum and technetium atoms h hours later, and let a = ln 266 and b = ln 26 be the two decay constants, per hour. (a) Write down the differential equations for x and y, and solve them. (b) The technetium is next drawn off when there is most of it. How many hours after the last draw is that, and how do the activities of the two isotopes, ax and by decays per hour, compare at that moment?

  1. 1.Each isotope decays at its decay constant times the number of its atoms. The molybdenum only decays, so dxdh = −ax. The technetium gains one atom for each molybdenum atom that decays and loses its own atoms as they decay, so dydh = ax − by.

    501000244872hoursactivity, %x' = −ax, y' = ax − by
    501000244872hoursactivity, %x' = −ax, y' = ax − by
    The molybdenum only decays; the technetium is made as the molybdenum decays and decays itself.
  2. 2.The first equation involves x alone, and with x = N at the start its solution is x = Ne−ah.

    501000244872hoursactivity, %molybdenumx' = −ax, y' = ax − byx = Ne−ah
    501000244872hoursactivity, %molybdenumx' = −ax, y' = ax − byx = Ne−ah
    The first equation involves x alone: x = Ne−ah. The curve is its activity, ax, as a percentage of aN.
  3. 3.Substituting gives dydh + by = aNe−ah. Try y = Ke−ah: then −aK + bK = aN, so K = aNb − a. Since b − a = ln 2(16 − 166) = 10ln 266, this is K = N10. Adding Ce−bh, the solution with right side zero, and using y = 0 at the start gives C = −N10.

    501000244872hoursactivity, %molybdenumx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10
    501000244872hoursactivity, %molybdenumx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10
    A multiple of e−ah fits the technetium equation when K = aNb − a = N10.
  4. 4.(a) So x = Ne−ah and y = N10(e−ah − e−bh). This is zero at the start and positive afterward, because b > a makes e−bh the smaller of the two exponentials.

    501000244872hoursactivity, %molybdenumtechnetiumx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)
    501000244872hoursactivity, %molybdenumtechnetiumx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)
    (a) y = N10(e−ah − e−bh) starts at zero; its activity, by, is the second curve.
  5. 5.(b) The technetium is greatest where dydh = N10(−ae−ah + be−bh) = 0, that is where e(b − a)h = ba = 11. So h = ln 11b − a = 6.6ln 11ln 2 ≈ 22.8 hours.

    501000244872hoursactivity, %molybdenumtechnetium22.8x' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)(b) e(b − a)h= 11, so h = 22.8 hours
    501000244872hoursactivity, %molybdenumtechnetium22.8x' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)(b) e(b − a)h= 11, so h = 22.8 hours
    (b) The technetium is greatest where e(b − a)h = 11, at h = 6.6ln 11ln 2 ≈ 22.8 hours.
  6. 6.At that moment dydh = ax − by = 0, so ax = by: the two activities are equal. Check: e−ah = 2−22.83/66 ≈ 0.7866 and e−bh = 2−22.83/6 ≈ 0.0715, so y ≈ N10(0.7866 − 0.0715) ≈ 0.0715N. Then ax ≈ 0.01050 × 0.7866N ≈ 0.00826N and by ≈ 0.1155 × 0.0715N ≈ 0.00826N decays per hour, equal. Hospitals draw the technetium off about once a day, close to this time.

    501000244872hoursactivity, %molybdenumtechnetium22.8equalx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)(b) e(b − a)h= 11, so h = 22.8 hoursthen ax = by: the activities are equal
    501000244872hoursactivity, %molybdenumtechnetium22.8equalx' = −ax, y' = ax − byx = Ne−ahtry y = Ke−ah: K = aN/(b − a) = N/10(a) y = (N/10)(e−ah− e−bh)(b) e(b − a)h= 11, so h = 22.8 hoursthen ax = by: the activities are equal
    There dydh = ax − by = 0, so the two activity curves cross exactly at the peak.

Answer: (a) dxdh = −ax and dydh = ax − by, with x = Ne−ah and y = N10(e−ah − e−bh); (b) after 6.6ln 11ln 2 ≈ 22.8 hours, when the two activities are equal

Common mistakes

  • Writing the technetium's equation as dydh = −by, as if it only decayed. The technetium is also being made, one atom for each molybdenum atom that decays, and without that term a generator that starts with no technetium would never hold any.
  • Solving ae−ah = be−bh by setting the exponents equal, −ah = −bh, which gives h = 0. The two sides also differ in their constants: taking logarithms gives ln a − ah = ln b − bh, so (b − a)h = lnba, and ba = 666 = 11.

More coupled differential equations problems, worked step by step →

Practice The Integrating Factor in the app