First Year Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Exact differential equations and integrating factors

Exact differential equations (M dx + N dy = 0), tests for exactness, potential function ψ(x,y), and standard integrating factors to make non-exact equations exact.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Engineers often model steady-state systems (heat flow, electrostatics, fluid potential, chemical equilibrium) with relations that come from a potential function. Exact differential equations help you recover that potential directly. When the equation is not exact, integrating factors give a systematic way to convert it into an exact one so it can be solved reliably.

Key ideas

  • Test for exactness (necessary and sufficient condition): If M, N have continuous first partial derivatives on a simply connected domain D, then M dx + N dy = 0 is exact in D if and only if ∂M/∂y = ∂N/∂x everywhere in D. Assumptions: M, N ∈ C¹(D) and D simply connected (no holes). Statement universities expect: “In a simply connected domain where M and N have continuous first partial derivatives, M dx + N dy = 0 is exact if and only if ∂M/∂y = ∂N/∂x.”

  • Derivation of the test (sketch universities ask):

    1. If exact, M = ∂ψ/∂x, N = ∂ψ/∂y. Then ∂M/∂y = ∂²ψ/∂y∂x = ∂²ψ/∂x∂y = ∂N/∂x by equality of mixed partials (Clairaut’s theorem) since ψ ∈ C² (sufficient if M, N ∈ C¹).
    2. Conversely, if ∂M/∂y = ∂N/∂x on a simply connected domain, define ψ(x,y) = ∫(from x₀ to x) M(s, y) ds + ∫(from y₀ to y) N(x₀, t) dt; then ∂ψ/∂x = M and, using ∂M/∂y = ∂N/∂x, ∂ψ/∂y = N. Alternatively, use path integrals; simple connectivity ensures path independence.
  • How to solve an exact DE:

    1. Check ∂M/∂y = ∂N/∂x to confirm exactness.
    2. Find ψ(x,y) such that ∂ψ/∂x = M and ∂ψ/∂y = N.
      • Integrate M w.r.t. x keeping y constant: ψ(x,y) = ∫ M(x,y) dx + h(y).
      • Differentiate this ψ w.r.t. y: ∂ψ/∂y = ∂/∂y[∫ M dx] + h′(y).
      • Match with N(x,y) to find h′(y), integrate to get h(y).
    3. Write the solution as ψ(x,y) = C.
  • Integrating factor (definition): A nonzero function μ(x,y) such that μ M dx + μ N dy = 0 is exact. We then solve the exact equation.

  • Standard tests to find integrating factors (commonly examined patterns):

    1. Function of x alone: If (1/N)(∂M/∂y − ∂N/∂x) = f(x) depends only on x, then an integrating factor is μ(x) = exp(∫ f(x) dx).
      • Derivation idea: Require exactness of μ M dx + μ N dy = 0, with μ = μ(x). Condition reduces to μ′(x)/μ(x) = [∂M/∂y − ∂N/∂x]/N = f(x).
    2. Function of y alone: If (1/M)(∂N/∂x − ∂M/∂y) = g(y) depends only on y, then μ(y) = exp(∫ g(y) dy) is an integrating factor.
    3. Homogeneous case (very common): If M(x,y) and N(x,y) are homogeneous functions of the same degree n (i.e., M(tx,ty) = tⁿ M(x,y) and N(tx,ty) = tⁿ N(x,y)), then an integrating factor is μ(x,y) = 1/(x M + y N). Assumptions: x M + y N ≠ 0 in the domain.
      • Derivation (sketch you can quote): Using Euler’s theorem for homogeneous functions, one checks directly that ∂/∂y [ M/(x M + y N) ] = ∂/∂x [ N/(x M + y N) ]; hence μ = 1/(x M + y N) is an integrating factor (up to a nonzero constant). Practical use: Multiply the DE by 1/(x M + y N) and then check exactness; it will be exact for this class.
    4. Linear differential equation in disguise: If you can rewrite in the form dy/dx + P(x) y = Q(x) or dx/dy + P(y) x = Q(y), then use integrating factor for linear equations (from the Linear and Bernoulli’s differential equations topic): IF = exp(∫ P(x) dx) or exp(∫ P(y) dy) respectively.
  • Geometric interpretation (helps memory):

    • For exact equations, the vector field F = (M, N) is a gradient field: F = ∇ψ. Solutions ψ = C are level curves (equipotential lines). The condition ∂M/∂y = ∂N/∂x is the 2D curl being zero.
  • What to draw if asked: Sketch axes with a few smooth closed or open curves labelled ψ = C₁, C₂, … representing level curves. Draw short arrows of the vector field F = (M, N) perpendicular to the level curves (since gradient is normal to level curves). Label x-axis, y-axis, and one point (x₀, y₀) on a level curve.

