Independent study guide

Integrating Factors for First-Order Linear ODEs

See why an integrating factor works, normalize a linear ODE, apply an initial condition and keep the correct interval. One worked example, a graph and three explained questions.

Nablio · 18 minPublished

Return to Seneca Polytechnic AMT453 course guide. Tutoring coverage for this course must be confirmed before booking and payment.

Stuck on a step? Text us Email us Request a lesson

An integrating factor lets you rewrite a first-order linear ordinary differential equation (ODE) as the derivative of one product. That gives you something you can integrate. The important decisions come before the integration: make the coefficient of the derivative equal to one, identify the interval, and check the product rule.

Before you start: you should be comfortable with the product rule, exponential and logarithm rules, and basic antiderivatives. The examples below use dimensionless real variables. This original practice supports first-order ODE study in Concordia ENGR 213 and McGill MATH 263; use your current outline to choose the material you need.

For course topics and individual help, see Concordia ENGR 213 tutoring or McGill MATH 263 tutoring.

1. Recognize and normalize the equation

Let xx be the independent variable, y=y(x)y=y(x) the unknown function, and y′=dy/dxy^{\prime}=dy/dx its derivative. A first-order equation contains no derivatives higher than y′y^{\prime}. It is linear in yy if it can be written

a(x)y′+b(x)y=c(x),a(x)y^{\prime}+b(x)y=c(x),

where aa, bb and cc are known functions of xx. The unknown function and its derivative appear only to the first power and are not multiplied together. For example, y′+xy=x2y^{\prime}+xy=x^2 is linear even though its coefficients depend on xx; y′+y2=xy^{\prime}+y^2=x is nonlinear.

On an interval where a(x)≠0a(x)\ne0, divide every term by a(x)a(x):

y′+p(x)y=q(x),p=ba,q=ca.\begin{gathered} y^{\prime}+p(x)y=q(x),\\ p=\frac{b}{a},\quad q=\frac{c}{a}. \end{gathered}

This is the standard form. Choose an open interval II containing the initial input x0x_0 on which pp and qq are continuous. An initial condition y(x0)=y0y(x_0)=y_0 specifies the value the solution must have at that input. Under these conditions there is one solution for that initial value throughout II.

Quick normalization check. For 2y′+4y=e−x2y^{\prime}+4y=e^{-x}, the coefficient needed by the integrating-factor formula is p(x)=2p(x)=2, and the right-hand side is q(x)=e−x/2q(x)=e^{-x}/2. Reading p=4p=4 directly from the original equation skips the division.

2. Build the integrating factor from the product rule

We want a nonzero function μ(x)\mu(x), pronounced “mu”, such that multiplying the standard equation by μ\mu gives a product derivative. Compare

μy′+μpy=μq\mu y^{\prime}+\mu p y=\mu q

with the product rule

(μy)′=μy′+μ′y.(\mu y)^{\prime}=\mu y^{\prime}+\mu^{\prime}y.

The two left-hand sides match when μ′=pμ\mu^{\prime}=p\mu. If P(x)P(x) is any antiderivative of p(x)p(x), then

μ(x)=eP(x)=e∫p(x) dx\mu(x)=e^{P(x)}=e^{\int p(x)\,dx}

works: the chain rule gives μ′=P′eP=pμ\mu^{\prime}=P^{\prime}e^P=p\mu. Here ee is the base of the natural exponential. The exponential is positive, so dividing by μ\mu later is allowed.

You may choose the simplest antiderivative PP. Adding a constant to PP only multiplies μ\mu by a nonzero constant, which does not change the resulting solution family. Any nonzero constant multiple of an integrating factor also works on the same interval.

Now integrate:

(μy)′=μq,μy=∫μ(x)q(x) dx+C,y=∫μ(x)q(x) dx+Cμ(x).\begin{aligned}(\mu y)^{\prime}&=\mu q,\\ \mu y&=\int \mu(x)q(x)\,dx+C,\\ y&=\frac{\int \mu(x)q(x)\,dx+C}{\mu(x)}.\end{aligned}

The displayed integral stands for one antiderivative; CC is the arbitrary real integration constant. Keep that constant until the initial condition determines it. In particular, ∫p(x)y(x) dx\int p(x)y(x)\,dx is generally not y(x)∫p(x) dxy(x)\int p(x)\,dx: yy varies with xx. The product rule is what makes the integration possible.

3. Solve a variable-coefficient initial-value problem

Find y(x)y(x) for

xy′+2y=x2,y(1)=1,x>0.\begin{gathered}xy^{\prime}+2y=x^2,\\ y(1)=1,\qquad x>0.\end{gathered}

Normalize and keep the interval

