Unit 6, lesson 46

Nonhomogeneous Linear Equations

How every solution of a forced linear equation splits into a homogeneous part and one particular solution, and how to find that particular solution by trial or by variation of parameters.

  • Theory part 91
  • Practice part 92
  • Second-Order Linear Equations

Push a swing at regular intervals and its motion is no longer set only by the swing itself. The equation gains a right side, a prescribed input that you choose, while the motion it produces is the unknown. All the work on homogeneous equations still counts. You only need one solution that answers the input, and everything else comes from the homogeneous equation you already know how to solve.

Key terms

Forcing and the linear operator

Definition A second-order linear equation in standard form is

y′′+p(t) y′+q(t) y=g(t),y'' + p(t)\,y' + q(t)\,y = g(t),

where pp, qq and gg are given functions on an interval II. Write L[y]=y′′+p y′+q yL[y] = y'' + p\,y' + q\,y for every twice differentiable yy on II. The operator LL is linear, so L[c1y1+c2y2]=c1L[y1]+c2L[y2]L[c_1 y_1 + c_2 y_2] = c_1 L[y_1] + c_2 L[y_2] for all constants c1,c2c_1, c_2. The given function gg is the forcing term. The equation is homogeneous when g=0g = 0 on II and nonhomogeneous otherwise.

In plain words The operator LL is a machine that takes a candidate function and returns the forcing it would need. Solving L[y]=gL[y] = g means finding the functions that the machine sends to the prescribed input gg.

Example For L[y]=y′′−yL[y] = y'' - y and the candidate y=t2y = t^2 the machine returns

L[t2]=2−t2.L[t^2] = 2 - t^2.

So y=t2y = t^2 solves y′′−y=2−t2y'' - y = 2 - t^2, but it does not solve y′′−y=2y'' - y = 2.

Coefficient continuity assumptions

Definition Existence and uniqueness theorem. Suppose pp, qq and gg are continuous on an open interval II and t0t_0 lies in II. Then for any real numbers y0y_0 and y1y_1 the problem

y′′+p y′+q y=g,y(t0)=y0,y′(t0)=y1\begin{gathered} y'' + p\,y' + q\,y = g, \\[0.4em] y(t_0) = y_0, \quad y'(t_0) = y_1 \end{gathered}

has exactly one solution, and that solution exists on all of II. An equation written as P(t)y′′+Q(t)y′+R(t)y=G(t)P(t)y'' + Q(t)y' + R(t)y = G(t) must first be divided by PP, which is allowed only on an interval where P(t)≠0P(t) \ne 0. Then p=Q/Pp = Q/P, q=R/Pq = R/P and g=G/Pg = G/P.

In plain words The theorem works on intervals where the coefficients and the forcing are continuous, and only after the equation is in standard form. Points where the leading coefficient vanishes split the line into separate intervals, and a solution formula is claimed only on one of them.

Example The equation t2y′′−2t y′+2y=t3t^2 y'' - 2t\,y' + 2y = t^3 has leading coefficient t2t^2, which is zero at t=0t = 0. In standard form it reads

y′′−2t y′+2t2 y=t,y'' - \frac{2}{t}\,y' + \frac{2}{t^2}\,y = t,

with coefficients continuous on (0,∞)(0, \infty) and on (−∞,0)(-\infty, 0). An initial condition at t0=1t_0 = 1 gives a unique solution on (0,∞)(0, \infty), and the theorem says nothing past t=0t = 0.

Complementary and particular solutions

Definition Let pp, qq and gg be continuous on an open interval II, and let y1y_1 and y2y_2 be solutions of L[y]=0L[y] = 0 on II with Wronskian W(y1,y2)(t)≠0W(y_1, y_2)(t) \ne 0 on II. Any single solution ypy_p of L[y]=gL[y] = g on II is called a particular solution. The general solution of the homogeneous equation,

yc=c1y1+c2y2,y_c = c_1 y_1 + c_2 y_2,