Formulas

  • Solution form for exact DE: ψ(x,y) = C — ψ is potential function with ∂ψ/∂x = M, ∂ψ/∂y = N; units of ψ are those of line integral of (M, N).
  • Integrating factor (x-only): μ(x) = exp(∫ [(∂M/∂y − ∂N/∂x)/N] dx) — when the bracket is a function of x alone and N ≠ 0.
  • Integrating factor (y-only): μ(y) = exp(∫ [(∂N/∂x − ∂M/∂y)/M] dy) — when the bracket is a function of y alone and M ≠ 0.
  • Homogeneous integrating factor: μ(x,y) = 1/(x M + y N) — when M, N are homogeneous of same degree and x M + y N ≠ 0.
  • Linear IF (in x): IF = exp(∫ P(x) dx) — for dy/dx + P(x) y = Q(x) (from Linear and Bernoulli’s differential equations topic).

Worked examples

Example 1: Solve an exact differential equation. Given: M = 2x y + 3, N = x² + 4y. Solve M dx + N dy = 0.

Steps:

  1. Check exactness: ∂M/∂y = 2x, ∂N/∂x = 2x ⇒ Equal ⇒ Exact.
  2. Find potential ψ.
    • Integrate M w.r.t. x: ψ(x,y) = ∫ (2x y + 3) dx = x² y + 3x + h(y).
    • Differentiate w.r.t. y: ∂ψ/∂y = x² + h′(y).
    • Match with N: x² + h′(y) = x² + 4y ⇒ h′(y) = 4y ⇒ h(y) = 2y² + C₀ (absorb constant later).
  3. Write solution: ψ(x,y) = x² y + 3x + 2y² = C.

Final answer: x² y + 3x + 2y² = C.

Example 2: Not exact; integrating factor depends on x only. Solve (y + 2x) dx + (x + x²) dy = 0.

Steps:

  1. Identify M = y + 2x, N = x + x².
  2. Check exactness: ∂M/∂y = 1, ∂N/∂x = 1 + 2x ⇒ Not exact.
  3. Try x-only integrating factor: Compute (1/N)(∂M/∂y − ∂N/∂x) = (1/(x + x²)) (1 − (1 + 2x)) = (1/(x + x²)) (−2x) = −2/(1 + x) which is a function of x alone.
  4. Integrating factor: μ(x) = exp(∫ −2/(1 + x) dx) = exp(−2 ln|1 + x|) = 1/(1 + x)² (take positive branch; domain where 1 + x > 0 if needed).
  5. Multiply equation by μ: [(y + 2x)/(1 + x)²] dx + [(x + x²)/(1 + x)²] dy = 0.
  6. Now verify exactness of the new M̃, Ñ:
    • M̃ = (y + 2x)/(1 + x)², Ñ = (x + x²)/(1 + x)² = x/(1 + x).
    • ∂M̃/∂y = 1/(1 + x)², ∂Ñ/∂x = derivative of x/(1 + x) = (1 + x − x)/(1 + x)² = 1/(1 + x)² ⇒ Exact.
  7. Find potential ψ.
    • Integrate M̃ w.r.t. x: ψ = ∫ [(y + 2x)/(1 + x)²] dx = y ∫ (1 + x)⁻² dx + 2 ∫ x (1 + x)⁻² dx. • First integral: ∫ (1 + x)⁻² dx = −(1 + x)⁻¹ + C. • Second: Let u = 1 + x. Then x = u − 1, ∫ 2x u⁻² dx = ∫ 2(u − 1) u⁻² du = ∫ (2u⁻¹ − 2u⁻²) du = 2 ln u + 2 u⁻¹ + C. So, ψ = y [−1/(1 + x)] + [2 ln(1 + x) + 2/(1 + x)] + h(y).
    • Differentiate w.r.t. y: ∂ψ/∂y = −1/(1 + x) + h′(y).
    • Match with Ñ = x/(1 + x) ⇒ −1/(1 + x) + h′(y) = x/(1 + x) ⇒ h′(y) = (x + 1)/(1 + x) = 1 ⇒ h(y) = y + C₀.
  8. Potential function: ψ = − y/(1 + x) + 2 ln(1 + x) + 2/(1 + x) + y (drop additive constants).
  9. Solution: − y/(1 + x) + 2 ln(1 + x) + 2/(1 + x) + y = C. Optionally simplify by combining terms, but this is acceptable.

