Method of Undetermined Coefficients

Suppose a mass on a spring is pushed not just by its own restoring force. An external engine also produces a force, like 3t23t^2, 5e2t5e^{2t}, or cos⁡(3t)\cos(3t). The homogeneous theory tells us how the system moves on its own. But it says nothing about how it responds to such a push. We need one function that satisfies the full, forced equation. This is called a particular solution. We then add it to the general homogeneous solution to get everything. This matters because forced linear systems are everywhere. Examples include driven oscillators, RLC circuits with an applied voltage, and population models with constant immigration. The Method of Undetermined Coefficients is the fastest tool for finding a particular solution. It works when the forcing term is a polynomial, exponential, sine, cosine, or a product/sum of these. These are the same family of functions that keeps reproducing itself under differentiation. Rather than integrating (as Variation of Parameters does), we guess the shape of the answer up to unknown constants. We then plug into the equation, and solve for those constants by matching coefficients. The big picture is a bridge between algebra and analysis. Differentiating a polynomial, exponential, or sinusoid returns a function in the same finite-dimensional family. This closure property is exactly what makes "guess and match" work. It is also exactly why the method fails for forcing terms like tan⁡t\tan t or 1/t1/t. Their derivatives escape any finite family. Building on Complex and Repeated Roots for the homogeneous side, this article develops the method rigorously. It states the precise dictionary of guesses. It proves why the method succeeds via a clean superposition and derivative-closure argument. It handles the delicate resonance case when the guess overlaps a homogeneous solution. And it works two nontrivial examples end to end. By the end, you will be able to write down the correct trial form for any admissible forcing term. You will be able to justify the "multiply by tst^s" fix for resonance. And you will know precisely when the method must be abandoned in favor of Variation of Parameters.

Key takeaways
  • Solves ay′′+by′+cy=g(t)ay'' + by' + cy = g(t) by guessing ypy_p in the same "family" as g(t)g(t), with unknown coefficients to be found.
  • Works only for g(t)g(t) built from polynomials, exponentials eαte^{\alpha t}, and sinusoids cos⁡βt,sin⁡βt\cos\beta t,\sin\beta t (and their products/sums).
  • If the naive guess solves the homogeneous equation, multiply it by tst^s, where ss is the smallest power making the guess independent of the homogeneous solution.
  • Superposition splits multi-term forcing into separate, simpler subproblems solved and then summed.
  • The general solution is always y=yh+ypy = y_h + y_p, combining Complex and Repeated Roots with the particular piece found here.
  • Key idea: differentiation keeps polynomials, exponentials, and sinusoids inside a fixed finite-dimensional function family, so a finite guess with unknown coefficients can absorb the forcing exactly.

Where this lives today

Driven mechanical and electrical oscillators — a mass-spring-damper system pushed by a periodic force, or an RLC circuit driven by an AC voltage source — are modeled by exactly the constant-coefficient linear ODEs this method solves, with g(t)g(t) typically cos⁡(ωt)\cos(\omega t) or a polynomial ramp. Control engineers use the method to find steady-state responses to step, ramp, and sinusoidal reference inputs before layering on feedback design. In signal processing, the particular solution corresponding to a sinusoidal input directly yields the system's frequency response (magnitude and phase shift), the starting point for Bode-plot analysis. The resonance case — multiplying the guess by tt or t2t^2 — is the mathematical explanation for the amplitude blow-up (or linear-in-tt growth) seen when a forcing frequency matches a natural frequency, a phenomenon engineers must actively design around in bridges, buildings, and RF circuits. In numerical analysis and computer algebra systems, symbolic solvers implement this exact case analysis (checking root multiplicities against α+iβ\alpha+i\beta) as a fast, closed-form alternative to numerically integrating the Variation of Parameters formula whenever the forcing term matches the polynomial-exponential-sinusoidal pattern.

Ask the tutor: How does the resonance case (s=1s=1 or s=2s=2) connect to the repeated-root case in Complex and Repeated Roots, and why does multiplying by tt "fix" both problems in the same algebraic way?

DefinitionMethod of Undetermined Coefficients

Consider the linear, constant-coefficient, second-order ODE

ay′′+by′+cy=g(t),a≠0,a y'' + b y' + c y = g(t), \qquad a \neq 0,

where g(t)g(t) is a finite sum of terms of the form

Pn(t) eαtcos⁡(βt)orPn(t) eαtsin⁡(βt),P_n(t)\, e^{\alpha t}\cos(\beta t) \quad \text{or} \quad P_n(t)\, e^{\alpha t}\sin(\beta t),

