Integrating Factor Method
Statement
The first-order linear ODE
is solved by choosing the integrating factor . Multiplying both sides gives
which integrates to
Worked example: . Here , so .
Integrating: , giving .
Visualization
Solution to with :
Integrating factor: . Then , integrating:
| 0.0 | 1.000 | 0.000 |
| 0.5 | 0.779 | 0.111 |
| 1.0 | 0.368 | 0.316 |
| 1.5 | 0.105 | 0.448 |
| 2.0 | 0.018 | 0.491 |
| 3.0 | 0.000 | 0.500 |
The solution rises from and saturates at as — controlled by the Gaussian decay in .
Proof Sketch
- Define . Then .
- Product rule. .
- Integrate. .
- Divide by . (Exponential is always positive.) This gives the explicit formula.
The key identity is the product rule from the Fundamental Theorem of CalculusFundamental Theorem of CalculusIntegration and differentiation are inverse operationsRead more → and the chain rule .
Connections
The integrating factor is the scalar instance of the matrix exponential in Linear ODE General SolutionLinear ODE General SolutionThe matrix exponential e^{At} gives the unique solution to y' = Ay with initial condition y(0) = y_0.Read more →; the product rule step mirrors the computation in Chain RuleChain RuleDifferentiate composite functions by peeling layersRead more →.
Lean4 Proof
import Mathlib.Analysis.SpecialFunctions.ExpDeriv
/-!
We verify the integrating factor identity for y' + y = eˣ.
The claim: y(x) = (1/2)*exp(x) + C*exp(-x) satisfies y' + y = exp(x).
We verify this by direct differentiation using `ring` after collecting
derivative facts.
-/
/-- For any constant C, y(x) = (1/2)*exp(x) + C*exp(-x)
satisfies y'(x) + y(x) = exp(x). -/
theorem integrating_factor_example (C : ℝ) :
let y : ℝ → ℝ := fun x => (1/2) * Real.exp x + C * Real.exp (-x)
let y' : ℝ → ℝ := fun x => (1/2) * Real.exp x - C * Real.exp (-x)
∀ x : ℝ, y' x + y x = Real.exp x := by
intro y y' x
simp only [y, y']
ring
/-- The derivative of y(x) = (1/2)*exp(x) + C*exp(-x) equals y'(x). -/
theorem integrating_factor_deriv (C : ℝ) (x : ℝ) :
HasDerivAt (fun x => (1/2 : ℝ) * Real.exp x + C * Real.exp (-x))
((1/2) * Real.exp x - C * Real.exp (-x)) x := by
have h1 := (Real.hasDerivAt_exp x).const_mul (1/2 : ℝ)
have h2 := ((Real.hasDerivAt_exp (-x)).comp x
(hasDerivAt_neg x)).const_mul C
simp only [neg_neg] at h2
convert h1.add h2 using 1
ring