1. Home
  2. Explore
  3. Mathematics
  4. First Order ODEs

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

First Order ODEs

First-Order Linear Differential Equations with Constant Coefficients

Introduction and Units

The fundamental equation studied is:

dydt=ay+q(t)\frac{dy}{dt} = a y + q(t)dtdy​=ay+q(t)

This is a linear, first-order differential equation with constant coefficient aaa. The variable y(t)→y(t) \rightarrowy(t)→ dependent, t→t \rightarrowt→ independent (time). q(t)q(t)q(t) is the source term (input), representing external influences.

Units check: If yyy is bank balance (dollars) and ttt is time (years), then each term has units dollars/year. The coefficient aaa (interest rate) has units 1/year (e.g., 6% per year = 0.06/yr). The source q(t)q(t)q(t) represents deposits or withdrawals, also in dollars/year.

This model assumes continuous interest and continuous deposits/withdrawals. If we change the time unit (e.g., to months), aaa changes accordingly (e.g., 0.5% per month).

General Solution Strategy: Particular + Null (Homogeneous)

For linear differential equations, the general solution is the sum of:

  • A particular solution yp(t)y_p(t)yp​(t) – one specific solution to the full equation.

  • The general null solution yn(t)y_n(t)yn​(t) – the solution to the associated homogeneous (null) equation dydt=ay\frac{dy}{dt} = a ydtdy​=ay.

Why this works: linearity. If ypy_pyp​ solves dypdt=ayp+q\frac{dy_p}{dt} = a y_p + qdtdyp​​=ayp​+q and yny_nyn​ solves dyndt=ayn\frac{dy_n}{dt} = a y_ndtdyn​​=ayn​, then yp+yny_p + y_nyp​+yn​ solves the original equation. This is because:

ddt(yp+yn)=a(yp+yn)+q\frac{d}{dt}(y_p + y_n) = a(y_p + y_n) + qdtd​(yp​+yn​)=a(yp​+yn​)+q

Nonlinear terms (like y2y^2y2) would break this addition property.

Null (Homogeneous) Solution

The null equation dydt=ay\frac{dy}{dt} = a ydtdy​=ay has solution:

yn(t)=Ceaty_n(t) = C e^{a t}yn​(t)=Ceat

where CCC is an arbitrary constant (determined by initial condition). This is because ddteat=aeat\frac{d}{dt}e^{at} = a e^{at}dtd​eat=aeat. Multiplication by any constant preserves the solution due to linearity.

Particular Solution

Finding ypy_pyp​ depends on the form of q(t)q(t)q(t). A powerful approach: method of undetermined coefficients – assume ypy_pyp​ has the same functional form as q(t)q(t)q(t) (constant, exponential, polynomial, sine/cosine, etc.) and solve for the coefficients.

The full solution is y(t)=yn(t)+yp(t)y(t) = y_n(t) + y_p(t)y(t)=yn​(t)+yp​(t). The constant CCC is then fixed by the initial condition y(0)=y0y(0) = y_0y(0)=y0​.


Example 1: Constant Source Term

Solve: dydt=ay+1\frac{dy}{dt} = a y + 1dtdy​=ay+1 with y(0)=y0y(0) = y_0y(0)=y0​.

  • Null solution: yn=Ceaty_n = C e^{a t}yn​=Ceat

  • Particular solution: Since the source is a constant, look for a constant yp=ky_p = kyp​=k (constant). Substituting: 0=ak+1⇒k=−1a0 = a k + 1 \Rightarrow k = -\frac{1}{a}0=ak+1⇒k=−a1​. So yp=−1ay_p = -\frac{1}{a}yp​=−a1​.

  • General solution: y(t)=Ceat−1ay(t) = C e^{a t} - \frac{1}{a}y(t)=Ceat−a1​

  • Apply initial condition: y(0)=C−1a=y0⇒C=y0+1ay(0) = C - \frac{1}{a} = y_0 \Rightarrow C = y_0 + \frac{1}{a}y(0)=C−a1​=y0​⇒C=y0​+a1​

  • Final solution:

    y(t)=(y0+1a)eat−1a=y0eat+1a(eat−1)y(t) = \left(y_0 + \frac{1}{a}\right) e^{a t} - \frac{1}{a} = y_0 e^{a t} + \frac{1}{a}\left(e^{a t} - 1\right)y(t)=(y0​+a1​)eat−a1​=y0​eat+a1​(eat−1)

The first term y0eaty_0 e^{a t}y0​eat is the growth of the initial deposit. The second term represents the accumulation of the constant deposit rate over time.


Example 2: Exponential Source Term