with Pn(t)P_n(t) a polynomial of degree nn and α,β∈R\alpha, \beta \in \mathbb{R} constants (the case β=0\beta = 0 recovers pure exponentials and polynomials). The method of undetermined coefficients seeks a particular solution yp(t)y_p(t) by positing a trial function of the same exponential-polynomial-sinusoidal type as g(t)g(t), with unspecified coefficients, then substituting into the differential equation and solving the resulting linear algebraic system for those coefficients. If the naive trial form contains a term that is already a solution of the associated homogeneous equation ay′′+by′+cy=0ay'' + by' + cy = 0, the entire trial function is multiplied by tst^s, where s∈{1,2}s \in \{1, 2\} is the smallest nonnegative integer making the trial function linearly independent from every term in the homogeneous solution yhy_h. The method applies term-by-term to sums g(t)=g1(t)+⋯+gk(t)g(t) = g_1(t) + \cdots + g_k(t) via superposition: solve ay′′+by′+cy=gi(t)ay'' + by' + cy = g_i(t) for each ii separately to get yp,iy_{p,i}, and set yp=yp,1+⋯+yp,ky_p = y_{p,1} + \cdots + y_{p,k}.

Intuition

Think of differentiation as an operator acting on a "library" of function shapes. If g(t)=t2g(t) = t^2, its derivatives are 2t2t, 22, 00 — all polynomials of degree ≤2\le 2. If g(t)=e3tg(t) = e^{3t}, every derivative is a constant multiple of e3te^{3t} itself. If g(t)=cos⁡(2t)g(t) = \cos(2t), differentiating cycles you between cos⁡(2t)\cos(2t) and sin⁡(2t)\sin(2t) and back, never producing anything new. In each case, the set of functions reachable by repeated differentiation is finite-dimensional — spanned by a small, fixed list of building blocks. This is the entire mechanism of the method. Since ayp′′+byp′+cypay_p'' + by_p' + cy_p is a linear combination of ypy_p and its derivatives, if we choose ypy_p from the same finite-dimensional family as g(t)g(t), then the left side automatically lands back in that family too. Matching it to g(t)g(t) becomes solving a small linear system for the unknown coefficients — no integration required. The one subtlety is resonance: if our guessed family already contains a homogeneous solution, the substitution collapses to 0=(stuff)0 = (\text{stuff}) for that piece, so we shift the family up by multiplying by tt (or t2t^2) to break the coincidence, exactly as one uses an extra factor of tt for repeated roots in Complex and Repeated Roots.

Figure
Matching families under differentiation: polynomial, exponential, and sinusoidal forcing each stay inside a fixed small family
Closure of forcing families under d/dt g(t) = 3t² − t span{1, t, t²} d/dt: 3t²→6t−1 d/dt: 6t−1→6 d/dt: 6→0 stays degree ≤ 2 guess: At² + Bt + C g(t) = 5e^(2t) span{e^(2t)} d/dt: e^(2t) → 2e^(2t) multiplies by constant only guess: A e^(2t) (× t if resonant) g(t) = cos(3t) span{cos 3t, sin 3t} d/dt: cos3t → −3sin3t d/dt: sin3t → 3cos3t cycles, never leaves span guess: Acos3t+Bsin3t
TheoremExistence and Correctness of the Undetermined-Coefficients Ansatz

Let a,b,c∈Ra,b,c\in\mathbb{R} with a≠0a\neq 0, and let the characteristic polynomial be p(r)=ar2+br+cp(r) = ar^2+br+c. Let α,β∈R\alpha,\beta\in\mathbb{R}, let n≥0n\ge 0 be an integer, and let g(t)=Pn(t)eαtcos⁡(βt)g(t) = P_n(t)e^{\alpha t}\cos(\beta t) or g(t)=Pn(t)eαtsin⁡(βt)g(t)=P_n(t)e^{\alpha t}\sin(\beta t) where PnP_n has degree nn (if β=0\beta = 0, take only the cosine case, i.e. g(t)=Pn(t)eαtg(t)=P_n(t)e^{\alpha t}). Define s≥0s \ge 0 to be the multiplicity of α+iβ\alpha + i\beta as a root of p(r)=0p(r)=0 (so s∈{0,1,2}s\in\{0,1,2\} for this second-order equation, with s=0s=0 meaning α+iβ\alpha+i\beta is not a root). Then there exist polynomials Qn(t),Rn(t)Q_n(t), R_n(t), each of degree at most nn, such that

yp(t)=tseαt(Qn(t)cos⁡βt+Rn(t)sin⁡βt)y_p(t) = t^{s}e^{\alpha t}\big(Q_n(t)\cos\beta t + R_n(t)\sin\beta t\big)

is a solution of ay′′+by′+cy=g(t)ay'' + by' + cy = g(t).

Proof

We use the method of undetermined coefficients via complexification, which converts the trigonometric case into the exponential case, and then a direct computation for the exponential case using the structure of p(r)p(r).