is called the complementary solution. Theorem. Every solution of L[y]=gL[y] = g on II has the form

y=c1y1+c2y2+ypy = c_1 y_1 + c_2 y_2 + y_p

for exactly one pair of constants c1,c2c_1, c_2. The proof is one line. If yy solves L[y]=gL[y] = g, then L[y−yp]=g−g=0L[y - y_p] = g - g = 0, so y−ypy - y_p is a homogeneous solution.

In plain words The particular solution answers the forcing. The complementary part adds nothing to the forcing, because LL sends it to zero, so it is free to adjust the solution to the initial conditions.

Example For y′′−y=2y'' - y = 2 the constant yp=−2y_p = -2 works, since 0−(−2)=20 - (-2) = 2. The homogeneous equation has y1=ety_1 = e^t and y2=e−ty_2 = e^{-t}, so every solution on (−∞,∞)(-\infty, \infty) is

y=c1et+c2e−t−2.y = c_1 e^t + c_2 e^{-t} - 2.

Check the roles with the operator. Applying LL to c1et+c2e−tc_1 e^t + c_2 e^{-t} gives 00 and applying it to −2-2 gives 22, so their sum is sent to exactly 22, whatever c1c_1 and c2c_2 are.

Undetermined coefficients

Definition The method applies to ay′′+by′+cy=g(t)a y'' + b y' + c y = g(t) with real constants a≠0a \ne 0, bb, cc, when gg is a sum of terms of the form

Pm(t) eαtcos⁡βtorPm(t) eαtsin⁡βt,\begin{gathered} P_m(t)\,e^{\alpha t}\cos \beta t \\[0.4em] \text{or} \quad P_m(t)\,e^{\alpha t}\sin \beta t, \end{gathered}

where PmP_m is a polynomial of degree mm and α\alpha, β\beta are real constants. For one such term, try

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

where AA and BB are polynomials of degree mm with unknown coefficients, and ss is the multiplicity of α+iβ\alpha + i\beta as a root of the characteristic equation ar2+br+c=0a r^2 + b r + c = 0, with s=0s = 0 when it is not a root. So ss is 00, 11 or 22, and s=2s = 2 is possible only when β=0\beta = 0. Both AA and BB are needed even when gg contains only a cosine or only a sine. Substitute and match coefficients. For a sum of such terms, find a particular solution for each term and add them, which is allowed because LL is linear.

In plain words Derivatives of polynomials, exponentials, sines and cosines stay in the same family, so a trial of the same shape as the forcing can be tuned to fit it exactly. When s=0s = 0 the trial simply copies the shape of gg.

Example Take y′′+3y′+2y=4t2y'' + 3y' + 2y = 4t^2. The characteristic roots are −1-1 and −2-2, and 00 is not one of them, so s=0s = 0 and the trial is yp=At2+Bt+Cy_p = At^2 + Bt + C. Substituting gives

2At2+(6A+2B)t+(2A+3B+2C)=4t2.\begin{aligned} &2A t^2 + (6A + 2B)t \\[0.4em] &\quad + (2A + 3B + 2C) = 4t^2. \end{aligned}

Matching coefficients gives A=2A = 2, then B=−6B = -6, then C=7C = 7, so yp=2t2−6t+7y_p = 2t^2 - 6t + 7. With exponential forcing the same idea is even quicker. For y′′+y=5e2ty'' + y = 5e^{2t} the trial Ae2tAe^{2t} gives 4A+A=54A + A = 5, so yp=e2ty_p = e^{2t}.

Resonance adjustments

Definition When the forcing contains eαtcos⁡βte^{\alpha t}\cos\beta t or eαtsin⁡βte^{\alpha t}\sin\beta t and α+iβ\alpha + i\beta is a root of the characteristic equation, the unadjusted trial contains homogeneous solutions, which LL sends to 00, so no choice of coefficients can match gg. Multiplying the trial by tst^s, with ss the multiplicity of the root as above, removes every homogeneous solution from the trial and the method then succeeds. Always compare the trial with ycy_c before substituting.

