Differential Equations • First-Order Differential Equations

Linear ODEs with Initial Conditions — Solving Linear First-Order ODEs with Initial Conditions

Learn to find the one specific solution that satisfies both a differential equation and a given starting value.

A changing curve with sigma and variable symbols for differential equations
Inside this lesson 10 sections 5 questions 8 figures

SECTION 1

Historical Context & Motivation

Imagine you know that a car is accelerating at a specific rate, but you also know exactly where the car started. With both pieces of information, you can predict the car's exact position at any future time. This is precisely the idea behind solving a differential equation with an initial condition. The equation tells you how something changes, and the initial condition pins down where the story begins.

For centuries, mathematicians and scientists have been fascinated by equations that describe rates of change. From tracking the motion of planets to modeling how populations grow or how substances decay, ordinary differential equations (ODEs) have served as the backbone of scientific prediction. The development of techniques for solving these equations — especially first-order linear ones — unfolded gradually across the 17th, 18th, and 19th centuries.

1676 • Leibniz and Newton Lay the Foundations

Gottfried Wilhelm Leibniz and Isaac Newton independently developed calculus, introducing the concept of derivatives and integrals that made differential equations possible.

1694 • Leibniz Solves Linear First-Order ODEs

Leibniz published a method for solving linear first-order differential equations, recognizing the special structure that makes them solvable by a systematic technique.

1739 • Euler Develops the Integrating Factor

Leonhard Euler formalized the integrating factor method, turning the solution of linear first-order ODEs into a routine, step-by-step procedure that students still learn today.

1800s • Initial Value Problems in Physics

Scientists began routinely pairing differential equations with initial conditions to model real-world phenomena like heat conduction, electrical circuits, and radioactive decay.

The key question that this lesson addresses is: when you solve a differential equation, you typically get a family of solutions containing an arbitrary constant. How do you determine the one specific solution that matches a particular real-world scenario? The answer lies in applying an initial condition — a known value of the function at a specific point.

SECTION 2

Core Principles & Definitions

Before diving into the solving technique, let's establish the key ideas and vocabulary you need. A first-order linear ODE is a differential equation involving the first derivative of an unknown function y(x), where both y and dy/dx appear to the first power — no squares, no products of y with dy/dx, and no other nonlinear operations. When paired with an initial condition, the problem is called an initial value problem (IVP).

1

Standard Form

A first-order linear ODE is written as dy/dx + P(x)·y = Q(x), where P(x) and Q(x) are functions of x (or constants). Getting your equation into this form is always the first step.
2

General Solution

The general solution contains an arbitrary constant C. It represents an infinite family of curves, all of which satisfy the differential equation but start from different values.
3

Initial Condition

An initial condition takes the form y(x₀) = y₀, specifying the exact value of y at a particular x. This pins down the constant C and gives you one specific solution curve.
4

Integrating Factor

The integrating factor μ(x) = e^(∫P(x)dx) is a cleverly chosen function that, when multiplied through the equation, turns the left side into an exact derivative. This makes integration straightforward.
5

Particular Solution

After applying the initial condition to determine C, you obtain the particular solution — the unique function that satisfies both the ODE and the starting value.
✦

KEY TAKEAWAY

Think of a differential equation like a set of driving directions that say "always turn left when you reach an intersection." Many routes follow that rule, depending on where you start. The initial condition is like telling someone the exact address where the trip begins — now there's only one possible route.

SECTION 3

Visualizing the Family of Solutions

To build intuition, consider the differential equation dy/dx + y = 2. Its general solution is y = 2 + Ce−x. Different values of C produce different curves that all satisfy the ODE. The diagram below shows several of these curves. Notice how they all share the same long-term behavior — approaching y = 2 — but they start at different heights depending on C.

Family of Solutions: y = 2 + Ce⁻ˣxyy = 20123450123C=0C=1C=−1C=−2C=−2y(0) = 3 → C = 1y(0) = 1 → C = −1
Each curve represents a solution to dy/dx + y = 2 for a different value of C. The cyan dot marks the initial condition y(0) = 3 (C = 1), while the pink dot marks y(0) = 1 (C = −1). All curves converge to the equilibrium line y = 2.

In the diagram above, each colored curve is one member of the solution family. Without an initial condition, you cannot tell which curve describes your system. The moment you specify a starting value — such as y(0) = 3 — you pick out exactly one curve from the entire family. That is the power of the initial value problem: it transforms an infinite family into a single, definite answer.

SECTION 4

Mathematical Framework — The Integrating Factor Method

The standard technique for solving a first-order linear ODE is the integrating factor method. Here is the complete framework, broken into the equations you need to know.

STANDARD FORM

dy/dx+P(x)⋅y=Q(x)dy/dx + P(x) · y = Q(x)