Step 1: Reduction to the complex exponential case. Write γ=α+iβ∈C\gamma = \alpha + i\beta \in \mathbb{C}. Since

eγt=eαt(cos⁡βt+isin⁡βt),e^{\gamma t} = e^{\alpha t}(\cos\beta t + i \sin \beta t),

both g1(t)=Pn(t)eαtcos⁡βtg_1(t) = P_n(t)e^{\alpha t}\cos\beta t and g2(t)=Pn(t)eαtsin⁡βtg_2(t) = P_n(t)e^{\alpha t}\sin\beta t can be recovered as the real and imaginary parts of G(t):=Pn(t)eγtG(t) := P_n(t) e^{\gamma t}:

g1(t)=Re⁡G(t),g2(t)=Im⁡G(t).g_1(t) = \operatorname{Re} G(t), \qquad g_2(t) = \operatorname{Im} G(t).

Since a,b,ca,b,c are real, if Y(t)=U(t)+iV(t)Y(t) = U(t) + iV(t) (with U,VU,V real-valued) satisfies

aY′′+bY′+cY=G(t),aY'' + bY' + cY = G(t),

then equating real and imaginary parts (using that differentiation and the real linear combination a(⋅)′′+b(⋅)′+c(⋅)a(\cdot)''+b(\cdot)'+c(\cdot) commute with taking real/imaginary parts) gives

aU′′+bU′+cU=Re⁡G(t)=g1(t),aV′′+bV′+cV=Im⁡G(t)=g2(t).aU'' + bU' + cU = \operatorname{Re}G(t) = g_1(t), \qquad aV'' + bV' + cV = \operatorname{Im}G(t) = g_2(t).

So it suffices to solve the single complex equation aY′′+bY′+cY=Pn(t)eγtaY''+bY'+cY = P_n(t)e^{\gamma t} and then take real and imaginary parts; this handles both sinusoidal cases (and the pure polynomial/exponential case is the sub-case β=0\beta=0, γ=α\gamma=\alpha real, where we work directly with real YY).

Step 2: Solving aY′′+bY′+cY=Pn(t)eγtaY'' + bY' + cY = P_n(t) e^{\gamma t}. Try Y(t)=tsW(t)eγtY(t) = t^s W(t) e^{\gamma t} where W(t)=w0+w1t+⋯+wntnW(t) = w_0 + w_1 t + \cdots + w_n t^n is an undetermined polynomial of degree nn and ss is the multiplicity of γ\gamma as a root of p(r)=ar2+br+cp(r) = ar^2+br+c. Substitute Y=tsW(t)eγtY = t^s W(t) e^{\gamma t} into the left side. Using the product rule repeatedly (or the identity below), one computes directly that for any smooth function u(t)u(t),

a(ueγt)′′+b(ueγt)′+c(ueγt)=eγt[au′′+(2aγ+b)u′+(aγ2+bγ+c)u]=eγt[au′′+p′(γ)u′+p(γ)u],a(ue^{\gamma t})'' + b(ue^{\gamma t})' + c(ue^{\gamma t}) = e^{\gamma t}\Big[a u'' + (2a\gamma + b)u' + (a\gamma^2+b\gamma+c)u\Big] = e^{\gamma t}\big[a u'' + p'(\gamma) u' + p(\gamma) u\big],

where p(γ)=aγ2+bγ+cp(\gamma) = a\gamma^2+b\gamma+c and p′(γ)=2aγ+bp'(\gamma) = 2a\gamma+b. This identity follows by direct expansion: with u=u(t)u = u(t),

(ueγt)′=(u′+γu)eγt,(ueγt)′′=(u′′+2γu′+γ2u)eγt,(ue^{\gamma t})' = (u'+\gamma u)e^{\gamma t}, \qquad (ue^{\gamma t})'' = (u''+2\gamma u' + \gamma^2 u)e^{\gamma t},

so

a(ueγt)′′+b(ueγt)′+c(ueγt)=eγt[au′′+(2aγ+b)u′+(aγ2+bγ+c)u],a(ue^{\gamma t})'' + b(ue^{\gamma t})' + c(ue^{\gamma t}) = e^{\gamma t}\Big[a u'' + (2a\gamma+b)u' + (a\gamma^2+b\gamma+c)u\Big],

confirming the claimed identity. Now set u(t)=tsW(t)u(t) = t^s W(t), a polynomial of degree n+sn+s. We consider the three cases dictated by ss. Case s=0s=0 (γ\gamma not a root, so p(γ)≠0p(\gamma)\neq 0). Then u=Wu = W, a degree-nn polynomial, and we need

aW′′+p′(γ)W′+p(γ)W=Pn(t).a W'' + p'(\gamma) W' + p(\gamma) W = P_n(t).