Divide by xx, which is positive in this problem:

y′+2xy=x.y^{\prime}+\frac{2}{x}y=x.

Thus p(x)=2/xp(x)=2/x, q(x)=xq(x)=x, and the interval is (0,∞)(0,\infty). It contains the initial input 11 and avoids division by zero.

Choose the factor and test the product

Since x>0x>0, ∫2/x dx=2ln⁡x\int 2/x\,dx=2\ln x, where ln⁡\ln is the natural logarithm. Choose

μ=e2ln⁡x=x2.\mu=e^{2\ln x}=x^2.

Multiplying the normalized equation by x2x^2 gives

x2y′+2xy=x3.x^2y^{\prime}+2xy=x^3.

The left side is (x2y)′(x^2y)^{\prime}, because the product rule gives x2y′+2xyx^2y^{\prime}+2xy. Writing out this one check prevents a sign or coefficient error from spreading.

Integrate, then apply the initial condition

x2y=x44+C,y=x24+Cx2.\begin{aligned}x^2y&=\frac{x^4}{4}+C,\\ y&=\frac{x^2}{4}+\frac{C}{x^2}.\end{aligned}

At x=1x=1, the condition is 1=1/4+C1=1/4+C, so C=3/4C=3/4. The solution is

y(x)=x24+34x2,x>0.y(x)=\frac{x^2}{4}+\frac{3}{4x^2},\qquad x>0.

Check the equation and the condition separately

Differentiate: y′=x/2−3/(2x3)y^{\prime}=x/2-3/(2x^3). Substitute into the original equation:

xy′+2y=x22−32x2+x22+32x2=x2.\begin{aligned}xy^{\prime}+2y&=\frac{x^2}{2}-\frac{3}{2x^2}\\ &\quad+\frac{x^2}{2}+\frac{3}{2x^2}\\ &=x^2.\end{aligned}

Also, y(1)=1/4+3/4=1y(1)=1/4+3/4=1. Both tests pass. A function can satisfy the differential equation but fail the initial condition; checking just one is not enough.

4. Read the family of solution curves

Before imposing y(1)=1y(1)=1, every function y=x2/4+C/x2y=x^2/4+C/x^2 solves the equation on x>0x>0. Changing CC changes the curve. At x=1x=1, the family has value 1/4+C1/4+C, so exactly the member with C=3/4C=3/4 passes through (1,1)(1,1).

Three solution curves on positive x have C equal to one quarter, three quarters and five quarters. The solid curve with C equal to three quarters passes through (1,1). The two dashed curves pass below and above that point. The horizontal axis begins at zero, which is excluded from the solution interval.
The solid curve is selected by y(1)=1y(1)=1. Only part of each curve is shown; the graph does not extend the solution through x=0x=0.

The equation itself gives the slope at the initial point: y′=x−2y/x=1−2=−1y^{\prime}=x-2y/x=1-2=-1. The selected curve therefore decreases just to the right of x=1x=1, as the graph shows. A positive value of yy does not require a positive derivative.

The formula becomes unbounded as x→0+x\to0^+, because 3/(4x2)→+∞3/(4x^2)\to+\infty. This particular solution cannot extend continuously through zero. More generally, a zero of the original leading coefficient requires a fresh analysis; the normalized method alone does not decide whether a special solution can cross it.

5. Try three questions with explained answers

For each question, state the standard form and interval before integrating. Try the calculation before opening the answer.

Guided practice: a constant target

Solve y′+2y=6y^{\prime}+2y=6, with y(0)=1y(0)=1. Identify pp, find μ\mu, and write the product derivative. For x≥0x\ge0, does the solution approach 33 from above or below?

Show answer and reasoning
  1. Match the standard form

    Here p=2p=2, q=6q=6, and both are continuous on all real inputs. Use μ=e2x\mu=e^{2x}. Multiplication gives (e2xy)′=6e2x(e^{2x}y)^{\prime}=6e^{2x}.

  2. Find the constant

    Integration gives e2xy=3e2x+Ce^{2x}y=3e^{2x}+C, hence y=3+Ce−2xy=3+Ce^{-2x}. The condition y(0)=1y(0)=1 gives C=−2C=-2, so y=3−2e−2xy=3-2e^{-2x} for all real xx.

  3. Check and interpret

    Since y′=4e−2xy^{\prime}=4e^{-2x}, substituting gives y′+2y=6y^{\prime}+2y=6, and y(0)=1y(0)=1. For x≥0x\ge0, the derivative is positive and the exponential term shrinks toward zero. Thus yy increases toward 33 from below. The constant function y=3y=3 is another solution of the equation, but it does not satisfy this initial condition.

