Chapter 21
20 min read
Section 177 of 353

Linear First-Order Differential Equations

First-Order Differential Equations

Learning Objectives

By the end of this section, you will be able to:

  1. Identify first-order linear differential equations in standard form y+P(x)y=Q(x)y' + P(x)y = Q(x)
  2. Apply the integrating factor method to solve any first-order linear ODE
  3. Interpret direction fields and solution curves geometrically
  4. Understand the structure of solutions: homogeneous + particular
  5. Model real-world phenomena: RC circuits, mixing problems, population dynamics
  6. Connect linear ODEs to gradient descent and machine learning optimization
  7. Implement numerical solvers in Python using scipy

The Big Picture: Why Linear ODEs Matter

"Differential equations are the language in which the laws of nature are expressed." — Richard Feynman

First-order linear differential equations are among the most important equations in all of applied mathematics. They describe systems where the rate of change of a quantity is proportional to the quantity itself, possibly with an external input.

The Core Pattern

A first-order linear ODE has the form: Rate of change = Input - Decay

dydt=Q(t)P(t)y\frac{dy}{dt} = Q(t) - P(t) \cdot y

This captures the balance between something being added to a system (Q) and something draining away proportionally (Py).

Where Linear First-Order ODEs Appear

⚡ Electrical Engineering

  • RC and RL circuits
  • Capacitor charging/discharging
  • Signal filtering
  • Transient response analysis

🧪 Chemistry & Biology

  • Drug pharmacokinetics
  • Chemical reaction rates
  • Population dynamics
  • Enzyme kinetics

🌡️ Physics

  • Newton's law of cooling
  • Radioactive decay
  • Terminal velocity
  • Heat transfer

🤖 Machine Learning

  • Gradient descent as gradient flow
  • Exponential learning rate decay
  • Momentum optimization
  • Neural ODE architectures

Historical Context

The study of differential equations began in the late 17th century with Newton and Leibniz's development of calculus. First-order linear equations were among the first to be solved systematically.

Key Historical Developments

1690s: Newton & Leibniz

Developed the fundamental tools of calculus and recognized that many physical laws could be expressed as equations involving derivatives.

1739: Leonhard Euler

Systematized the integrating factor method and laid the foundation for the modern theory of differential equations.

1800s: Applications Explode

Engineers and scientists applied these equations to electricity (Ohm, Kirchhoff), heat conduction (Fourier), and population dynamics (Malthus, Verhulst).


Mathematical Definition

A first-order linear differential equation is an equation of the form:

dydx+P(x)y=Q(x)\frac{dy}{dx} + P(x)y = Q(x)

What Each Part Means

SymbolNameMeaning
yDependent VariableThe unknown function we're solving for
xIndependent VariableThe variable with respect to which we differentiate
dy/dxDerivativeThe rate of change of y with respect to x
P(x)Coefficient FunctionA known function multiplying y (controls decay/growth)
Q(x)Forcing FunctionA known function driving the system (external input)

Why "Linear"?

The equation is called linear because:

  1. The dependent variable yy and its derivative dy/dxdy/dx appear only to the first power
  2. There are no products like ydy/dxy \cdot dy/dx or terms like y2y^2
  3. If y1y_1 and y2y_2 are solutions to the homogeneous equation, so is c1y1+c2y2c_1 y_1 + c_2 y_2

Linearity Principle

The linearity of the equation is crucial: it means we can build general solutions by combining simpler solutions. This "superposition principle" is the key to solving linear equations systematically.


Direction Fields & Solution Curves

Before diving into algebraic solutions, let's develop geometric intuition. At every point (x,y)(x, y) in the plane, the ODE tells us the slope of the solution passing through that point:

slope=dydx=Q(x)P(x)y\text{slope} = \frac{dy}{dx} = Q(x) - P(x)y

By drawing small line segments with these slopes, we create a direction field (or slope field) that shows how solutions flow.

📈Direction Field Explorer