In plain words If the input already has the shape of a natural response, the plain guess is invisible to the equation. Multiply by tt, or by t2t^2 for a double root, to get a guess the equation can see.

Example For y′′−y′−2y=3e2ty'' - y' - 2y = 3e^{2t} the characteristic equation r2−r−2=(r−2)(r+1)r^2 - r - 2 = (r - 2)(r + 1) has the simple root r=2r = 2. The trial Ae2tAe^{2t} gives 00, so use yp=At e2ty_p = At\,e^{2t}. Its derivatives are

yp′=Ae2t(1+2t),yp′′=Ae2t(4+4t),\begin{aligned} y_p' &= A e^{2t}(1 + 2t), \\[0.4em] y_p'' &= A e^{2t}(4 + 4t), \end{aligned}

and substituting gives Ae2t(4+4t−1−2t−2t)=3Ae2tA e^{2t}(4 + 4t - 1 - 2t - 2t) = 3Ae^{2t}. So A=1A = 1 and yp=t e2ty_p = t\,e^{2t}. The same rule handles a double root and a sinusoid.

EquationRoot to checkParticular solution
y′′−2y′+y=ety'' - 2y' + y = e^tr=1r = 1 is double12t2et\tfrac{1}{2}t^2 e^t
y′′+4y=cos⁡2ty'' + 4y = \cos 2tr=2ir = 2i is simple14tsin⁡2t\tfrac{1}{4}t \sin 2t

In the second row the oscillation has amplitude t/4t/4, which grows without bound. This is resonance.

Variation of parameters

Definition Let pp, qq and gg be continuous on an open interval II, and let y1y_1, y2y_2 be solutions of y′′+p y′+q y=0y'' + p\,y' + q\,y = 0 on II with Wronskian

W=y1y2′−y1′y2≠0on I.W = y_1 y_2' - y_1' y_2 \ne 0 \quad \text{on } I.

Look for yp=u1y1+u2y2y_p = u_1 y_1 + u_2 y_2 and impose u1′y1+u2′y2=0u_1' y_1 + u_2' y_2 = 0. Substituting into the equation then leaves u1′y1′+u2′y2′=gu_1' y_1' + u_2' y_2' = g. Solving this linear system with Cramer’s rule gives

u1′=−y2 gW,u2′=y1 gW,u_1' = -\frac{y_2\,g}{W}, \qquad u_2' = \frac{y_1\,g}{W},

and any antiderivatives u1u_1, u2u_2 on II give a particular solution

yp=−y1∫y2 gW dt+y2∫y1 gW dt.y_p = -y_1 \int \frac{y_2\,g}{W}\,dt + y_2 \int \frac{y_1\,g}{W}\,dt.

The formula needs the equation in standard form with leading coefficient 11, and it works for any continuous gg, also with variable coefficients.

In plain words Take the homogeneous solution and let its constants vary with tt. The extra condition keeps the second derivative simple, and the Wronskian being nonzero guarantees you can always solve for u1′u_1' and u2′u_2'.

Example Solve y′′+y=sec⁡ty'' + y = \sec t on I=(−π/2,π/2)I = (-\pi/2, \pi/2), where sec⁡t\sec t is continuous. Use y1=cos⁡ty_1 = \cos t and y2=sin⁡ty_2 = \sin t with W=1W = 1. Then u1′=−sin⁡tsec⁡t=−tan⁡tu_1' = -\sin t \sec t = -\tan t and u2′=cos⁡tsec⁡t=1u_2' = \cos t \sec t = 1. Since cos⁡t>0\cos t > 0 on II, take u1=ln⁡(cos⁡t)u_1 = \ln(\cos t) and u2=tu_2 = t. This gives

yp=cos⁡t ln⁡(cos⁡t)+tsin⁡t.y_p = \cos t \,\ln(\cos t) + t \sin t.