Write W(t)=∑k=0nwktkW(t) = \sum_{k=0}^n w_k t^k. Because p(γ)≠0p(\gamma) \neq 0, the coefficient of tnt^n on the left is p(γ)wnp(\gamma) w_n (the terms W′′W'' and W′W' contribute only degree ≤n−1\le n-1 and ≤n−2\le n-2 respectively), so matching the tnt^n coefficient of Pn(t)P_n(t) determines wnw_n uniquely. Having fixed wnw_n, the coefficient of tn−1t^{n-1} on the left is p(γ)wn−1+(known quantity from wn)p(\gamma)w_{n-1} + (\text{known quantity from } w_n), again solvable uniquely for wn−1w_{n-1} since p(γ)≠0p(\gamma)\neq 0. Proceeding downward by finite induction on the degree k=n,n−1,…,0k = n, n-1, \dots, 0, every wkw_k is uniquely determined. Thus a polynomial WW of degree exactly nn (matching PnP_n) exists solving the equation, and Y=WeγtY = We^{\gamma t} works. Case s=1s=1 (γ\gamma a simple root: p(γ)=0p(\gamma) = 0, p′(γ)≠0p'(\gamma)\neq 0). Then u=tW(t)u = tW(t), degree n+1n+1, and u′′=tW′′+2W′u'' = tW'' + 2W', u′=tW′+Wu' = tW' + W. The equation au′′+p′(γ)u′+p(γ)u=Pn(t)au''+p'(\gamma)u' + p(\gamma)u = P_n(t) becomes, using p(γ)=0p(\gamma)=0,

