Skip to content
Calculus I / Ordinary Differential Equations

Linear First-Order ODEs and the Integrating Factor

A linear first-order ODE has the form y′+P(x)y=Q(x)y' + P(x)y = Q(x) — the unknown function yy appears linearly (no y2y^2, no sin⁡y\sin y). This class includes many financially important equations that separable equations cannot handle: a portfolio that earns interest at rate rr but pays out a fixed coupon CC per year satisfies P′=rP−CP' = rP - C (not separable); the Ornstein-Uhlenbeck mean-reversion ODE dx/dt=a(b−x)dx/dt = a(b-x) rewrites as the linear form x′+ax=abx' + ax = ab. The solution method is the integrating factor μ(x)=e∫P(x) dx\mu(x) = e^{\int P(x)\,dx} — a function that collapses the left side into the derivative of a product and turns the equation into a straightforward integration.
Learning objectives. By the end of this note you should be able to:
  • recognise a first-order linear ODE and put it in standard form y′+P(x)y=Q(x)y' + P(x)y = Q(x);
  • compute the integrating factor μ(x)=e∫P dx\mu(x) = e^{\int P\,dx};
  • multiply through, recognise the product-rule pattern, and integrate to find the general solution;
  • apply an initial condition to pin the constant;
  • solve the portfolio-with-withdrawals and OU mean-reversion ODEs.

In this lesson

  1. Standard form and the integrating factor
  2. Worked examples
  3. The OU mean-reversion ODE

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or explore the curriculum.