Undetermined coefficients cannot reach this answer, because sec⁡t\sec t is not of the allowed form.

Variable coefficient forcing

Definition For P(t)y′′+Q(t)y′+R(t)y=G(t)P(t)y'' + Q(t)y' + R(t)y = G(t) on an open interval where P(t)≠0P(t) \ne 0 and all four functions are continuous, the forcing that enters variation of parameters is g=G/Pg = G/P, not GG. The homogeneous solutions y1y_1, y2y_2 must be known separately, and the result is valid only on that interval.

In plain words Divide by the leading coefficient before you use the formula. Forgetting this is the most common error with variable coefficients.

Example Take t2y′′−2t y′+2y=t3t^2 y'' - 2t\,y' + 2y = t^3 on (0,∞)(0, \infty). The functions y1=ty_1 = t and y2=t2y_2 = t^2 solve the homogeneous equation, as direct substitution shows, and W=t⋅2t−1⋅t2=t2≠0W = t \cdot 2t - 1 \cdot t^2 = t^2 \ne 0 there. The standard form has g=tg = t. Then

u1′=−t2⋅tt2=−t,u2′=t⋅tt2=1,\begin{aligned} u_1' &= -\frac{t^2 \cdot t}{t^2} = -t, \\[0.4em] u_2' &= \frac{t \cdot t}{t^2} = 1, \end{aligned}

so u1=−12t2u_1 = -\tfrac{1}{2}t^2, u2=tu_2 = t and

yp=−12t3+t3=12t3.y_p = -\tfrac{1}{2}t^3 + t^3 = \tfrac{1}{2}t^3.

Check it in the original equation. The left side becomes t2⋅3t−2t⋅32t2+t3=t3t^2 \cdot 3t - 2t \cdot \tfrac{3}{2}t^2 + t^3 = t^3, as required. Using G=t3G = t^3 instead of g=tg = t would have produced a wrong answer.

Check yourself

  1. Find a particular solution of y′′−4y=8e2ty'' - 4y = 8e^{2t}.
Show the answer

The root r=2r = 2 of r2−4=0r^2 - 4 = 0 is simple, so try yp=At e2ty_p = At\,e^{2t}. Substituting gives Ae2t(4+4t)−4At e2t=4Ae2tA e^{2t}(4 + 4t) - 4At\,e^{2t} = 4Ae^{2t}, so A=2A = 2 and yp=2t e2ty_p = 2t\,e^{2t}.

  1. Solve y′′+y=2ty'' + y = 2t with y(0)=0y(0) = 0 and y′(0)=0y'(0) = 0.
Show the answer

A particular solution is yp=2ty_p = 2t, so y=c1cos⁡t+c2sin⁡t+2ty = c_1 \cos t + c_2 \sin t + 2t. The condition y(0)=0y(0) = 0 gives c1=0c_1 = 0, and y′(0)=c2+2=0y'(0) = c_2 + 2 = 0 gives c2=−2c_2 = -2. The solution is y=2t−2sin⁡ty = 2t - 2\sin t for all tt.

  1. Use variation of parameters to find a particular solution of y′′−2y′+y=et/ty'' - 2y' + y = e^t/t on (0,∞)(0, \infty).
Show the answer

Here y1=ety_1 = e^t, y2=tety_2 = t e^t and W=e2tW = e^{2t}. Then u1′=−1u_1' = -1 and u2′=1/tu_2' = 1/t, so u1=−tu_1 = -t and u2=ln⁡tu_2 = \ln t, which needs t>0t > 0. This gives yp=−tet+tetln⁡ty_p = -t e^t + t e^t \ln t. The term −tet-te^t is a homogeneous solution and may be dropped, so yp=tetln⁡ty_p = t e^t \ln t also works.

How this lesson connects

It also uses Second-order homogeneous linear equations and Wronskians and Product rule, integration and trigonometric identities.