Solve: dydt=ay+est\frac{dy}{dt} = a y + e^{s t}dtdy​=ay+est with s≠as \neq as=a.

  • Null solution: yn=Ceaty_n = C e^{a t}yn​=Ceat

  • Particular solution: Assume yp=Yesty_p = Y e^{s t}yp​=Yest. Substitute:

    ddt(Yest)=sYest=aYest+est\frac{d}{dt}(Y e^{s t}) = s Y e^{s t} = a Y e^{s t} + e^{s t}dtd​(Yest)=sYest=aYest+est
    sY=aY+1⇒Y(s−a)=1⇒Y=1s−as Y = a Y + 1 \Rightarrow Y(s - a) = 1 \Rightarrow Y = \frac{1}{s - a}sY=aY+1⇒Y(s−a)=1⇒Y=s−a1​
  • Particular solution: yp=1s−aesty_p = \frac{1}{s - a} e^{s t}yp​=s−a1​est

  • General solution: y(t)=Ceat+ests−ay(t) = C e^{a t} + \frac{e^{s t}}{s - a}y(t)=Ceat+s−aest​

  • Apply initial condition y(0)=y0y(0)=y_0y(0)=y0​: y0=C+1s−a⇒C=y0−1s−ay_0 = C + \frac{1}{s-a} \Rightarrow C = y_0 - \frac{1}{s-a}y0​=C+s−a1​⇒C=y0​−s−a1​

  • Final solution:

    y(t)=(y0−1s−a)eat+ests−ay(t) = \left(y_0 - \frac{1}{s-a}\right) e^{a t} + \frac{e^{s t}}{s - a}y(t)=(y0​−s−a1​)eat+s−aest​

Key concept – Transfer function: The factor 1s−a\frac{1}{s - a}s−a1​ is the transfer function (or exponential response factor). It describes how the system amplifies an exponential input. If sss is close to aaa, the response becomes large (near-resonance).

Resonance Case: s=as = as=a

When the input exponent equals the natural exponent (s=as = as=a), the formula above gives a division by zero. The particular solution changes form: look for yp=Kteaty_p = K t e^{a t}yp​=Kteat. This is the resonance case, where the forcing function drives the system at its natural frequency, leading to unbounded growth (in the linear model). The solution involves a term proportional to teatt e^{a t}teat.


Example 3: Step Function Source

Solve: dydt=ay+H(t−T)\frac{dy}{dt} = a y + H(t - T)dtdy​=ay+H(t−T), where HHH is the Heaviside step function:

H(t−T)={0t<T1t≥TH(t - T) = \begin{cases} 0 & t < T \\ 1 & t \ge T \end{cases}H(t−T)={01​t<Tt≥T​

The step function switches on at t=Tt = Tt=T.

  • For 0≤t<T0 \le t < T0≤t<T: Source is 0. So the solution is just the null solution from initial condition: y(t)=y0eaty(t) = y_0 e^{a t}y(t)=y0​eat.

  • For t≥Tt \ge Tt≥T: Source is 1 (constant). The solution for a constant source starting at time TTT (instead of 0) is analogous to Example 1, but shifted in time. The full solution is:

    y(t)=y0eat+1a(ea(t−T)−1)H(t−T)y(t) = y_0 e^{a t} + \frac{1}{a} \left( e^{a(t - T)} - 1 \right) H(t - T)y(t)=y0​eat+a1​(ea(t−T)−1)H(t−T)

This shows the superposition principle: the response to a delayed step is a delayed version of the step response.


Example 4: Delta Function (Impulse) Source

Solve: dydt=ay+δ(t−T)\frac{dy}{dt} = a y + \delta(t - T)dtdy​=ay+δ(t−T), where δ\deltaδ is the Dirac delta function (impulse).

What is the Delta Function?

The delta function δ(t)\delta(t)δ(t) is not an ordinary function. It can be thought of as the derivative of the step function: δ(t)=H′(t)\delta(t) = H'(t)δ(t)=H′(t). Its defining property is given through integration:

∫−∞∞f(t)δ(t−T) dt=f(T)\int_{-\infty}^{\infty} f(t) \delta(t - T) \, dt = f(T)∫−∞∞​f(t)δ(t−T)dt=f(T)

for sufficiently smooth fff. In particular, ∫−∞∞δ(t) dt=1\int_{-\infty}^{\infty} \delta(t) \, dt = 1∫−∞∞​δ(t)dt=1 and δ(t)=0\delta(t) = 0δ(t)=0 for t≠0t \neq 0t=0.

It models an instantaneous impulse (e.g., a bat hitting a ball, a sudden deposit). It is defined by its integral (area) rather than pointwise values.

Key integral property:

∫abf(t)δ(t−T) dt={f(T)if a<T<b0otherwise\int_{a}^{b} f(t) \delta(t - T) \, dt = \begin{cases} f(T) & \text{if } a < T < b \\ 0 & \text{otherwise} \end{cases}∫ab​f(t)δ(t−T)dt={f(T)0​if a<T<botherwise​

For example:

  • ∫−∞∞etδ(t) dt=e0=1\int_{-\infty}^{\infty} e^{t} \delta(t) \, dt = e^{0} = 1∫−∞∞​etδ(t)dt=e0=1

  • ∫−∞∞sin⁡t δ(t) dt=sin⁡0=0\int_{-\infty}^{\infty} \sin t \, \delta(t) \, dt = \sin 0 = 0∫−∞∞​sintδ(t)dt=sin0=0

Note: Squaring the delta function δ(t)2\delta(t)^2δ(t)2 is not well-defined (infinite energy) and is avoided in practice.

Solving the Impulse Equation

Solve dydt=ay+δ(t−T)\frac{dy}{dt} = a y + \delta(t - T)dtdy​=ay+δ(t−T) with y(0)=y0y(0) = y_0y(0)=y0​.

  • For t<Tt < Tt<T: The impulse hasn't occurred yet. Source is 0, so y(t)=y0eaty(t) = y_0 e^{a t}y(t)=y0​eat (null solution from initial condition).

  • At t=Tt = Tt=T: The impulse instantly adds 1 to the balance (like a lump-sum deposit of 1). This can be seen by integrating the equation over an infinitesimal interval around TTT: ∫T−T+dydtdt=∫T−T+(ay)dt+∫T−T+δ(t−T)dt\int_{T^-}^{T^+} \frac{dy}{dt} dt = \int_{T^-}^{T^+} (a y) dt + \int_{T^-}^{T^+} \delta(t-T) dt∫T−T+​dtdy​dt=∫T−T+​(ay)dt+∫T−T+​δ(t−T)dt. The left side is y(T+)−y(T−)y(T^+) - y(T^-)y(T+)−y(T−). The aya yay integral is negligible over an infinitesimal interval (assuming yyy finite). The delta integral is 1. Hence y(T+)=y(T−)+1y(T^+) = y(T^-) + 1y(T+)=y(T−)+1.

  • For t>Tt > Tt>T: After the impulse, the source is 0 again. The solution evolves from the new initial condition y(T+)=y0eaT+1y(T^+) = y_0 e^{a T} + 1y(T+)=y0​eaT+1, following the homogeneous equation: y(t)=(y0eaT+1)ea(t−T)=y0eat+ea(t−T)y(t) = (y_0 e^{a T} + 1) e^{a(t - T)} = y_0 e^{a t} + e^{a(t - T)}y(t)=(y0​eaT+1)ea(t−T)=y0​eat+ea(t−T).

  • Final solution (written compactly):

    y(t)=y0eat+H(t−T)ea(t−T)y(t) = y_0 e^{a t} + H(t - T) e^{a(t - T)}y(t)=y0​eat+H(t−T)ea(t−T)

    where H(t−T)H(t-T)H(t−T) is the step function (so the second term is zero for t<Tt<Tt<T).

The impulse response (response to δ(t)\delta(t)δ(t) with zero initial condition) is eatH(t)e^{a t} H(t)eatH(t).

The impulse response is of fundamental importance because it can be used to construct the solution for any source via convolution (as we will see in the general formula).


The General Solution Formula (Integral)

For the general equation dydt=ay+q(t)\frac{dy}{dt} = a y + q(t)dtdy​=ay+q(t) with y(0)=y0y(0) = y_0y(0)=y0​, the solution can be written as:

y(t)=y0eat+∫0tea(t−s)q(s) dsy(t) = y_0 e^{a t} + \int_{0}^{t} e^{a(t - s)} q(s) \, dsy(t)=y0​eat+∫0t​ea(t−s)q(s)ds

Why is this formula correct? It comes from the idea of superposition:

  • The first term y0eaty_0 e^{a t}y0​eat is the growth of the initial condition.

  • The integral accounts for all later inputs: at each time sss, a deposit q(s) dsq(s) \, dsq(s)ds occurs. That deposit then grows for the remaining time (t−s)(t - s)(t−s) by a factor ea(t−s)e^{a(t - s)}ea(t−s). Summing over all sss from 0 to ttt gives the integral.

This formula can be verified by differentiating with respect to ttt (using Leibniz rule) and checking that it satisfies the differential equation. It also subsumes all previous examples:

  • For q(s)=1q(s) = 1q(s)=1 constant: ∫0tea(t−s)ds=1a(eat−1)\int_0^t e^{a(t-s)} ds = \frac{1}{a}(e^{a t} - 1)∫0t​ea(t−s)ds=a1​(eat−1).

  • For q(s)=essq(s) = e^{s s}q(s)=ess: ∫0tea(t−s)essds=eat∫0te(s−a)sds=eat⋅e(s−a)t−1s−a=est−eats−a\int_0^t e^{a(t-s)} e^{s s} ds = e^{a t} \int_0^t e^{(s-a)s} ds = e^{a t} \cdot \frac{e^{(s-a)t} - 1}{s-a} = \frac{e^{s t} - e^{a t}}{s-a}∫0t​ea(t−s)essds=eat∫0t​e(s−a)sds=eat⋅s−ae(s−a)t−1​=s−aest−eat​.

  • For q(s)=δ(s−T)q(s) = \delta(s - T)q(s)=δ(s−T): ∫0tea(t−s)δ(s−T)ds=ea(t−T)H(t−T)\int_0^t e^{a(t-s)} \delta(s-T) ds = e^{a(t-T)} H(t-T)∫0t​ea(t−s)δ(s−T)ds=ea(t−T)H(t−T).

The integral formula is a particular solution plus the homogeneous part; it already incorporates the initial condition correctly.


Example 5: Cosine Source (Real Approach)

Solve: dydt=ay+cos⁡t\frac{dy}{dt} = a y + \cos tdtdy​=ay+cost (with ω=1\omega = 1ω=1 for simplicity).

Since the source is a real cosine, the particular solution will involve both cos⁡t\cos tcost and sin⁡t\sin tsint, because derivatives of cosine produce sine. Assume:

yp(t)=Mcos⁡t+Nsin⁡ty_p(t) = M \cos t + N \sin typ​(t)=Mcost+Nsint

Substitute into the equation:

  • Left side: yp′=−Msin⁡t+Ncos⁡ty_p' = -M \sin t + N \cos typ′​=−Msint+Ncost

  • Right side: ayp+cos⁡t=aMcos⁡t+aNsin⁡t+cos⁡ta y_p + \cos t = a M \cos t + a N \sin t + \cos tayp​+cost=aMcost+aNsint+cost

Match coefficients of cos⁡t\cos tcost and sin⁡t\sin tsint separately:

  • Cosine terms: N=aM+1N = a M + 1N=aM+1

  • Sine terms: −M=aN-M = a N−M=aN

Solve these two linear equations: From the sine equation: M=−aNM = -a NM=−aN. Substitute into cosine equation: N=a(−aN)+1=−a2N+1⇒N(1+a2)=1⇒N=11+a2N = a(-a N) + 1 = -a^2 N + 1 \Rightarrow N(1 + a^2) = 1 \Rightarrow N = \frac{1}{1 + a^2}N=a(−aN)+1=−a2N+1⇒N(1+a2)=1⇒N=1+a21​ Then M=−aN=−a1+a2M = -a N = -\frac{a}{1 + a^2}M=−aN=−1+a2a​.

Thus the particular solution is:

yp(t)=−a1+a2cos⁡t+11+a2sin⁡ty_p(t) = -\frac{a}{1 + a^2} \cos t + \frac{1}{1 + a^2} \sin typ​(t)=−1+a2a​cost+1+a21​sint

The full general solution is y(t)=Ceat+yp(t)y(t) = C e^{a t} + y_p(t)y(t)=Ceat+yp​(t), and CCC is determined by the initial condition. This method works but is algebraically more involved than using complex exponentials.


Preview: Complex Exponential Method

An alternative and more efficient way to handle cosine and sine sources is to use complex exponentials. Instead of solving dydt=ay+cos⁡t\frac{dy}{dt} = a y + \cos tdtdy​=ay+cost, solve:

dydt=ay+eit\frac{dy}{dt} = a y + e^{i t}dtdy​=ay+eit

(where eit=cos⁡t+isin⁡te^{i t} = \cos t + i \sin teit=cost+isint). Assume a particular solution of the form yp=Yeity_p = Y e^{i t}yp​=Yeit. Substituting:

iYeit=aYeit+eit⇒Y=1i−ai Y e^{i t} = a Y e^{i t} + e^{i t} \Rightarrow Y = \frac{1}{i - a}iYeit=aYeit+eit⇒Y=i−a1​

Thus yp(t)=1i−aeity_p(t) = \frac{1}{i - a} e^{i t}yp​(t)=i−a1​eit. The real part of this complex solution gives the particular solution for the cos⁡t\cos tcost source; the imaginary part gives the particular solution for the sin⁡t\sin tsint source. This method simplifies the algebra, especially for higher-order equations, and naturally incorporates the phase shift and amplitude of the response. This approach will be developed further in subsequent lectures.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent