Unit 2, lesson 10

Integrating Factors for Nonexact Equations

How a multiplier that depends on x alone or on y alone can make a nonexact equation exact, how the two quotient tests find it, and which domain restrictions decide where the new equation is equivalent.

  • Video 10
  • Exact Equations and Integrating Factors

The equation y dx+2x dy=0y\,dx + 2x\,dy = 0 is not exact, because My=1M_y = 1 while Nx=2N_x = 2. Multiplied by x−1/2x^{-1/2} on the half-plane x>0x > 0, it becomes exact, and the potential 2yx2y\sqrt{x} is then constant along every solution in that half-plane. This lesson shows when a multiplier that depends on only one variable exists, how to compute it from a quotient of partial derivatives, and how to recover the solutions that live where the multiplier is undefined or zero.

Key terms

Nonexact equation

Definition Let MM and NN be continuously differentiable on an open region RR of the xyxy-plane. The equation

M dx+N dy=0M\,dx + N\,dy = 0

is nonexact on RR if My≠NxM_y \ne N_x at some point of RR. Then no potential exists on any open set containing that point, because a potential FF with Fx=MF_x = M and Fy=NF_y = N would be twice continuously differentiable, and its equal mixed partial derivatives would force My=NxM_y = N_x there. An integrating factor on RR is a continuously differentiable function μ(x,y)\mu(x, y) with no zeros on RR such that

(μM)y=(μN)x(\mu M)_y = (\mu N)_x

at every point of RR. Since μ≠0\mu \ne 0, a direction (dx,dy)(dx, dy) satisfies μM dx+μN dy=0\mu M\,dx + \mu N\,dy = 0 exactly when it satisfies the original equation, so on RR the two equations have the same solution curves. In particular, a graph y=y(x)y = y(x) in RR, with y′=dy/dxy' = dy/dx, solves M+Ny′=0M + Ny' = 0 exactly when it solves μM+μNy′=0\mu M + \mu N y' = 0.

In plain words The left side of a nonexact equation is not the differential of any function. Multiplying both coefficients by the same nonzero function does not change which directions the equation allows, but it can turn the left side into the differential of a potential.

Example For y dx−x dy=0y\,dx - x\,dy = 0 we have My=1M_y = 1 and Nx=−1N_x = -1, so the equation is nonexact on every region. On the half-plane x>0x > 0 the factor μ=1/x2\mu = 1/x^2 gives

yx2 dx−1x dy=0,\frac{y}{x^2}\,dx - \frac{1}{x}\,dy = 0,

which is exact with potential F=−y/xF = -y/x, since Fx=y/x2F_x = y/x^2 and Fy=−1/xF_y = -1/x. Its level curves, and so the solution curves in this half-plane, are the half-lines y=kxy = kx with x>0x > 0. On the half-plane y>0y > 0 the factor 1/y21/y^2 works as well, with potential x/yx/y, so an integrating factor is not unique.

Integrating factor depending on x

Definition Let MM and NN be continuously differentiable on an open rectangle R=I×JR = I \times J, where II and JJ are open intervals, and suppose N≠0N \ne 0 on RR. A continuously differentiable function μ(x)\mu(x) with no zeros on II is an integrating factor on RR if and only if

μ′(x)μ(x)=My−NxN\frac{\mu'(x)}{\mu(x)} = \frac{M_y - N_x}{N}

at every point of RR. The reason is that (μM)y=μMy(\mu M)_y = \mu M_y, while the product rule gives (μN)x=μ′N+μNx(\mu N)_x = \mu' N + \mu N_x. Setting the two equal and dividing by μN\mu N gives the condition. So such a factor exists exactly when the quotient on the right depends on xx alone, say equals r(x)r(x). The function rr is then continuous on II, and one choice of factor is

μ(x)=e∫r(x) dx,\mu(x) = e^{\int r(x)\,dx},

with any antiderivative of rr in the exponent. Since a rectangle is simply connected, the multiplied equation then has a potential on all of RR.

In plain words Try a multiplier that depends on xx only. It works precisely when the quotient (My−Nx)/N(M_y - N_x)/N depends on xx only, and the multiplier is then the exponential of an antiderivative of that quotient.

Example For y dx+2x dy=0y\,dx + 2x\,dy = 0 on the half-plane x>0x > 0, the quotient is

My−NxN=1−22x=−12x.\frac{M_y - N_x}{N} = \frac{1 - 2}{2x} = -\frac{1}{2x}.

An antiderivative is −12ln⁡x-\tfrac{1}{2}\ln x, so μ=e−12ln⁡x=x−1/2\mu = e^{-\frac{1}{2}\ln x} = x^{-1/2}. The multiplied equation

yx dx+2x dy=0\frac{y}{\sqrt{x}}\,dx + 2\sqrt{x}\,dy = 0

has both cross derivatives equal to 1/x1/\sqrt{x}, and F=2yxF = 2y\sqrt{x} is a potential, because Fx=y/xF_x = y/\sqrt{x} and Fy=2xF_y = 2\sqrt{x}. The solutions satisfy 2yx=C2y\sqrt{x} = C. The level C=4C = 4 gives y=2/xy = 2/\sqrt{x}, and substituting y′=−x−3/2y' = -x^{-3/2} into the graph form y+2xy′=0y + 2xy' = 0 of the original equation gives 2x−1/2−2x−1/2=02x^{-1/2} - 2x^{-1/2} = 0.

Integrating factor depending on y

Definition Let MM and NN be continuously differentiable on an open rectangle R=I×JR = I \times J, and suppose M≠0M \ne 0 on RR. A continuously differentiable function μ(y)\mu(y) with no zeros on JJ is an integrating factor on RR if and only if

μ′(y)μ(y)=Nx−MyM\frac{\mu'(y)}{\mu(y)} = \frac{N_x - M_y}{M}

at every point of RR. This time the product rule acts on the other side, since (μM)y=μ′M+μMy(\mu M)_y = \mu' M + \mu M_y and (μN)x=μNx(\mu N)_x = \mu N_x. So such a factor exists exactly when the quotient depends on yy alone, say equals s(y)s(y), which is then continuous on JJ, and one choice is μ(y)=e∫s(y) dy\mu(y) = e^{\int s(y)\,dy}.

In plain words The test for a multiplier of yy alone mirrors the test for xx, but the difference in the numerator is reversed and the denominator is MM instead of NN. Mixing up the two versions is the most common slip.

Example For 2y dx+x dy=02y\,dx + x\,dy = 0 on the half-plane y>0y > 0, we have My=2M_y = 2 and Nx=1N_x = 1, so

Nx−MyM=1−22y=−12y,\frac{N_x - M_y}{M} = \frac{1 - 2}{2y} = -\frac{1}{2y},

and the factor is μ=y−1/2\mu = y^{-1/2}. The multiplied equation 2y dx+(x/y) dy=02\sqrt{y}\,dx + (x/\sqrt{y})\,dy = 0 is exact with potential F=2xyF = 2x\sqrt{y}, because Fx=2yF_x = 2\sqrt{y} and Fy=x/yF_y = x/\sqrt{y}. For x>0x > 0 the level 2xy=C2x\sqrt{y} = C with C>0C > 0 is the curve y=C2/(4x2)y = C^2/(4x^2), and indeed every y=k/x2y = k/x^2 satisfies 2y+xy′=02y + xy' = 0. In this equation the quotient for xx also depends on one variable, since (My−Nx)/N=1/x(M_y - N_x)/N = 1/x, so the factor xx works too, with potential x2yx^2 y.

Quotient tests

Definition For M dx+N dy=0M\,dx + N\,dy = 0 with MM and NN continuously differentiable on an open rectangle, the quotient tests look for an integrating factor of one variable in four steps.

  1. Compute My−NxM_y - N_x. If it is zero on the rectangle, the equation is already exact there.
  2. Where N≠0N \ne 0, check whether (My−Nx)/N(M_y - N_x)/N depends on xx alone. If it does, its exponentiated antiderivative is a factor μ(x)\mu(x).
  3. Where M≠0M \ne 0, check whether (Nx−My)/M(N_x - M_y)/M depends on yy alone. If it does, its exponentiated antiderivative is a factor μ(y)\mu(y).
  4. Check (μM)y=(μN)x(\mu M)_y = (\mu N)_x directly, construct a potential, and state the region where it is valid.

A failed test shows only that no factor of that one-variable kind exists on the region. Integrating factors that depend on both variables may still exist.

In plain words Compute the mismatch My−NxM_y - N_x once, divide it by NN and by −M-M, and look for a quotient that contains only one variable. The integrating factor is the exponential of an antiderivative of that quotient.

Example The linear equation y′+y=xy' + y = x, with y′=dy/dxy' = dy/dx, can be written as (y−x) dx+dy=0(y - x)\,dx + dy = 0. Here My−Nx=1M_y - N_x = 1, so the quotient for xx is the constant 11, while the quotient for yy is −1/(y−x)-1/(y - x), which depends on both variables. The first test gives μ=ex\mu = e^x, and

ex(y−x) dx+ex dy=0e^x(y - x)\,dx + e^x\,dy = 0

has the potential F=ex(y−x+1)F = e^x(y - x + 1). Setting F=CF = C gives y=x−1+Ce−xy = x - 1 + Ce^{-x} on the whole line. For every linear equation y′+p(x)y=q(x)y' + p(x)y = q(x) the quotient for xx is p(x)p(x), so the familiar factor e∫p(x) dxe^{\int p(x)\,dx} of a linear equation is a special case of this test.

Domain restrictions

Definition The multiplied equation μM dx+μN dy=0\mu M\,dx + \mu N\,dy = 0 has the same solution curves as the original only on a region where μ\mu is defined, finite and nonzero, and the quotient tests also assume N≠0N \ne 0 or M≠0M \ne 0 where they divide. Outside such a region two things can go wrong. Where μ\mu is undefined or infinite, solutions of the original equation that reach that set are not described by the potential and must be found from the original equation. Where μ=0\mu = 0, every direction satisfies the multiplied equation, so it gives no information about the slope there, and those points must also be checked in the original equation. A factor found under a division may satisfy (μM)y=(μN)x(\mu M)_y = (\mu N)_x on a larger set, but that has to be checked in the multiplied equation, not assumed.

In plain words Multiplying is safe only where the multiplier is a finite nonzero number. Wherever it blows up, vanishes or was found by dividing by zero, go back to the original equation and look for solutions there.

Example The equation y dx+2x dy=0y\,dx + 2x\,dy = 0 is defined on the whole plane, but the factor x−1/2x^{-1/2} exists only for x>0x > 0. The nonzero solutions y=C/(2x)y = C/(2\sqrt{x}) blow up as x→0+x \to 0^+. The zero function, however, satisfies y+2xy′=0y + 2xy' = 0 for every real xx, so y=0y = 0 is a solution on the whole line that crosses the excluded line x=0x = 0. On the half-plane x<0x < 0 the factor is (−x)−1/2(-x)^{-1/2}, the potential is −2y−x-2y\sqrt{-x}, and the solutions are y=k/−xy = k/\sqrt{-x}. Finally, the vertical line x=0x = 0 is a solution curve of the differential form, since along it dx=0dx = 0 and N=2x=0N = 2x = 0, although it is not the graph of a function of xx.

Check yourself

  1. Which quotient test applies to y dx+(y2−x) dy=0y\,dx + (y^2 - x)\,dy = 0? Find the integrating factor and a potential.
Show the answer

Here My=1M_y = 1 and Nx=−1N_x = -1, so the equation is not exact. The quotient for xx is 2/(y2−x)2/(y^2 - x), which depends on both variables, so there is no factor of xx alone. The quotient for yy is

Nx−MyM=−1−1y=−2y,\frac{N_x - M_y}{M} = \frac{-1 - 1}{y} = -\frac{2}{y},

so on either half-plane y>0y > 0 or y<0y < 0 the factor is μ=e−2ln⁡∣y∣=1/y2\mu = e^{-2\ln\lvert y \rvert} = 1/y^2. The multiplied equation has coefficients 1/y1/y and 1−x/y21 - x/y^2, whose cross derivatives both equal −1/y2-1/y^2. Integrating 1/y1/y in xx gives F=x/y+h(y)F = x/y + h(y), and Fy=−x/y2+h′(y)F_y = -x/y^2 + h'(y) must equal 1−x/y21 - x/y^2, so h(y)=yh(y) = y and

F=xy+y.F = \frac{x}{y} + y.

The solution curves are x/y+y=Cx/y + y = C, that is x=Cy−y2x = Cy - y^2 with y≠0y \ne 0. The line y=0y = 0, which the factor excludes, also solves the original equation, since along it M=0M = 0 and dy=0dy = 0.

  1. Solve (2y2+3x) dx+2xy dy=0(2y^2 + 3x)\,dx + 2xy\,dy = 0 with y(1)=1y(1) = 1, and give the maximal interval of the solution y(x)y(x).
Show the answer

The mismatch is My−Nx=4y−2y=2yM_y - N_x = 4y - 2y = 2y, and where xy≠0xy \ne 0

My−NxN=2y2xy=1x.\frac{M_y - N_x}{N} = \frac{2y}{2xy} = \frac{1}{x}.

On x>0x > 0 this gives μ=eln⁡x=x\mu = e^{\ln x} = x. In fact xx makes the equation exact on the whole plane, since the multiplied coefficients 2xy2+3x22xy^2 + 3x^2 and 2x2y2x^2y both have cross derivative 4xy4xy. A potential is F=x2y2+x3F = x^2y^2 + x^3, and F(1,1)=2F(1, 1) = 2, so the solution satisfies x2y2+x3=2x^2y^2 + x^3 = 2. Since y(1)=1>0y(1) = 1 > 0,

y=2−x3x.y = \frac{\sqrt{2 - x^3}}{x}.

This needs x≠0x \ne 0 and 2−x3>02 - x^3 > 0, so the maximal interval is (0,23)(0, \sqrt[3]{2}), where 23≈1.26\sqrt[3]{2} \approx 1.26. As x→0+x \to 0^+ the solution blows up. At x=23x = \sqrt[3]{2} it reaches y=0y = 0, where N=2xy=0N = 2xy = 0 and the level curve has a vertical tangent, so the graph cannot be continued.

  1. A classmate finds that neither quotient test works for (3y+4xy2) dx+(2x+3x2y) dy=0(3y + 4xy^2)\,dx + (2x + 3x^2y)\,dy = 0 and concludes that the equation has no integrating factor. Check that μ=x2y\mu = x^2y is an integrating factor in each open quadrant, and explain what the tests actually showed.
Show the answer

Here My−Nx=(3+8xy)−(2+6xy)=1+2xyM_y - N_x = (3 + 8xy) - (2 + 6xy) = 1 + 2xy, and the two quotients

My−NxN=1+2xyx(2+3xy),Nx−MyM=−1+2xyy(3+4xy)\begin{gathered} \frac{M_y - N_x}{N} = \frac{1 + 2xy}{x(2 + 3xy)}, \\[0.4em] \frac{N_x - M_y}{M} = -\frac{1 + 2xy}{y(3 + 4xy)} \end{gathered}

each depend on both variables. For example, the first equals 3/53/5 at (1,1)(1, 1) and 5/85/8 at (1,2)(1, 2). So there is no integrating factor of xx alone or of yy alone, and that is all the tests show. With μ=x2y\mu = x^2y the coefficients become 3x2y2+4x3y33x^2y^2 + 4x^3y^3 and 2x3y+3x4y22x^3y + 3x^4y^2, and both cross derivatives equal 6x2y+12x3y26x^2y + 12x^3y^2. A potential is F=x3y2+x4y3F = x^3y^2 + x^4y^3. The factor vanishes on the coordinate axes, so those lines must be checked in the original equation. Along x=0x = 0 we have dx=0dx = 0 and N=0N = 0, and along y=0y = 0 we have dy=0dy = 0 and M=0M = 0, so both axes are solution curves of the original equation as well.

How this lesson connects