P(x) is the coefficient of y, and Q(x) is the right-hand side. The coefficient of dy/dx must be 1 — if it isn't, divide the entire equation by whatever multiplies dy/dx.

INTEGRATING FACTOR

μ(x)=e(∫P(x)dx)μ(x) = e^(∫P(x) dx)

μ(x) is a special multiplier that transforms the left side of the equation into the derivative of a product. You do not need a constant of integration here — any antiderivative of P(x) works.

KEY IDENTITY

d/dx[μ(x)⋅y]=μ(x)⋅Q(x)d/dx [μ(x) · y] = μ(x) · Q(x)

After multiplying both sides of the ODE by μ(x), the left side collapses into the derivative of the product μ(x) · y. This is what makes the method work — now you can integrate both sides directly.

GENERAL SOLUTION

y=(1/μ(x))⋅[∫μ(x)⋅Q(x)dx+C]y = (1/μ(x)) · [∫ μ(x) · Q(x) dx + C]

C is the arbitrary constant that gets determined by the initial condition. This formula gives every possible solution to the ODE.

💡

The Roadmap

The complete procedure is: (1) Rewrite in standard form, (2) Identify P(x), (3) Compute μ(x) = e^(∫P(x) dx), (4) Multiply both sides by μ(x) and integrate, (5) Solve for y to get the general solution, (6) Apply the initial condition to find C.

SECTION 5

The Solving Process — Step by Step

The flowchart below maps out each decision point in the solving process. Follow the arrows from top to bottom — each box represents one action you take, and the final box is your answer.

Solving a Linear First-Order IVPStep 1: Write in Standard Formdy/dx + P(x)·y = Q(x)Step 2: Identify P(x)Read the coefficient of yStep 3: Compute Integrating Factorμ(x) = e^(∫P(x) dx)Step 4: Multiply & Integrated/dx[μ·y] = μ·Q(x)μ·y = ∫μ·Q(x) dx + CStep 5: Solve for y (General Solution)y = (1/μ)·[∫μ·Q dx + C]Step 6: Apply Initial ConditionPlug in y(x₀) = y₀, solve for CSubstitute C back into general solution✓ PARTICULAR SOLUTIONThe unique answer to your IVPTip: Always verify by substituting your particular solution back into the original ODE and checking the initial condition.
This flowchart shows the six steps of the integrating factor method, from rewriting the ODE in standard form (top) to obtaining the particular solution (bottom). Each colored border indicates a distinct phase of the procedure.

The most common mistake students make is forgetting to put the equation into standard form before identifying P(x). For example, if you're given 2·(dy/dx) + 6y = 10, you must first divide everything by 2 to get dy/dx + 3y = 5. Only then is P(x) = 3. Another common pitfall is including a "+ C" in the integrating factor exponent — you don't need it there because any single antiderivative works.

SECTION 6

Worked Example

Let's solve a complete initial value problem step by step. We will work through every detail so you can see the method in action.

Solve dy/dx − 2y = 4, with y(0) = 1

  1. 1

    Step 1 — Write in Standard Form

    The equation is already in the form dy/dx + P(x)·y = Q(x). Comparing: dy/dx + (−2)·y = 4, so P(x) = −2 and Q(x) = 4.
    P(x) = −2, Q(x) = 4
  2. 2

    Step 2 — Compute the Integrating Factor

    The integrating factor is μ(x) = e^(∫P(x) dx) = e^(∫(−2) dx) = e−2xe^{−2x}. We don't include a constant of integration here.
    μ(x) = e−2xe^{−2x}
  3. 3

    Step 3 — Multiply Both Sides by μ(x)

    Multiply through: e−2xe^{−2x} · dy/dx − 2e−2x2e^{−2x} · y = 4e−2x4e^{−2x}. The left side is the derivative of the product: d/dx[e−2xe^{−2x} · y] = 4e−2x4e^{−2x}. You can verify this by applying the product rule to e−2xe^{−2x} · y.
    d/dx[e−2xe^{−2x} · y] = 4e−2x4e^{−2x}
  4. 4

    Step 4 — Integrate Both Sides

    Integrating: e−2xe^{−2x} · y = ∫4e−2x4e^{−2x} dx = 4 · (−1/2) · e−2xe^{−2x} + C = −2e−2x2e^{−2x} + C. Remember to include the constant C on this step.
    e−2xe^{−2x} · y = −2e−2x2e^{−2x} + C
  5. 5

    Step 5 — Solve for y

    Divide both sides by e−2xe^{−2x}, which is the same as multiplying by e2xe^{2x}: y = −2 + Ce2xCe^{2x}. This is the general solution.
    General solution: y = −2 + Ce2xCe^{2x}
  6. 6

    Step 6 — Apply the Initial Condition y(0) = 1

    Substitute x = 0 and y = 1: 1 = −2 + C·e0e^{0} = −2 + C. Solving: C = 3. Therefore the particular solution is y = −2 + 3e2x3e^{2x}.
    Particular solution: y = −2 + 3e2x3e^{2x}
  7. 7

    Verification

    Check the ODE: dy/dx = 6e2x6e^{2x}, and −2y = −2(−2 + 3e2x3e^{2x}) = 4 − 6e2x6e^{2x}. So dy/dx − 2y = 6e2x6e^{2x} + 4 − 6e2x6e^{2x} = 4 ✓. Check the IC: y(0) = −2 + 3(1) = 1 ✓.
    Both checks pass — the solution is correct.