Diagnose an error: divide before choosing the factor

For 2y′+4y=e−x2y^{\prime}+4y=e^{-x}, with y(0)=0y(0)=0, a student chooses μ=e4x\mu=e^{4x} because the coefficient of yy is 44. Explain the error and solve the initial-value problem.

Show answer and reasoning
  1. Normalize every term

    The standard equation is y′+2y=12e−xy^{\prime}+2y=\tfrac12e^{-x}, so choose μ=e2x\mu=e^{2x}. The product derivative is (e2xy)′=12ex(e^{2x}y)^{\prime}=\tfrac12e^x. The proposed factor has derivative 4e4x4e^{4x}, which would create a coefficient 44 in the normalized left side instead of 22.

  2. Integrate and use the initial value

    We obtain e2xy=12ex+Ce^{2x}y=\tfrac12e^x+C, then y=12e−x+Ce−2xy=\tfrac12e^{-x}+Ce^{-2x}. At zero, 0=12+C0=\tfrac12+C, so

    y=e−x−e−2x2,x∈R.y=\frac{e^{-x}-e^{-2x}}{2},\qquad x\in\mathbb R.

  3. Return to the original equation

    The derivative is y′=−12e−x+e−2xy^{\prime}=-\tfrac12e^{-x}+e^{-2x}. Thus 2y′+4y=−e−x+2e−2x+2e−x−2e−2x=e−x.\begin{aligned}2y^{\prime}+4y&=-e^{-x}+2e^{-2x}\\ &\quad+2e^{-x}-2e^{-2x}\\ &=e^{-x}.\end{aligned} The initial value is (1−1)/2=0(1-1)/2=0.

Independent practice: a negative interval

Solve xy′+y=x2xy^{\prime}+y=x^2, with y(−1)=2y(-1)=2. Choose the largest interval containing −1-1 on which the standard coefficients are continuous. Decide whether μ=x\mu=x can be used even though the exponential formula gives ∣x∣|x|.

Show answer and reasoning
  1. Choose the correct side of zero

    Division by xx gives y′+y/x=xy^{\prime}+y/x=x. The interval containing −1-1 is (−∞,0)(-\infty,0). Since ∫1/x dx=ln⁡∣x∣\int 1/x\,dx=\ln|x|, one factor is ∣x∣|x|. On this interval, ∣x∣=−x|x|=-x, so xx is a nonzero constant multiple of that factor and works too. Directly, μ′=1=(1/x)μ\mu^{\prime}=1=(1/x)\mu.

  2. Solve and determine the constant

    Multiplying by xx gives (xy)′=x2(xy)^{\prime}=x^2. Integrating yields xy=x3/3+Cxy=x^3/3+C and y=x2/3+C/xy=x^2/3+C/x. The condition is 2=1/3−C2=1/3-C, so C=−5/3C=-5/3:

    y=x23−53x,x<0.y=\frac{x^2}{3}-\frac{5}{3x},\qquad x<0.

  3. Check the sign and interval

    We have y′=2x/3+5/(3x2)y^{\prime}=2x/3+5/(3x^2), so xy′+y=x2xy^{\prime}+y=x^2. At −1-1, the value is 1/3+5/3=21/3+5/3=2. This solution diverges as x→0−x\to0^-, so it cannot be extended continuously through zero. The same algebraic expression on x>0x>0 would describe a separate solution branch, not an interval containing the given initial input.

6. Use the method on your next problem

  1. Check linearity in the unknown function and its derivative.
  2. Divide every term by the leading coefficient where it is nonzero. State an interval containing the initial input.
  3. Read p(x)p(x) from the normalized equation, choose μ=e∫p dx\mu=e^{\int p\,dx}, and verify μ′=pμ\mu^{\prime}=p\mu.
  4. Rewrite the left side as (μy)′(\mu y)^{\prime}, integrate, divide by μ\mu, and apply the initial condition.
  5. Substitute into the original equation and check the initial value separately.

If the integration is the sticking point, revisit how to choose an integration method. For a shorter starting point, use the differential-equations solution check.

Working on a second-order equation with constant coefficients and a nonzero right-hand side? Continue with choosing a particular-solution trial. Check the equation type first; the first-order integrating-factor method above is a different procedure.

Course context and further reading

Concordia’s Fall 2026 ENGR 213 outline includes first-order linear equations and initial-value problems. McGill’s current MATH 263 description includes first-order ODEs. Use your current outline to choose the first-order equations and initial-value problems to practise. The questions here are original practice, not official assessment material.

Useful for

Work on the step you’re missing.

Tell us the subject and your preferred time. Nablio confirms the details by text or email.

Request a lesson