Unit 4, lesson 22

Undetermined Coefficients

How the method of undetermined coefficients finds a particular solution from a trial function, why overlap multiplicity adds powers of t, and how annihilators explain the trial family.

  • Video 22
  • Particular Solutions of Forced Equations

Which function y(t)y(t) satisfies y′′−2y′+y=ety'' - 2y' + y = e^t? The natural guess AetAe^t fails for every constant AA, because the left side sends every multiple of ete^t to zero, and the next guess AtetAte^t fails for the same reason. This lesson shows how to choose a trial function when the forcing is built from polynomials, exponentials, sines and cosines, how many factors of tt an overlap with the homogeneous solutions requires, and how an annihilator explains both rules. Throughout, tt is the independent variable, a prime means d/dtd/dt, and DD stands for the operator d/dtd/dt.

Key terms

Complementary and particular solutions

Definition Let L[y]=gL[y] = g be a linear equation of order nn on an open interval II on which the leading coefficient never vanishes and the other coefficients and the forcing gg, divided by it, are continuous. The complementary solution is the general solution of the homogeneous equation L[y]=0L[y] = 0,

yc=C1y1+⋯+Cnyn,y_c = C_1y_1 + \cdots + C_ny_n,

where y1,…,yny_1, \ldots, y_n is a fundamental set of solutions on II and C1,…,CnC_1, \ldots, C_n are arbitrary constants. A particular solution ypy_p is any one function with L[yp]=gL[y_p] = g on II. Every solution of L[y]=gL[y] = g on II equals yc+ypy_c + y_p for exactly one choice of the constants, because the difference of two solutions of the forced equation solves the homogeneous one. Initial conditions are imposed on the sum yc+ypy_c + y_p, never on ycy_c alone. In this lesson the operator has constant coefficients,

L=anDn+⋯+a1D+a0,L = a_nD^n + \cdots + a_1D + a_0,

with real numbers a0,…,ana_0, \ldots, a_n and an≠0a_n \ne 0, so every interval on which gg is continuous qualifies. Its characteristic polynomial is P(r)=anrn+⋯+a1r+a0P(r) = a_nr^n + \cdots + a_1r + a_0, and L[ert]=P(r) ertL[e^{rt}] = P(r)\,e^{rt}.

In plain words The complementary part is everything the equation allows with no input, and it carries all the free constants. The particular part is one response to the input. Two particular solutions differ by a member of the complementary family, so it does not matter which one you find.

Example For y′′−3y′+2y=4y'' - 3y' + 2y = 4 the characteristic polynomial is r2−3r+2=(r−1)(r−2)r^2 - 3r + 2 = (r - 1)(r - 2), so yc=C1et+C2e2ty_c = C_1e^t + C_2e^{2t}. The constant function yp=2y_p = 2 is a particular solution, since its derivatives vanish and 2⋅2=42 \cdot 2 = 4. To meet y(0)=0y(0) = 0 and y′(0)=0y'(0) = 0, apply the data to y=C1et+C2e2t+2y = C_1e^t + C_2e^{2t} + 2. This gives C1+C2+2=0C_1 + C_2 + 2 = 0 and C1+2C2=0C_1 + 2C_2 = 0, so C1=−4C_1 = -4, C2=2C_2 = 2 and

y=−4et+2e2t+2.y = -4e^t + 2e^{2t} + 2.

Fitting the data to ycy_c alone would give C1=C2=0C_1 = C_2 = 0, and adding ypy_p afterward would produce the constant function 22, which starts at the wrong height.

Method of undetermined coefficients

Definition The method of undetermined coefficients finds a particular solution of L[y]=gL[y] = g when LL has constant coefficients and gg is a finite linear combination of terms tkeαtcos⁡βtt^ke^{\alpha t}\cos\beta t and tkeαtsin⁡βtt^ke^{\alpha t}\sin\beta t, with kk a nonnegative integer, α\alpha real and β≥0\beta \ge 0. Polynomials, exponentials, sines, cosines and their products are all of this kind, and so are their derivatives. The method has four steps.

  1. Find ycy_c from the roots of the characteristic polynomial.
  2. Write a trial function with unknown coefficients for each forcing term, including the overlap correction described below.
  3. Substitute the trial into L[y]=gL[y] = g and equate the coefficients of each function tjeαtcos⁡βtt^je^{\alpha t}\cos\beta t and tjeαtsin⁡βtt^je^{\alpha t}\sin\beta t on the two sides.
  4. Solve the resulting linear system for the coefficients, then add ycy_c and apply any initial data to the sum.

With the trial chosen by the rules of the next two cards, this linear system always has exactly one solution. The coefficients are fixed by the equation, unlike the constants in ycy_c, which are fixed by initial data. The method does not cover forcing such as ln⁡t\ln t, tan⁡t\tan t or sec⁡t\sec t, whose derivatives do not stay inside the span of any finite set of functions, and it does not cover equations with variable coefficients. Those equations still have solutions, and variation of parameters finds them.

In plain words Guess the shape of the answer from the shape of the forcing, and let the equation decide the numbers. This works because differentiating a polynomial, an exponential, a sine or a cosine only produces more functions of the same kinds.

Example Take y′′+y′−2y=4t2y'' + y' - 2y = 4t^2. The characteristic roots are 11 and −2-2, neither of them 00, and the forcing is a quadratic, so try yp=At2+Bt+Cy_p = At^2 + Bt + C. With yp′=2At+By_p' = 2At + B and yp′′=2Ay_p'' = 2A,

L[yp]=−2At2+(2A−2B) t+(2A+B−2C).\begin{aligned} L[y_p] &= -2At^2 \\[0.4em] &\quad + (2A - 2B)\,t \\[0.4em] &\quad + (2A + B - 2C). \end{aligned}

Matching this with 4t24t^2 gives −2A=4-2A = 4, 2A−2B=02A - 2B = 0 and 2A+B−2C=02A + B - 2C = 0, so A=−2A = -2, B=−2B = -2, C=−3C = -3 and

yp=−2t2−2t−3.y_p = -2t^2 - 2t - 3.

Substituting back confirms it, since −4+(−4t−2)−2(−2t2−2t−3)=4t2-4 + (-4t - 2) - 2(-2t^2 - 2t - 3) = 4t^2. The shorter trial At2At^2 fails, because its output −2At2+2At+2A-2At^2 + 2At + 2A would need −2A=4-2A = 4 and 2A=02A = 0 at the same time.

Trial function

Definition For a forcing term tkeαtcos⁡βtt^ke^{\alpha t}\cos\beta t or tkeαtsin⁡βtt^ke^{\alpha t}\sin\beta t with β≠0\beta \ne 0, the trial function is

yp=tmeαt[A(t)cos⁡βt+B(t)sin⁡βt],\begin{aligned} y_p = t^me^{\alpha t}\big[&A(t)\cos\beta t \\[0.4em] &+ B(t)\sin\beta t\big], \end{aligned}

where A(t)=A0+A1t+⋯+AktkA(t) = A_0 + A_1t + \cdots + A_kt^k and B(t)=B0+B1t+⋯+BktkB(t) = B_0 + B_1t + \cdots + B_kt^k have unknown coefficients and mm is the overlap multiplicity of the next card. For a term tkeαtt^ke^{\alpha t}, the case β=0\beta = 0, the trial is tmeαtA(t)t^me^{\alpha t}A(t). Both polynomials contain every power from t0t^0 to tkt^k, and the cosine and the sine both appear even when the forcing contains only one of them. Forcing terms with the same α\alpha and β\beta share one trial, whose degree is the largest kk among them. Terms with different α\alpha or β\beta get separate trials, and by superposition the particular solutions found for them are added. When m=0m = 0 the common cases look like this.

Forcing termTrial when m=0m = 0
5t2−15t^2 - 1At2+Bt+CAt^2 + Bt + C
3e−2t3e^{-2t}Ae−2tAe^{-2t}
sin⁡4t\sin 4tAcos⁡4t+Bsin⁡4tA\cos 4t + B\sin 4t
tette^{t}(At+B) et(At + B)\,e^{t}
etcos⁡2te^{t}\cos 2tet(Acos⁡2t+Bsin⁡2t)e^{t}(A\cos 2t + B\sin 2t)

In plain words The trial has to contain every function that differentiation can produce from the forcing. Differentiating lowers powers of tt and turns a cosine into a sine and a sine into a cosine, so the lower powers and the partner function belong in the trial from the start.

Example For y′′+4y=t+e−ty'' + 4y = t + e^{-t} the characteristic roots are ±2i\pm 2i, so neither tt nor e−te^{-t} overlaps with yc=C1cos⁡2t+C2sin⁡2ty_c = C_1\cos 2t + C_2\sin 2t. The term tt gets the trial At+BAt + B, and L[At+B]=4At+4BL[At + B] = 4At + 4B, so A=14A = \tfrac14 and B=0B = 0. The term e−te^{-t} gets the trial Ce−tCe^{-t}, and L[Ce−t]=(1+4) Ce−tL[Ce^{-t}] = (1 + 4)\,Ce^{-t}, so C=15C = \tfrac15. Adding the two pieces gives

yp=t4+e−t5.y_p = \frac{t}{4} + \frac{e^{-t}}{5}.

The constant BB came out zero, but it still belonged in the trial, since nothing tells you in advance that it vanishes.

Overlap multiplicity

Definition For a forcing term with exponent α\alpha and frequency β\beta, let λ=α+iβ\lambda = \alpha + i\beta. The overlap multiplicity mm is the multiplicity of λ\lambda as a root of the characteristic polynomial PP, with m=0m = 0 when P(λ)≠0P(\lambda) \ne 0. Because PP has real coefficients, the conjugate λˉ\bar{\lambda} has the same multiplicity, so one value of mm serves for the cosine and the sine. The whole trial is multiplied by tmt^m, and no lower powers are added back. The reason is the shift identity

(D−λ)(eλtf)=eλtf′,(D - \lambda)\big(e^{\lambda t}f\big) = e^{\lambda t}f',

which holds for every differentiable function ff, complex values allowed. Write P(r)=(r−λ)mQ(r)P(r) = (r - \lambda)^mQ(r) with Q(λ)≠0Q(\lambda) \ne 0. The mm factors D−λD - \lambda differentiate the polynomial factor mm times, so they send eλte^{\lambda t} times any polynomial of degree less than mm to zero. The factor tmt^m lifts the trial polynomial above that range, and the image under LL is then eλte^{\lambda t} times a polynomial of the same degree kk as in the forcing.

In plain words If part of the trial already solves the homogeneous equation, the operator turns that part into zero, and no coefficient can make zero equal the forcing. Multiplying the trial by tmt^m, where mm counts how often λ\lambda occurs as a root, moves it out of the complementary family. This is the algebra behind resonance.

Example Return to y′′−2y′+y=ety'' - 2y' + y = e^t, now with y(0)=0y(0) = 0 and y′(0)=1y'(0) = 1. Here P(r)=(r−1)2P(r) = (r - 1)^2, so λ=1\lambda = 1 has m=2m = 2 and yc=(C1+C2t) ety_c = (C_1 + C_2t)\,e^t. The trials AetAe^t and AtetAte^t both lie in ycy_c, and LL sends them to zero. The corrected trial At2etAt^2e^t works, because the two factors D−1D - 1 differentiate At2At^2 twice,

(D−1)2(At2et)=2Aet,(D - 1)^2\big(At^2e^t\big) = 2Ae^t,

so 2A=12A = 1 and A=12A = \tfrac12. The general solution is y=(C1+C2t+12t2) ety = (C_1 + C_2t + \tfrac12t^2)\,e^t. The data give C1=0C_1 = 0 and C1+C2=1C_1 + C_2 = 1, so C2=1C_2 = 1 and

y=et(t+12t2).y = e^t\left(t + \tfrac{1}{2}t^2\right).

The coefficient 12\tfrac12 is fixed by the forcing. It is not a third free constant.

Annihilator method

Definition A nonzero constant-coefficient operator M(D)M(D) annihilates a function gg on an interval if M(D) g=0M(D)\,g = 0 there. The operator Dk+1D^{k+1} annihilates every polynomial of degree at most kk, the operator (D−α)k+1(D - \alpha)^{k+1} annihilates tjeαtt^je^{\alpha t} for 0≤j≤k0 \le j \le k, and the operator

(D2−2αD+α2+β2)k+1\left(D^2 - 2\alpha D + \alpha^2 + \beta^2\right)^{k+1}

annihilates tjeαtcos⁡βtt^je^{\alpha t}\cos\beta t and tjeαtsin⁡βtt^je^{\alpha t}\sin\beta t for 0≤j≤k0 \le j \le k. If M(D) g=0M(D)\,g = 0, applying M(D)M(D) to both sides of L[y]=gL[y] = g shows that every solution also solves the homogeneous equation M(D)L[y]=0M(D)L[y] = 0, whose characteristic polynomial is M(r)P(r)M(r)P(r). The basis functions of this larger equation that are not already in the basis of ycy_c form the trial function, with the overlap powers of tt built in. The larger equation is necessary but not sufficient, so the coefficients must still come from substituting into L[y]=gL[y] = g. No nonzero constant-coefficient operator annihilates ln⁡t\ln t or tan⁡t\tan t, which is why the method stops at the class of forcing described above.

In plain words Find an operator that wipes out the forcing and apply it to both sides. The result is a homogeneous equation that the characteristic roots already solve, its new solutions are the trial, and the original equation then fixes their coefficients.