SECTION 7

Strengths, Limitations, and Common Pitfalls

The integrating factor method is powerful, but like any technique, it has its sweet spots and its boundaries. The table below summarizes the key strengths and limitations you should keep in mind.

AspectStrengthsLimitations
ApplicabilityWorks for every first-order linear ODE, regardless of what P(x) and Q(x) are.Does not work for nonlinear equations (e.g., dy/dx = y², or terms like y·(dy/dx)).
Systematic natureFollows a clear, repeatable algorithm — no guessing or creative tricks required.The integrals ∫P(x) dx and ∫μQ dx may be difficult or impossible to evaluate in closed form.
UniquenessWhen combined with an initial condition, the method always produces exactly one particular solution.If the initial condition is outside the interval where P(x) and Q(x) are continuous, uniqueness may fail.
SetupOnly basic calculus operations are needed: differentiation and integration.Forgetting to rewrite in standard form (coefficient of dy/dx equal to 1) is a very common error.

Strengths and limitations of the integrating factor method

✦

KEY TAKEAWAY

The integrating factor method is like a universal key that opens every first-order linear ODE lock. However, the lock may still be stiff — meaning the integrals can be hard. The method guarantees a way forward, even if the arithmetic gets messy. When things look complicated, double-check that you have the correct standard form — most errors trace back to that first step.

SECTION 8

Connection to Higher-Order and Advanced Topics

The ideas you've learned here — standard form, integrating factors, and initial conditions — serve as the foundation for virtually everything that comes next in differential equations. Understanding first-order linear IVPs prepares you for higher-order equations, systems, and even partial differential equations.

FeatureFirst-Order Linear IVPSecond-Order Linear IVP
Equation formdy/dx + P(x)y = Q(x)d²y/dx² + P(x)dy/dx + R(x)y = Q(x)
Number of ICs needed1 condition: y(x₀) = y₀2 conditions: y(x₀) = y₀ and y'(x₀) = y₁
Constants in general solution1 arbitrary constant (C)2 arbitrary constants (C₁, C₂)
Solving methodIntegrating factorCharacteristic equation, variation of parameters, or undetermined coefficients
Key applicationExponential growth/decay, mixing problems, simple circuitsSprings, oscillations, RLC circuits

Comparison of first-order and second-order linear IVPs

Notice the pattern: the order of the equation equals the number of initial conditions you need and the number of arbitrary constants in the general solution. A third-order equation would require three ICs, and so on. The principle of matching initial conditions to constants is a thread that runs through all of differential equations. Mastering the first-order case gives you a template for tackling everything that follows.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A first-order linear ODE has a general solution containing one arbitrary constant C. Explain in your own words why exactly one initial condition is needed to determine a unique (particular) solution, and describe what would happen if you had zero initial conditions or two initial conditions.
Show answer
The general solution contains one free parameter C, so you need exactly one equation to pin it down. An initial condition of the form y(x₀) = y₀ provides that one equation. With zero initial conditions, C remains undetermined, so you have infinitely many solutions — an entire family of curves. With two initial conditions (at different x-values), you'd get two equations for the single unknown C. In most cases, only one value of C satisfies both, which is consistent. But if the two conditions are contradictory (no value of C works for both), then no solution exists. The key point is that the number of initial conditions should match the number of arbitrary constants in the general solution.

Question 2: BASIC CALCULATION

Solve the initial value problem: dy/dx + 3y = 6, with y(0) = 0.
Show answer
Standard form: dy/dx + 3y = 6, so P(x) = 3 and Q(x) = 6. The integrating factor is μ(x) = e^(∫3 dx) = e3xe^{3x}. Multiply both sides by e3xe^{3x}: d/dx[e3xe^{3x}·y] = 6e3x6e^{3x}. Integrate: e3xe^{3x}·y = 6·(1/3)·e3xe^{3x} + C = 2e3x2e^{3x} + C. Divide by e3xe^{3x}: y = 2 + Ce−3xCe^{−3x}. Apply y(0) = 0: 0 = 2 + C, so C = −2. The particular solution is y = 2 − 2e−3x2e^{−3x}. You can verify: dy/dx = 6e−3x6e^{−3x}, and 3y = 6 − 6e−3x6e^{−3x}, so dy/dx + 3y = 6e−3x6e^{−3x} + 6 − 6e−3x6e^{−3x} = 6 ✓.