Final answer: − y/(1 + x) + 2 ln(1 + x) + 2/(1 + x) + y = C.

Example 3: Homogeneous M and N; use μ = 1/(xM + yN). Solve (x² + xy) dx + (xy + y²) dy = 0.

Observation: M = x² + xy, N = xy + y². Both are homogeneous of degree 2.

Steps:

  1. Check exactness: ∂M/∂y = x, ∂N/∂x = y ⇒ Not exact unless x = y identically, so generally not exact.
  2. Use homogeneous integrating factor: μ = 1/(x M + y N). Compute denominator:
    • x M + y N = x(x² + xy) + y(xy + y²) = x³ + x² y + x y² + y³ = (x + y)(x² + y²). So μ = 1/[(x + y)(x² + y²)] where this is nonzero.
  3. Multiply: New equation M̃ dx + Ñ dy = 0 with M̃ = M μ = (x² + xy)/[(x + y)(x² + y²)], Ñ = N μ = (xy + y²)/[(x + y)(x² + y²)].
  4. Verify exactness (sketch): Since the theorem guarantees exactness for homogeneous M, N, proceed to integrate.
  5. Find potential ψ.
    • A good trick: Because of symmetry, guess ψ = F(x/y) or F(y/x). Alternatively, proceed directly:
    • Integrate M̃ w.r.t. x at fixed y. Simplify M̃ by factoring: (x² + xy) = x(x + y). Then M̃ = x(x + y)/[(x + y)(x² + y²)] = x/(x² + y²).
    • Similarly Ñ = (xy + y²)/[(x + y)(x² + y²)] = y/(x² + y²). Now it is straightforward.
    • Integrate M̃ w.r.t. x: ψ = ∫ x/(x² + y²) dx = (1/2) ln(x² + y²) + h(y).
    • Differentiate w.r.t. y: ∂ψ/∂y = (1/2) * (2y)/(x² + y²) + h′(y) = y/(x² + y²) + h′(y).
    • Match with Ñ = y/(x² + y²) ⇒ h′(y) = 0 ⇒ h(y) = const.
  6. Solution: (1/2) ln(x² + y²) = C or equivalently ln(x² + y²) = C₁ or x² + y² = C₂ (absorb constants).

Final answer: x² + y² = C (with C > 0; the logarithm step excludes (x,y) = (0,0)).

Common mistakes

  • Mixing up the exactness test: writing ∂M/∂x = ∂N/∂y instead of ∂M/∂y = ∂N/∂x.
  • For integrating factor tests, not checking whether (∂M/∂y − ∂N/∂x)/N depends only on x (or the y-only analogue) before applying the formula; leads to incorrect μ.
  • Algebraic slips in partial derivatives, especially when M, N are products or quotients.
  • In homogeneous-IF problems, forgetting to simplify M̃, Ñ after multiplying by μ = 1/(xM + yN); this often cancels factors and makes integration easy.
  • Ignoring domain restrictions (e.g., division by 1 + x or by x² + y²), which matter for logarithms and for defining μ.

For your exam

  • Short derivations: prove the exactness test; derive integrating factor when μ depends on x only or y only.
  • Procedural problems: check exactness and solve by finding ψ; when not exact, identify and apply a suitable integrating factor (x-only, y-only, or homogeneous case).
  • Conceptual: explain geometric meaning; describe the diagram of level curves and gradient field.
  • What full-marks answers include:
    • Clear statement of conditions (continuity, simply connected domain) when using the exactness test.
    • Neat, step-by-step calculation: compute ∂M/∂y and ∂N/∂x, show equality or not; if not, show the chosen IF test explicitly.
    • When building ψ: show the integral of M w.r.t. x, include h(y), differentiate and match with N to find h(y); or the symmetric approach starting from N.
    • Final solution stated as ψ(x,y) = C (or simplified equivalent), with domains when logarithms appear.
    • If using a standard result (e.g., homogeneous IF), state the criterion before applying it.

Quick check

  1. State the condition for M dx + N dy = 0 to be exact.
  2. If (1/N)(∂M/∂y − ∂N/∂x) is a function of x only, what integrating factor do you use?
  3. For homogeneous M, N of the same degree, what is a standard integrating factor?

Answers: 1) ∂M/∂y = ∂N/∂x on a simply connected domain with continuous partials. 2) μ(x) = exp(∫ [(∂M/∂y − ∂N/∂x)/N] dx). 3) μ(x,y) = 1/(x M + y N) where x M + y N ≠ 0.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?