a(tW′′+2W′)+p′(γ)(tW′+W)=Pn(t),a(tW''+2W') + p'(\gamma)(tW'+W) = P_n(t),

i.e.

atW′′+p′(γ)tW′+2aW′+p′(γ)W=Pn(t).a t W'' + p'(\gamma) t W' + 2aW' + p'(\gamma) W = P_n(t).

Collect by degree: the highest-degree term of W′W' appearing multiplied by tt is p′(γ)tW′p'(\gamma) t W', whose leading contribution to degree nn comes from the degree-(n−1)(n-1) coefficient of W′W' times tt, and since p′(γ)≠0p'(\gamma)\neq 0 this again allows solving degree-by-degree from top to bottom for the coefficients of WW (an ordinary linear triangular system with nonzero diagonal entries p′(γ)p'(\gamma)), exactly as in Case s=0s=0 but shifted by one derivative. A polynomial WW of degree nn exists and is unique. Then Y=tW(t)eγtY = tW(t)e^{\gamma t} solves the equation. Case s=2s=2 (γ\gamma a double root: p(γ)=0p(\gamma)=0 and p′(γ)=2aγ+b=0p'(\gamma) = 2a\gamma + b = 0, which for a monic-normalized real quadratic forces γ=−b/2a\gamma = -b/2a and aγ2+bγ+c=0a\gamma^2+b\gamma+c=0). Then u=t2W(t)u = t^2 W(t), and u′′=t2W′′+4tW′+2Wu'' = t^2 W'' + 4tW' + 2W. Since p(γ)=p′(γ)=0p(\gamma)=p'(\gamma)=0, the equation au′′+p′(γ)u′+p(γ)u=Pn(t)au'' + p'(\gamma)u'+p(\gamma)u = P_n(t) collapses to

a(t2W′′+4tW′+2W)=Pn(t),i.e.at2W′′+4atW′+2aW=Pn(t).a\big(t^2 W'' + 4tW' + 2W\big) = P_n(t), \quad\text{i.e.}\quad a t^2 W'' + 4a t W' + 2aW = P_n(t).

Here the coefficient of tnt^n on the left, from the 2aW2aW term (since t2W′′t^2W'' and 4tW′4tW' only reach degree nn via lower coefficients of WW multiplied up — more precisely by matching top degree nn: 2awn2a w_n is the only degree-nn contribution from 2aW2aW, while t2W′′t^2 W'' contributes at degree nn only through wnw_n via t2⋅n(n−1)wntn−2=n(n−1)wntnt^2 \cdot n(n-1)w_n t^{n-2}= n(n-1)w_n t^n, and 4tW′4tW' contributes 4nwntn4n w_n t^n from the wnw_n term of W′W' as well; summing, the coefficient of tnt^n on the left is a(n(n−1)+4n+2)wn=a(n+1)(n+2)wna\big(n(n-1) + 4n + 2\big) w_n = a(n+1)(n+2) w_n), and since a≠0a\neq 0 and (n+1)(n+2)≠0(n+1)(n+2) \ne 0, this determines wnw_n uniquely. As in the previous cases, proceeding by finite downward induction on degree, since the coefficient multiplying wkw_k at each stage is a(k+1)(k+2)≠0a(k+1)(k+2) \ne 0, every coefficient of WW is uniquely determined. So a degree-nn polynomial WW exists, and Y=t2W(t)eγtY = t^2 W(t) e^{\gamma t} solves the equation.

Step 3: Assembling the real solution. In all cases we have produced Y(t)=tsW(t)eγtY(t) = t^s W(t) e^{\gamma t} solving aY′′+bY′+cY=Pn(t)eγtaY''+bY'+cY = P_n(t)e^{\gamma t}, with WW a (complex, in general) polynomial of degree nn. Write W(t)=Qn(t)+iRn(t)W(t) = Q_n(t) + iR_n(t) with Qn,RnQ_n, R_n real polynomials of degree ≤n\le n (degree exactly nn is not needed for the real decomposition to work — only for WW itself). Then

Y(t)=tseαt(cos⁡βt+isin⁡βt)(Qn(t)+iRn(t))=tseαt[(Qncos⁡βt−Rnsin⁡βt)+i(Qnsin⁡βt+Rncos⁡βt)].Y(t) = t^s e^{\alpha t}(\cos\beta t + i\sin\beta t)(Q_n(t) + iR_n(t)) = t^s e^{\alpha t}\Big[(Q_n\cos\beta t - R_n \sin\beta t) + i(Q_n \sin\beta t + R_n\cos\beta t)\Big].

By Step 1, U(t)=Re⁡Y(t)=tseαt(Qncos⁡βt−Rnsin⁡βt)U(t) = \operatorname{Re}Y(t) = t^s e^{\alpha t}(Q_n\cos\beta t - R_n\sin\beta t) solves aU′′+bU′+cU=g1(t)=Pn(t)eαtcos⁡βtaU''+bU'+cU = g_1(t) = P_n(t)e^{\alpha t}\cos\beta t, and V(t)=Im⁡Y(t)=tseαt(Qnsin⁡βt+Rncos⁡βt)V(t)=\operatorname{Im}Y(t) = t^se^{\alpha t}(Q_n \sin\beta t + R_n\cos\beta t) solves aV′′+bV′+cV=g2(t)aV''+bV'+cV = g_2(t). Relabeling −Rn-R_n as the new RnR_n (or renaming appropriately in the sine case), each of UU and VV has exactly the claimed form

tseαt(Q(t)cos⁡βt+R(t)sin⁡βt)t^s e^{\alpha t}\big(Q(t)\cos\beta t + R(t)\sin\beta t\big)

with Q,RQ, R of degree at most nn. This is precisely the asserted ypy_p for g1g_1 or g2g_2 respectively, completing the proof for a single term gg. ■\blacksquare

∎
CorollarySuperposition for sums of forcing terms

If g(t)=g1(t)+⋯+gk(t)g(t) = g_1(t) + \cdots + g_k(t) with each gig_i of the admissible form in the theorem, and yp,iy_{p,i} solves ay′′+by′+cy=giay''+by'+cy = g_i for each ii, then yp=yp,1+⋯+yp,ky_p = y_{p,1}+\cdots+y_{p,k} solves ay′′+by′+cy=gay''+by'+cy=g.

Proof

By linearity of the operator L[y]=ay′′+by′+cyL[y] = ay''+by'+cy (immediate from linearity of differentiation),

L[yp,1+⋯+yp,k]=L[yp,1]+⋯+L[yp,k]=g1+⋯+gk=g.■L[y_{p,1}+\cdots+y_{p,k}] = L[y_{p,1}]+\cdots+L[y_{p,k}] = g_1+\cdots+g_k = g. \qquad\blacksquare
∎

Worked examples

Example 1 (polynomial forcing with resonance at a repeated root). Solve

y′′−4y′+4y=6t2−2,y(0)=1, y′(0)=0.y'' - 4y' + 4y = 6t^2 - 2, \qquad y(0)=1,\ y'(0)=0.

The characteristic polynomial is p(r)=r2−4r+4=(r−2)2p(r) = r^2-4r+4 = (r-2)^2, giving a repeated root r=2r=2 (see Complex and Repeated Roots), so

yh(t)=c1e2t+c2te2t.y_h(t) = c_1 e^{2t} + c_2 t e^{2t}.

Here g(t)=6t2−2g(t) = 6t^2-2 is a polynomial (α=0,β=0\alpha=0,\beta=0, degree n=2n=2), and γ=α+iβ=0\gamma=\alpha+i\beta = 0 is not a root of p(r)p(r) since p(0)=4≠0p(0)=4\neq 0. So s=0s=0 and we try

yp(t)=At2+Bt+C.y_p(t) = At^2+Bt+C.

Then yp′=2At+By_p' = 2At+B, yp′′=2Ay_p''=2A. Substituting,

2A−4(2At+B)+4(At2+Bt+C)=6t2−2,2A - 4(2At+B) + 4(At^2+Bt+C) = 6t^2-2,
4At2+(−8A+4B)t+(2A−4B+4C)=6t2+0⋅t−2.4At^2 + (-8A+4B)t + (2A-4B+4C) = 6t^2 + 0\cdot t - 2.

Matching coefficients:

  • t2t^2: 4A=6⇒A=324A = 6 \Rightarrow A = \tfrac{3}{2}.
  • t1t^1: −8A+4B=0⇒B=2A=3-8A+4B = 0 \Rightarrow B = 2A = 3.
  • t0t^0: 2A−4B+4C=−2⇒3−12+4C=−2⇒4C=7⇒C=742A-4B+4C = -2 \Rightarrow 3 - 12 + 4C = -2 \Rightarrow 4C = 7 \Rightarrow C = \tfrac{7}{4}.

So yp(t)=32t2+3t+74y_p(t) = \tfrac32 t^2 + 3t + \tfrac74, and the general solution is

y(t)=c1e2t+c2te2t+32t2+3t+74.y(t) = c_1 e^{2t} + c_2 t e^{2t} + \tfrac32 t^2 + 3t + \tfrac74.

Apply initial conditions. y(0)=c1+74=1⇒c1=−34y(0) = c_1 + \tfrac74 = 1 \Rightarrow c_1 = -\tfrac34. Differentiate:

y′(t)=2c1e2t+c2(e2t+2te2t)+3t+3.y'(t) = 2c_1e^{2t} + c_2(e^{2t}+2te^{2t}) + 3t+3.

At t=0t=0: y′(0)=2c1+c2+3=0⇒c2=−3−2c1=−3−2(−34)=−3+32=−32y'(0) = 2c_1 + c_2 + 3 = 0 \Rightarrow c_2 = -3-2c_1 = -3 - 2(-\tfrac34) = -3+\tfrac32 = -\tfrac32.

Final answer:

y(t)=−34e2t−32te2t+32t2+3t+74.y(t) = -\tfrac34 e^{2t} - \tfrac32 t e^{2t} + \tfrac32 t^2 + 3t + \tfrac74.

Check at t=0t=0: y(0)=−34+74=1y(0) = -\tfrac34 + \tfrac74 = 1 ✓. And y′(0)=2(−34)−32+3=−32−32+3=0y'(0) = 2(-\tfrac34) - \tfrac32 + 3 = -\tfrac32-\tfrac32+3=0 ✓.

Example 2 (exponential forcing that collides with a homogeneous root, i.e. true resonance). Solve

y′′−y′−6y=4e3t.y'' - y' - 6y = 4e^{3t}.

Characteristic polynomial p(r)=r2−r−6=(r−3)(r+2)p(r) = r^2-r-6 = (r-3)(r+2), roots r=3, r=−2r=3,\,r=-2, so

yh(t)=c1e3t+c2e−2t.y_h(t) = c_1e^{3t}+c_2e^{-2t}.

Here g(t)=4e3tg(t) = 4e^{3t} has α=3\alpha=3 (real, so γ=3\gamma=3), and γ=3\gamma=3 is a simple root of p(r)p(r) (multiplicity s=1s=1). The naive guess Ae3tAe^{3t} is a homogeneous solution and would give 0=4e3t0=4e^{3t} upon substitution — so we must multiply by tt:

yp(t)=Ate3t.y_p(t) = Ate^{3t}.

Compute derivatives:

yp′=Ae3t+3Ate3t=A(1+3t)e3t,yp′′=3Ae3t+A(3+9t)e3t=A(6+9t)e3t.y_p' = A e^{3t} + 3Ate^{3t} = A(1+3t)e^{3t}, \qquad y_p'' = 3A e^{3t}+ A(3+9t)e^{3t}=A(6+9t)e^{3t}.

Substitute into y′′−y′−6y=4e3ty''-y'-6y = 4e^{3t}:

A(6+9t)e3t−A(1+3t)e3t−6Ate3t=4e3t.A(6+9t)e^{3t} - A(1+3t)e^{3t} - 6Ate^{3t} = 4e^{3t}.

Collect the bracket:

A[(6+9t)−(1+3t)−6t]e3t=A[6+9t−1−3t−6t]e3t=A[5+0⋅t]e3t=5Ae3t.A\big[(6+9t) - (1+3t) - 6t\big]e^{3t} = A\big[6+9t -1-3t-6t\big]e^{3t} = A[5 + 0\cdot t]e^{3t} = 5Ae^{3t}.

(The tt-terms cancel exactly, as they must — this is the algebraic signature that γ=3\gamma=3 was a simple root, confirming s=1s=1 was the right choice and not s=2s=2.) So 5A=4⇒A=455A = 4 \Rightarrow A = \tfrac45.

Particular solution: yp(t)=45te3ty_p(t) = \tfrac45 t e^{3t}, and the general solution is

y(t)=c1e3t+c2e−2t+45te3t.y(t) = c_1e^{3t}+c_2e^{-2t}+\tfrac45 t e^{3t}.

As a check, differentiate yp=45te3ty_p = \tfrac45 t e^{3t} directly: yp′′−yp′−6ypy_p'' - y_p' - 6y_p should equal 4e3t4e^{3t}; substituting A=45A=\tfrac45 into 5Ae3t5Ae^{3t} gives 5⋅45e3t=4e3t5\cdot\tfrac45 e^{3t}=4e^{3t} ✓.

CounterexampleNon-polynomial-exponential-sinusoidal forcing breaks the method

Consider

y′′+y=tan⁡t.y'' + y = \tan t.

Here g(t)=tan⁡tg(t) = \tan t is not of the form Pn(t)eαtcos⁡βtP_n(t)e^{\alpha t}\cos\beta t or Pn(t)eαtsin⁡βtP_n(t) e^{\alpha t}\sin\beta t for any polynomial PnP_n and constants α,β\alpha,\beta: repeated differentiation of tan⁡t\tan t produces sec⁡2t\sec^2 t, then 2sec⁡2ttan⁡t2\sec^2 t\tan t, and so on — an infinite, ever-growing family of distinct trigonometric-rational combinations, never closing up into a finite-dimensional span. There is no finite trial polynomial-exponential-sinusoidal ansatz whose derivatives could ever reproduce tan⁡t\tan t exactly, because tan⁡t\tan t has a pole at t=π/2t=\pi/2 while every function of the admissible form is entire (analytic on all of R\mathbb{R}, indeed all of C\mathbb{C}). Since tan⁡t\tan t is not even defined at t=π/2t=\pi/2, no finite linear combination of polynomials, exponentials, and sinusoids — all of which are smooth and bounded-order near any point — can equal it there or in its neighborhood. Undetermined coefficients gives no candidate ansatz at all; one must instead use Variation of Parameters, which handles arbitrary continuous forcing terms via an integral formula built from yhy_h.

Scope, edge cases & common traps

SituationWhat to do
g(t)g(t) is a sum of admissible termsSolve separately, superpose (Corollary above)
Guessed family overlaps yhy_hMultiply the entire trial function by tst^s (s=1s=1 or 22)
g(t)g(t) has a product like te2tcos⁡3tt e^{2t}\cos 3tUse full ansatz tse2t(Q1(t)cos⁡3t+R1(t)sin⁡3t)t^s e^{2t}(Q_1(t)\cos3t + R_1(t)\sin3t) with Q1,R1Q_1,R_1 linear
g(t)=tan⁡t,sec⁡t,ln⁡t,1/t,…g(t) = \tan t, \sec t, \ln t, 1/t,\dotsMethod inapplicable; use Variation of Parameters
Coefficients of the ODE are not constantMethod inapplicable in general; requires constant coefficients
Forgetting to include both cos⁡\cos and sin⁡\sin in the guess even when gg has only cos⁡\cosAlways include both, since differentiation mixes them

The mathematician behind it

Origins · 1 minLeonhard Euler and how this was discovered
LE
Leonhard Euler
1707–1783 · 18th-century mathematical analysis and mechanics

Euler systematized the solution of linear differential equations with constant coefficients, introducing the characteristic-equation approach and studying particular solutions for polynomial and exponential forcing in the context of mechanics and astronomy. His prolific work across analysis, number theory, and mechanics laid the operational groundwork later formalized as the method of undetermined coefficients, which became a staple of engineering mathematics by the 19th and 20th centuries.

History
- 1739 — Euler develops systematic techniques for linear ODEs with constant coefficients, including particular integrals for polynomial and exponential right-hand sides.
- 1743 — Euler's treatment of the characteristic equation for homogeneous linear ODEs appears in his work on differential equations, the essential precursor to identifying resonance.
- 1822 — Fourier's work on heat conduction popularizes sinusoidal forcing and particular solutions in the context of periodic driving terms.
- 1900s — The method is codified in standard textbook form ("undetermined coefficients") as part of the engineering-mathematics curriculum alongside Variation of Parameters.
- Present — Taught as the standard first tool for constant-coefficient linear ODEs with polynomial/exponential/sinusoidal forcing, in every introductory differential equations course.
Why do we need to check whether the guess overlaps the homogeneous solution?

If the naive guess ypy_p already satisfies ay′′+by′+cy=0ay''+by'+cy=0, then substituting it into the full equation gives L[yp]=0L[y_p] = 0 on the left, which can never equal a nonzero g(t)g(t) on the right — the coefficients would need to satisfy an impossible equation like 0=4e3t0=4e^{3t}. Multiplying by tst^s breaks this collision: as shown in the proof, the extra factor of tt changes the derivative structure so that the leading behavior of L[tsWeγt]L[t^sW e^{\gamma t}] picks up a genuinely nonzero multiple of WW (via p′(γ)p'(\gamma) or 2a2a depending on ss), making the coefficient-matching system solvable. This is the same phenomenon as multiplying by tt for repeated characteristic roots.

Can the method handle forcing terms like t·e^(2t)·sin(3t)?

Yes — this is exactly the general product form covered by the theorem, with α=2\alpha=2, β=3\beta=3, and Pn(t)=tP_n(t)=t (degree n=1n=1). The trial solution is yp=tse2t(Q1(t)cos⁡3t+R1(t)sin⁡3t)y_p = t^s e^{2t}(Q_1(t)\cos3t+R_1(t)\sin3t) where Q1,R1Q_1,R_1 are general linear polynomials q0+q1tq_0+q_1t and r0+r1tr_0+r_1t, and ss is the multiplicity of 2+3i2+3i as a root of the characteristic polynomial (typically s=0s=0 for a real characteristic equation, since 2+3i2+3i is non-real and roots are either real or come in genuinely matching complex-conjugate pairs).

What if g(t) is a constant, like g(t) = 7?

Treat it as the degree-0 polynomial case: P0(t)=7P_0(t) = 7, α=β=0\alpha=\beta=0. The trial solution is yp=tsAy_p = t^s A for a constant AA, where ss is the multiplicity of r=0r=0 as a root of the characteristic polynomial. If c≠0c \neq 0 in ay′′+by′+cy=7ay''+by'+cy=7, then r=0r=0 is not a root (p(0)=c≠0p(0)=c\neq0), so s=0s=0 and yp=Ay_p=A with A=7/cA=7/c. If c=0c=0 (so r=0r=0 is a root), you need s≥1s\ge1; this is the classic "forcing matches a constant homogeneous solution" resonance case.

How does this relate to variation of parameters?

Undetermined coefficients is a shortcut valid only for the specific finite family of forcing terms (polynomial × exponential × sinusoidal), while Variation of Parameters is a general method that works for any continuous forcing term, expressed via an integral formula built from two independent homogeneous solutions. When both apply, undetermined coefficients is usually much faster since it avoids integration entirely. When the forcing term is not of the admissible type — like tan⁡t\tan t, 1/t1/t, or sec⁡t\sec t — only variation of parameters (or other techniques) applies.

Does the method work for higher-order linear equations, not just second order?

Yes, with the natural generalization: the multiplicity ss can now be any nonnegative integer up to the order of the equation, since a root of the characteristic polynomial of an nnth-order equation can have multiplicity up to nn. The trial-function dictionary (polynomial × exponential × sinusoidal, multiplied by tst^s) is unchanged in spirit; only the bookkeeping for possible multiplicities grows, a topic developed further under Higher-Order Linear Equations.

What is the role of complex numbers in the proof, if the final answer is always real?

Complexification is a technical device that unifies the cosine and sine forcing cases into a single exponential computation. Writing cos⁡βt+isin⁡βt=eiβt\cos\beta t + i\sin\beta t = e^{i\beta t} lets us solve one complex equation aY′′+bY′+cY=Pn(t)eγtaY''+bY'+cY=P_n(t)e^{\gamma t} instead of two separate real trigonometric computations. Because the coefficients a,b,ca,b,c are real, taking real and imaginary parts of the complex solution automatically yields two real solutions, one for cosine forcing and one for sine forcing — this trick, using Complex and Repeated Roots machinery, shortens the proof substantially without ever requiring a complex final answer.

Why must the entire trial function be multiplied by t^s, not just part of it?

The resonance issue arises from the exponential-times-polynomial structure as a whole colliding with a homogeneous solution, not from an isolated piece. If only part of the guess were multiplied by tst^s, the identity L[tsWeγt]=eγt[aU′′+p′(γ)U′+p(γ)U]L[t^sWe^{\gamma t}] = e^{\gamma t}[aU''+p'(\gamma)U'+p(\gamma)U] derived in the proof would not apply cleanly, since that identity depends on the entire factor tsW(t)t^sW(t) being treated as a single polynomial u(t)=tsW(t)u(t)=t^sW(t) multiplying eγte^{\gamma t}. Multiplying only a subset of terms breaks the algebra needed to guarantee a nonzero leading coefficient in the matching system.

Before this

Where this leads