Question 3: INTERMEDIATE

Solve the initial value problem: dy/dx + (2/x)·y = x, with y(1) = 3, for x > 0.
Show answer
This problem features a variable coefficient P(x) = 2/x. The integrating factor is μ(x) = e^(∫(2/x) dx) = e2lnxe^{2 ln x} = x². Multiplying both sides: d/dx[x²·y] = x² · x = x³. Integrate: x²·y = x⁴/4 + C. Solve for y: y = x²/4 + C/x². Apply y(1) = 3: 3 = 1/4 + C/1 = 1/4 + C, so C = 11/4. The particular solution is y = x²/4 + 11/(4x²). You can check by computing dy/dx = x/2 − 11/(2x³) and verifying that dy/dx + (2/x)·y simplifies to x.

Question 4: APPLIED

A tank initially contains 50 liters of pure water. A brine solution with a salt concentration of 3 grams per liter flows in at 2 liters per minute, and the well-mixed solution drains out at 2 liters per minute. Let S(t) be the amount of salt (in grams) in the tank at time t. Set up and solve the initial value problem, then find how much salt is in the tank after 10 minutes.
Show answer
Salt enters at 3 g/L × 2 L/min = 6 g/min. Salt leaves at (S/50) g/L × 2 L/min = S/25 g/min (since the volume stays at 50 L). The ODE is dS/dt = 6 − S/25, or dS/dt + (1/25)·S = 6, with S(0) = 0. Here P(t) = 1/25 and Q(t) = 6. Integrating factor: μ(t) = et/25e^{t/25}. Multiply and integrate: d/dt[et/25e^{t/25}·S] = 6et/256e^{t/25}. So et/25e^{t/25}·S = 6·25·et/25e^{t/25} + C = 150et/25150e^{t/25} + C. Divide: S = 150 + Ce−t/25Ce^{−t/25}. Apply S(0) = 0: 0 = 150 + C, so C = −150. Particular solution: S(t) = 150(1 − e−t/25e^{−t/25}). At t = 10: S(10) = 150(1 − e−0.4e^{−0.4}) ≈ 150(1 − 0.6703) ≈ 150(0.3297) ≈ 49.5 grams. The tank contains approximately 49.5 grams of salt after 10 minutes.

Question 5: CRITICAL THINKING

Consider the general IVP: dy/dx + ay = b, with y(0) = y₀, where a and b are positive constants. (a) Find the particular solution in terms of a, b, and y₀. (b) Determine the long-term behavior as x → ∞. (c) Explain why the solution always approaches the same value regardless of the initial condition y₀, and describe what this value represents in the context of the ODE.
Show answer
(a) With P(x) = a and Q(x) = b, the integrating factor is μ = eaxe^{ax}. Following the standard method: eaxe^{ax}·y = (b/a)·eaxe^{ax} + C, so y = b/a + Ce−axCe^{−ax}. Applying y(0) = y₀: y₀ = b/a + C, giving C = y₀ − b/a. The particular solution is y = b/a + (y₀ − b/a)·e−axe^{−ax}. (b) As x → ∞, the exponential term e−axe^{−ax} → 0 (since a > 0), so y → b/a regardless of y₀. (c) The value b/a is the equilibrium solution — when y = b/a, the derivative dy/dx = b − a·(b/a) = 0, meaning the function stops changing. The exponential term represents the transient behavior that decays over time. No matter where you start, the system is always being pulled toward the equilibrium. This reflects a fundamental property of stable linear systems: initial conditions affect the short-term behavior but not the long-term destination.

SUMMARY

Lesson Summary

Summary

A first-order linear ODE has the standard form dy/dx + P(x)·y = Q(x). To solve it, you compute the integrating factor μ(x) = e^(∫P(x) dx), multiply both sides of the ODE by μ(x), recognize that the left side becomes d/dx[μ·y], and integrate. This yields the general solution containing one arbitrary constant C.

An initial condition of the form y(x₀) = y₀ transforms the problem into an initial value problem (IVP). By substituting the initial condition into the general solution, you determine the unique value of C and obtain the particular solution — the one specific curve from the solution family that passes through the given starting point. Always verify your answer by checking it satisfies both the original ODE and the initial condition.

Varsity Tutors • Differential Equations • Linear ODEs with Initial Conditions