Example For y′′−2y′+y=ety'' - 2y' + y = e^t, the operator D−1D - 1 annihilates ete^t. Every solution therefore satisfies (D−1)3y=0(D - 1)^3y = 0, whose solutions are (C1+C2t+C3t2) et(C_1 + C_2t + C_3t^2)\,e^t. The new basis function is t2ett^2e^t, which is the trial found above with m=2m = 2. Substituting C3t2etC_3t^2e^t into the original equation gives 2C3et=et2C_3e^t = e^t, so C3=12C_3 = \tfrac12. A function such as (1+t+5t2) et(1 + t + 5t^2)\,e^t solves the larger equation, but LL sends it to 10et10e^t, so it does not solve the original one.

Check yourself

  1. Find a particular solution of y′′+3y′+2y=10sin⁡ty'' + 3y' + 2y = 10\sin t, and explain why the trial Bsin⁡tB\sin t alone fails.
Show the answer

The characteristic roots are −1-1 and −2-2, so ±i\pm i are not roots and m=0m = 0. Try yp=Acos⁡t+Bsin⁡ty_p = A\cos t + B\sin t. Then yp′=−Asin⁡t+Bcos⁡ty_p' = -A\sin t + B\cos t and yp′′=−Acos⁡t−Bsin⁡ty_p'' = -A\cos t - B\sin t, so

L[yp]=(A+3B)cos⁡t+(B−3A)sin⁡t.\begin{aligned} L[y_p] &= (A + 3B)\cos t \\[0.4em] &\quad + (B - 3A)\sin t. \end{aligned}

Matching with 10sin⁡t10\sin t gives A+3B=0A + 3B = 0 and B−3A=10B - 3A = 10, so B=1B = 1, A=−3A = -3 and

yp=sin⁡t−3cos⁡t.y_p = \sin t - 3\cos t.

The trial Bsin⁡tB\sin t alone gives L[Bsin⁡t]=Bsin⁡t+3Bcos⁡tL[B\sin t] = B\sin t + 3B\cos t, which would need 3B=03B = 0 and B=10B = 10 at once. The derivative of the sine produces a cosine, so the cosine has to be in the trial.

  1. Find a particular solution of y′′+4y=8sin⁡2ty'' + 4y = 8\sin 2t.
Show the answer

The roots of r2+4r^2 + 4 are ±2i\pm 2i, and λ=2i\lambda = 2i is a simple root, so m=1m = 1. The uncorrected trial Acos⁡2t+Bsin⁡2tA\cos 2t + B\sin 2t solves the homogeneous equation, and LL sends it to zero. Try yp=tuy_p = tu with u=Acos⁡2t+Bsin⁡2tu = A\cos 2t + B\sin 2t. The product rule gives yp′′=2u′+tu′′y_p'' = 2u' + tu'', and u′′+4u=0u'' + 4u = 0, so yp′′+4yp=2u′y_p'' + 4y_p = 2u', that is,

yp′′+4yp=−4Asin⁡2t+4Bcos⁡2t.\begin{aligned} y_p'' + 4y_p &= -4A\sin 2t \\[0.4em] &\quad + 4B\cos 2t. \end{aligned}

Matching with 8sin⁡2t8\sin 2t gives A=−2A = -2 and B=0B = 0, so

yp=−2tcos⁡2t.y_p = -2t\cos 2t.

Its amplitude grows in proportion to tt, which is resonance.

  1. Use an annihilator to find the form of a particular solution of y′′′−y′′=12ty''' - y'' = 12t, then find the particular solution.
Show the answer

The characteristic polynomial is r3−r2=r2(r−1)r^3 - r^2 = r^2(r - 1), so yc=C1+C2t+C3ety_c = C_1 + C_2t + C_3e^t, and the root 00 has multiplicity 22. The operator D2D^2 annihilates 12t12t, so every solution satisfies D4(D−1) y=0D^4(D - 1)\,y = 0, whose solutions are c0+c1t+c2t2+c3t3+c4etc_0 + c_1t + c_2t^2 + c_3t^3 + c_4e^t. The functions not already in ycy_c are t2t^2 and t3t^3, so the trial is yp=At3+Bt2y_p = At^3 + Bt^2, which is t2(At+B)t^2(At + B) with m=2m = 2. Then yp′′=6At+2By_p'' = 6At + 2B and yp′′′=6Ay_p''' = 6A, so

yp′′′−yp′′=−6At+6A−2B.\begin{aligned} y_p''' - y_p'' &= -6At \\[0.4em] &\quad + 6A - 2B. \end{aligned}

Matching with 12t12t gives A=−2A = -2 and B=3A=−6B = 3A = -6, so

yp=−2t3−6t2.y_p = -2t^3 - 6t^2.

The naive trial At+BAt + B lies in ycy_c and gives zero, and even t(At+B)t(At + B) fails, because LL sends it to the constant −2A-2A.

How this lesson connects