How to Solve a First-Order ODE with an Integrating Factor
At a glance
- 1. Put it in standard form
Rewrite the equation as y' + P(x)y = Q(x).
- 2. Find the factor
Compute μ(x) = exp(∫P(x) dx) on an interval where P is continuous.
- 3. Multiply and integrate
Multiply through by μ so the left side becomes the derivative of μy, then integrate.
- 4. Solve for y
Divide by μ to obtain the general solution; use an initial condition to determine its constant.
The phrase “integrating factor method” most commonly means the method for solving a first-order linear ordinary differential equation. The equation must first be written in a particular standard form; then a carefully chosen multiplier turns its left side into a product derivative. This article derives the method, works through an example, and notes what to do when an equation does not fit this form.
The standard form
Write the equation as
where is the unknown function of , and and are known functions. Assume they are continuous on the interval where you want the solution. The method also works when the unknown is named something other than .
The integrating factor is
In computing the factor, the constant of integration can be omitted: multiplying an integrating factor by any nonzero constant gives an equivalent method. The exponential form ensures that never vanishes.
Why the method works
Multiply the standard equation by :
Since , the product rule gives
Thus the equation becomes
Now integrate with respect to and isolate :
This is the general solution on the interval. The integral need not have an elementary antiderivative; in that case it can still be written as a definite integral or left in integral form.
Step-by-step procedure
- Rearrange the equation into . If the coefficient of is not 1, divide the whole equation by it first.
- Identify as the coefficient of after that division.
- Calculate .
- Multiply every term in the equation by and verify that the left side is .
- Integrate, include an arbitrary constant, and solve for .
- If an initial condition is given, substitute it into the general solution to find the constant.
Worked example
Solve
Here and . The integrating factor is
Multiply the equation by :
The left side is , so
Integrating both sides gives
Therefore the general solution is
For example, if , then , so and the particular solution is . As a check, differentiating the general solution gives ; adding leaves , as required.
Common mistakes
- Using the wrong coefficient in the factor. The exponent uses , the coefficient of only after the coefficient of has been normalized to 1.
- Forgetting to multiply the entire equation. Every term, including the right side, must be multiplied by .
- Treating the left side as a product derivative without checking. The identity works because . If the selected factor does not satisfy this, the product-rule step is invalid.
- Dropping the constant of integration. The is needed for the general solution. Leaving it out gives at most one particular solution.
- Applying the method directly to a nonlinear equation. An equation such as is not linear in . It may be solvable by another method, but the standard integrating-factor formula does not apply as written.
If your equation looks different
An equation fits the method wherever : divide by first, so and . If the equation is written as , it may instead be an exact-equation problem, where “integrating factor” can mean a factor chosen to make the differential form exact. That is a related but different method, and there is no single formula for every differential equation.
References
- Elementary Differential Equations and Boundary Value Problems — William E. Boyce, Richard C. DiPrima, and Douglas B. Meade
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.