Click anywhere on the plot to add a solution curve through that point. The arrows show the direction of the tangent at each point.

Custom Equation
dy/dx + 1y = 2
Equilibrium solution: y = 2.00
xy

How to Use

  • • Click anywhere on the plot to draw a solution curve through that point
  • • The arrows show the slope field - the direction of the tangent line at each point
  • • The green dashed line shows the equilibrium solution (where y' = 0)
  • • Notice how all solution curves approach or diverge from the equilibrium

Key Observations from the Direction Field

  • Solution curves never cross: Each point has exactly one slope, so solutions are unique
  • Equilibrium solutions: Where dy/dx=0dy/dx = 0, the slope is horizontal — these are constant solutions
  • Asymptotic behavior: Solutions approach or diverge from equilibria depending on the sign of P(x)
  • Stability: If P(x) > 0, the equilibrium is stable (attracting); if P(x) < 0, it's unstable (repelling)

The Integrating Factor Method

The integrating factor method is the systematic technique for solving any first-order linear ODE. It's one of the most elegant methods in differential equations.

The Key Idea

We multiply both sides of the equation by a carefully chosen function μ(x)\mu(x) (the integrating factor) that transforms the left side into an exact derivative. This allows us to integrate both sides directly.

🧮Integrating Factor Method: Step by Step

Follow the integrating factor method to solve first-order linear ODEs.

Step 1 of 6

Start with the Linear ODE

dy/dx + 2y = 6
Identify P(x) = 2 and Q(x) = 6

This is a first-order linear ODE in standard form: y' + P(x)y = Q(x), where P(x) = 2 and Q(x) = 6.

The Integrating Factor Formula

1. Given: y' + P(x)y = Q(x)
2. Compute: μ(x) = e∫P(x)dx
3. Solution: y = (1/μ(x)) · [∫μ(x)Q(x)dx + C]

The General Formula

Solution to y' + P(x)y = Q(x)

Step 1: Compute the integrating factor
μ(x)=eP(x)dx\mu(x) = e^{\int P(x) \, dx}
Step 2: Multiply both sides by μ(x)\mu(x)
μ(x)y+μ(x)P(x)y=μ(x)Q(x)\mu(x)y' + \mu(x)P(x)y = \mu(x)Q(x)
Step 3: Recognize the product rule on the left
ddx[μ(x)y]=μ(x)Q(x)\frac{d}{dx}[\mu(x)y] = \mu(x)Q(x)
Step 4: Integrate and solve for y
y=1μ(x)[μ(x)Q(x)dx+C]y = \frac{1}{\mu(x)}\left[\int \mu(x)Q(x) \, dx + C\right]

Why This Works

The magic is in the choice of μ(x)=eP(x)dx\mu(x) = e^{\int P(x)dx}. This ensures that μ(x)=μ(x)P(x)\mu'(x) = \mu(x) \cdot P(x) (by the chain rule), which is exactly what we need for the left side to become d/dx[μy]d/dx[\mu y] via the product rule.


Structure of the General Solution

The general solution to a first-order linear ODE has a beautiful additive structure:

y=yh+ypy = y_h + y_p

Homogeneous Solution yh

Solution to y+P(x)y=0y' + P(x)y = 0

yh=CeP(x)dxy_h = Ce^{-\int P(x)dx}

Contains the arbitrary constant C (determined by initial conditions)

Particular Solution yp

Any one solution to the full equation y+Py=Qy' + Py = Q

yp=1μ(x)μ(x)Q(x)dxy_p = \frac{1}{\mu(x)}\int \mu(x)Q(x)dx

Represents the forced response to the external input Q(x)

Physical Interpretation

  • Homogeneous solution (yh): The system's natural behavior without external input — typically exponential decay or growth
  • Particular solution (yp): The forced response to external input — the steady-state or driven behavior
  • Transient vs. Steady-State: Often yh decays to zero (transient), leaving yp as the long-term (steady-state) behavior

Application: RC Circuits

One of the most important applications of first-order linear ODEs is in electrical circuits. Consider a resistor-capacitor (RC) circuit:

The Governing Equation

By Kirchhoff's voltage law, the voltage across the resistor plus the voltage across the capacitor equals the source voltage:

VR+VC=Vs    iR+VC=VsV_R + V_C = V_s \implies iR + V_C = V_s

Since i=CdVCdti = C \frac{dV_C}{dt} (the current through a capacitor), we get:

RCdVCdt+VC=VsRC\frac{dV_C}{dt} + V_C = V_s

Dividing by RC gives the standard form:

dVCdt+1RCVC=VsRC\frac{dV_C}{dt} + \frac{1}{RC}V_C = \frac{V_s}{RC}

Here, P=1/(RC)P = 1/(RC) and Q=Vs/(RC)Q = V_s/(RC). The time constant is τ=RC\tau = RC.

RC Circuit Simulator

Visualize the charging and discharging of a capacitor — a classic application of first-order linear ODEs.

Time Constant
τ = RC = 1000.00 ms
Governing ODE
RC · dV/dt + V = V_s → dV/dt + V/(RC) = V_s/(RC)
V(t) = V_s(1 - e^{-t/τ})
1τ2τ3τ4τ5τ63.2%Time (t)Voltage (V)
Time
0.0 ms
(0.00τ)
Voltage
0.000 V
(0.0% of V_s)
Current
5.000 mA

Key Insights

  • • After 1τ: Capacitor reaches 63.2% of final voltage
  • • After 3τ: Reaches 95% — practically charged/discharged
  • • After 5τ: Reaches 99.3% — effectively complete
  • • The time constant τ = RC controls how fast the circuit responds

The Solutions

Charging (VC(0) = 0)

VC(t)=Vs(1et/τ)V_C(t) = V_s\left(1 - e^{-t/\tau}\right)

Discharging (VC(0) = V0)

VC(t)=V0et/τV_C(t) = V_0 e^{-t/\tau}

Application: Battery Charging

Have you noticed your phone charges quickly to 80% but then slows down dramatically? This is the same ODE as capacitor charging — batteries use constant-voltage charging which follows first-order linear kinetics.

Battery Charging Simulator

Why does your phone charge quickly to 80% but slowly after? It's an ODE!

Constant-Voltage Charging (CC-CV Model)
dQ/dt = Imax(1 - Q/Qmax) = Imax - (Imax/Qmax)Q
Q(t) = Qmax(1 - e-t/τ) + Q₀ · e-t/τ

Time constant τ = 1.2 hours for standard mode

Time to 80%
108 min
Time to 99%
324 min
80% (optimal for battery health)0h1h2h3h4h0%25%50%75%100%0.0A0.5A1.0A1.5A2.0ACharge (%)Current (A)Time (hours)
Time
0 min
Charge
10.0%
Current
2.00 A
Energy Added
0 mAh

Why Batteries Charge Slower Near 100%

  • Same math as RC circuits: Charging current decreases exponentially as the battery fills
  • Constant-Voltage phase: After 80%, chargers switch to constant voltage, limiting current
  • Time constant τ: Battery reaches 63.2% of remaining capacity in one time constant
  • 80% in half the time: Getting from 10% → 80% takes less time than 80% → 100%
  • Battery health: Stopping at 80% reduces stress and extends battery life

Application: Mixing Problems

Another classic application is the tank mixing problem: a well-mixed tank has fluid flowing in and out, and we track the amount of a dissolved substance (like salt).

Setting Up the Model

Let y(t) = amount of salt in the tank at time t. Then:

dydt=(rate in)(rate out)\frac{dy}{dt} = \text{(rate in)} - \text{(rate out)}
  • Rate in: (flow rate) × (inflow concentration) = r × cin
  • Rate out: (flow rate) × (tank concentration) = r × (y/V)

This gives the first-order linear ODE:

dydt+rVy=rcin\frac{dy}{dt} + \frac{r}{V}y = r \cdot c_{in}
Tank Mixing Problem

Salt water flows into a well-mixed tank and drains out. Watch how the salt concentration evolves!

Governing ODE
dy/dt = (rate in) - (rate out) = r·c_in - r·(y/V)
dy/dt + (r/V)y = r·c_in
y(t) = c_in·V + (y₀ - c_in·V)e^(-rt/V)
c_in = 0.5 kg/Lr = 5 L/minout100Ly = 0.0 kg
1τ2τ3τ4τ5τ50 kgTime (min)Salt (kg)
Time
0.0 min
Salt Amount
0.00 kg
Concentration
0.0000 kg/L
Time Constant
τ = 20.0 min

Physical Interpretation

  • Time constant τ = V/r = 20.0 min: Time to replace one tank volume
  • Equilibrium: y = c_in × V = 50.0 kg when inflow = outflow concentration
  • • After 3τ: Solution is 95% of the way to equilibrium
  • • The well-mixed assumption means concentration is uniform throughout

Application: Coffee Cooling

Newton's Law of Cooling states that the rate of temperature change is proportional to the temperature difference from the environment. This leads to a first-order linear ODE with a surprising application: when should you add cream to keep your coffee warmest?

Coffee Cooling Simulator

Explore Newton's Law of Cooling: When should you add cream to keep your coffee warmest?

Newton's Law of Cooling
dT/dt = -k(T - Tenv)
T(t) = Tenv + (T0 - Tenv)e-kt
Compare adding cream immediately vs. waiting 5 minutes
Ideal drinking tempRoom temp (22°C)05101520253030°C50°C70°C90°CTime (minutes)Temperature (°C)
Time
0.0 min
Temperature
95.0°C
Too hot!
Cream Added
Not yet

The Cream Puzzle: When Should You Add It?

Counterintuitive result: Adding cream immediately keeps your coffee warmer longer!

  • Why? Cooling rate depends on temperature difference from the environment
  • • Adding cold cream immediately lowers the temperature, reducing the cooling rate
  • • Waiting means the coffee cools quickly at high temp, then gets even colder with cream
  • • Turn on "Cream Timing Comparison" to see this effect!

Application: Drug Dosing

Why do medicine labels say "take every 8 hours"? Drug concentration in the body follows first-order elimination kinetics — the same exponential decay we've been studying. The dosing interval is carefully chosen to keep drug levels in the therapeutic window.

Drug Dosing Simulator (Pharmacokinetics)

Explore drug concentration over time — why do we take medicine every 8 hours?

Half-life: 4.6 hours
First-Order Elimination Kinetics
dC/dt = -k · C
C(t) = C₀ · e-kt where C₀ = Dose/V = 2.00 mg/L
Therapeutic windowSub-therapeutic0h8h16h24h32h40h48h012Time (hours)Concentration (mg/L)
Time
0.0 hr
Concentration
2.00 mg/L
Half-life
4.6 hr
Status
Therapeutic

Why Take Medicine Every 8 Hours?

  • First-order kinetics: The ODE dC/dt = -kC means exponential decay after each dose
  • Therapeutic window: We need the concentration between minimum effective and maximum safe levels
  • Dosing interval: Chosen so the drug doesn't drop below therapeutic before the next dose
  • Steady state: After ~4-5 half-lives of repeated dosing, peaks and troughs stabilize
  • Superposition: Multiple doses "stack" — each contributes its own exponential decay curve

Application: Disease Spread

During the early phase of an epidemic, when nearly everyone is susceptible, the spread of infection follows a first-order linear ODE. This explains why diseases grow exponentially at first and why R₀ (the basic reproduction number) is so important.

Disease Spread Simulator (SIR Model)

Explore epidemic dynamics: early exponential growth is a first-order linear ODE!

Basic Reproduction Number (R₀)
R₀ = β/γ = 3.00
Epidemic grows! Each infected person spreads to 3.0 others
Avg. infection duration: 10.0 days
Early-Stage Approximation (when S ≈ N)
dI/dt = βI - γI = (β - γ)I
I(t) ≈ I₀ · e(β-γ)t = I₀ · e0.20t

This is a first-order linear ODE! The early epidemic grows (or decays) exponentially.

03060901200k3k5k8k10kPeak: 30.2%Susceptible (S)Infected (I)Recovered (R)Exponential fitDaysPopulation
Day
0
Susceptible
9,990
99.9%
Infected
10
0.1%
Recovered
0
0.0%

Connection to Linear ODEs

  • Early epidemic: When nearly everyone is susceptible (S ≈ N), dI/dt ≈ (β - γ)I is linear!
  • R₀ > 1: The (β - γ) coefficient is positive → exponential growth
  • R₀ < 1: The coefficient is negative → exponential decay (epidemic dies out)
  • "Flattening the curve": Reducing β (social distancing) lowers R₀ and the peak
  • Herd immunity: Once enough recover, S drops and the linear approximation breaks down

More Real-World Applications

Newton's Law of Cooling

The rate of temperature change is proportional to the temperature difference from the environment:

dTdt=k(TTenv)\frac{dT}{dt} = -k(T - T_{env})

Rewriting: dT/dt+kT=kTenvdT/dt + kT = kT_{env}. The solution approaches TenvT_{env} exponentially.

Population with Harvesting

dPdt=rPH\frac{dP}{dt} = rP - H

where r is growth rate and H is constant harvesting. This is PrP=HP' - rP = -H, a linear ODE with equilibrium at P=H/rP = H/r.

Drug Pharmacokinetics

dCdt=D(t)VkC\frac{dC}{dt} = \frac{D(t)}{V} - kC

where C is drug concentration, D(t) is dosing rate, V is volume of distribution, and k is elimination rate constant.


Machine Learning Connections

Remarkably, first-order linear ODEs appear at the heart of gradient descent optimization, the backbone of modern machine learning.

Gradient Flow

Consider minimizing a loss function L(θ). Gradient descent updates:

θn+1=θnηL(θn)\theta_{n+1} = \theta_n - \eta \nabla L(\theta_n)

In the limit of small step sizes, this becomes the gradient flow ODE:

dθdt=L(θ)\frac{d\theta}{dt} = -\nabla L(\theta)

Quadratic Objectives

For a quadratic loss L(θ)=12(θθ)2L(\theta) = \frac{1}{2}(\theta - \theta^*)^2:

dθdt=(θθ)=θ+θ\frac{d\theta}{dt} = -(\theta - \theta^*) = -\theta + \theta^*

This is exactly a first-order linear ODE with P=1P = 1 and Q=θQ = \theta^*! The solution is:

θ(t)=θ+(θ0θ)et\theta(t) = \theta^* + (\theta_0 - \theta^*)e^{-t}

Key Insight

Gradient descent on convex quadratic objectives converges exponentially — exactly the same behavior as the solutions to first-order linear ODEs! The connection extends to:

  • Learning rate: Analogous to the time step h in Euler's method
  • Stability: Too large a learning rate causes oscillation (Euler instability)
  • Momentum: Leads to second-order ODEs

Python Implementation

Numerical ODE Solver

Solving First-Order Linear ODEs with SciPy
🐍linear_ode_solver.py
1Import NumPy

NumPy provides array operations and mathematical functions for numerical computing.

2Import odeint

SciPy's odeint is a robust ODE solver based on LSODA, which handles both stiff and non-stiff problems.

5Solver Function

We create a general-purpose solver for first-order linear ODEs in standard form y' + P(t)y = Q(t).

17Convert to Standard Form

We rewrite y' + Py = Q as y' = Q - Py, which is the form required by odeint: dy/dt = f(y, t).

24Solve the ODE

odeint uses adaptive step sizes internally to maintain accuracy. We just specify the time points where we want the solution.

29Example 1: Constant Coefficients

For y' + 2y = 6, the analytical solution is y = 3 + Ce^{-2t}. Starting at y(0) = 0, we get y = 3(1 - e^{-2t}).

34Example 2: Variable Coefficient

For y' + (2/t)y = t³, we need to start slightly after t=0 to avoid division by zero. The integrating factor is μ = t².

53 lines without explanation
1import numpy as np
2from scipy.integrate import odeint
3import matplotlib.pyplot as plt
4
5def linear_ode_solver(P, Q, y0, t_span, num_points=200):
6    """
7    Solve the first-order linear ODE: dy/dt + P(t)*y = Q(t)
8
9    Parameters:
10    - P: function P(t)
11    - Q: function Q(t)
12    - y0: initial condition y(t0)
13    - t_span: tuple (t0, t_final)
14    - num_points: number of time points
15
16    Returns:
17    - t: array of time values
18    - y: array of solution values
19    """
20    # Define the ODE in standard form: dy/dt = f(y, t)
21    def dydt(y, t):
22        return Q(t) - P(t) * y
23
24    # Create time array
25    t = np.linspace(t_span[0], t_span[1], num_points)
26
27    # Solve using scipy's odeint
28    y = odeint(dydt, y0, t).flatten()
29
30    return t, y
31
32# Example 1: Constant coefficients y' + 2y = 6
33P1 = lambda t: 2
34Q1 = lambda t: 6
35t1, y1 = linear_ode_solver(P1, Q1, y0=0, t_span=(0, 3))
36
37# Example 2: Variable coefficient y' + (2/t)y = t^3
38P2 = lambda t: 2/t if t > 0 else 0
39Q2 = lambda t: t**3
40t2, y2 = linear_ode_solver(P2, Q2, y0=0.1, t_span=(0.1, 3))
41
42# Plot both solutions
43fig, axes = plt.subplots(1, 2, figsize=(12, 4))
44
45axes[0].plot(t1, y1, 'b-', linewidth=2, label='Numerical')
46axes[0].axhline(y=3, color='g', linestyle='--', label='Equilibrium y=3')
47axes[0].set_xlabel('t')
48axes[0].set_ylabel('y')
49axes[0].set_title("y' + 2y = 6")
50axes[0].legend()
51axes[0].grid(True, alpha=0.3)
52
53axes[1].plot(t2, y2, 'b-', linewidth=2)
54axes[1].set_xlabel('t')
55axes[1].set_ylabel('y')
56axes[1].set_title("y' + (2/t)y = t³")
57axes[1].grid(True, alpha=0.3)
58
59plt.tight_layout()
60plt.show()

Gradient Descent as Gradient Flow

Connecting Gradient Descent to ODEs
🐍gradient_flow.py
3Connection to ODEs

Gradient descent solves the ODE dθ/dt = -∇L(θ). Each update step is Euler's method applied to this first-order ODE!

16Euler's Method

The update θ = θ - lr*grad is exactly Euler's method: θ_{n+1} = θ_n + h*f(θ_n) where h = -lr and f = ∇L.

24Quadratic Loss

For quadratic loss L = ½(θ - θ*)², the gradient is ∇L = θ - θ*, giving the ODE dθ/dt = -(θ - θ*). This is a first-order linear ODE!

27Exponential Convergence

The analytical solution θ(t) = θ* + (θ₀ - θ*)e^{-t} shows exponential convergence to θ*. This is why gradient descent converges exponentially for convex quadratic objectives.

37 lines without explanation
1import numpy as np
2
3def gradient_descent_as_ode(loss_func, grad_func, theta_init,
4                            lr=0.1, num_steps=100):
5    """
6    Gradient descent viewed as solving: dθ/dt = -∇L(θ)
7
8    The discrete update θ_{n+1} = θ_n - η∇L(θ_n) approximates
9    the continuous gradient flow ODE.
10    """
11    theta = theta_init.copy()
12    history = [theta.copy()]
13    loss_history = [loss_func(theta)]
14
15    for _ in range(num_steps):
16        grad = grad_func(theta)
17        theta = theta - lr * grad  # Euler's method!
18        history.append(theta.copy())
19        loss_history.append(loss_func(theta))
20
21    return np.array(history), np.array(loss_history)
22
23# Example: Quadratic loss L(θ) = 0.5 * (θ - θ*)^2
24# This gives gradient flow: dθ/dt = -(θ - θ*)
25# Solution: θ(t) = θ* + (θ_0 - θ*) * e^{-t}
26
27theta_star = 3.0
28loss = lambda theta: 0.5 * (theta - theta_star)**2
29grad = lambda theta: theta - theta_star
30
31# Run gradient descent from θ_0 = 10
32history, losses = gradient_descent_as_ode(
33    loss, grad, np.array([10.0]), lr=0.1, num_steps=50
34)
35
36# Compare with analytical solution of the ODE
37t_continuous = np.linspace(0, 5, 100)
38theta_analytical = theta_star + (10 - theta_star) * np.exp(-t_continuous)
39
40print("Gradient descent is discretized gradient flow!")
41print(f"Final θ: {history[-1][0]:.4f}, Target: {theta_star}")

Common Pitfalls

Forgetting the Standard Form

The integrating factor method requires the equation in standard form y+P(x)y=Q(x)y' + P(x)y = Q(x). If your equation is 2y+4y=62y' + 4y = 6, you must first divide by 2 to get y+2y=3y' + 2y = 3.

Sign Errors in P(x)

Be careful with signs! If the equation is y3y=xy' - 3y = x, then P(x)=3P(x) = -3 (not +3). This affects the integrating factor: μ=e3x\mu = e^{-3x}.

Forgetting the Constant of Integration

When computing the integrating factor μ=eP(x)dx\mu = e^{\int P(x)dx}, you don't need to add a constant (it would just multiply everything by a constant). But when integrating the final equation, you MUST include the constant C for the general solution.

Checking Your Answer

Always verify your solution by substituting back into the original equation. Check that:

  • y' + P(x)y actually equals Q(x)
  • The initial condition y(x₀) = y₀ is satisfied
  • The solution approaches the expected equilibrium (if one exists)

Test Your Understanding

Test Your Understanding
Question 1 of 10
Score: 0/0

What is the standard form of a first-order linear differential equation?


Summary

First-order linear differential equations are foundational tools for modeling systems with exponential behavior. The integrating factor method provides a complete, systematic solution procedure.

Key Formulas

ConceptFormula
Standard Formy' + P(x)y = Q(x)
Integrating Factorμ(x) = e^{∫P(x)dx}
General Solutiony = (1/μ)[∫μQ dx + C]
Homogeneous Solutiony_h = Ce^{-∫P dx}
Equilibrium (constant P, Q)y = Q/P
Time Constant (RC circuit)τ = RC

Key Takeaways

  1. First-order linear ODEs have the form y' + P(x)y = Q(x) with P and Q as known functions
  2. The integrating factor method always works: multiply by μ=ePdx\mu = e^{\int P dx} to make the left side an exact derivative
  3. Solutions have the structure y = yh + yp (homogeneous + particular)
  4. The direction field provides geometric insight into solution behavior
  5. Applications include RC circuits, mixing problems, population dynamics, cooling, and more
  6. Gradient descent is discretized gradient flow — the connection to ODEs explains exponential convergence for quadratic objectives
The Integrating Factor Method:
"Multiply by e∫P dx to turn a differential equation into a derivative. Then just integrate!"
Coming Next: In the next section, we'll explore Exact Equations — another class of first-order ODEs that can be solved by recognizing them as total differentials. This generalizes the integrating factor idea in a beautiful way.
Loading comments...