Solving a non-homogeneous equation - Powering Silicon Valley | San

24
Review I For the linear equation with constant coefficients, ay 00 + by 0 + cy =0, when the roots of the characteristic equation are equal, the general solution is y = Ae λt + Bte λt . I For the linear homogeneous equation with not-necessarily-constant coefficients, if we have one solution u, we can find the general solution Au + Bvu using the method of reduction of order. I We look for a solution y = vu, and when we plug this into the equation, the coefficients of v will cancel out and leave a first-order equation for v 0 . I Solve that equation, and then integrate to find v .

Transcript of Solving a non-homogeneous equation - Powering Silicon Valley | San

Page 1: Solving a non-homogeneous equation - Powering Silicon Valley | San

Review

I For the linear equation with constant coefficients,

ay ′′ + by ′ + cy = 0,

when the roots of the characteristic equation are equal, thegeneral solution is

y = Aeλt + Bteλt .

I For the linear homogeneous equation withnot-necessarily-constant coefficients, if we have one solutionu, we can find the general solution Au + Bvu using themethod of reduction of order.

I We look for a solution y = vu, and when we plug this into theequation, the coefficients of v will cancel out and leave afirst-order equation for v ′.

I Solve that equation, and then integrate to find v .

Page 2: Solving a non-homogeneous equation - Powering Silicon Valley | San

The non-homogeneous equation

Consider the non-homogeneous second-order equation withconstant coefficients:

ay ′′ + by ′ + cy = F (t).

I The difference of any two solutions is a solution of thehomogeneous equation.

I Suppose we have one solution u. Then the general solution isu plus the general solution of the homogeneous equation.

I Proof, let y be any solution. Then y − u solves thehomogeneous equation, so y = u+ a solution of thehomogeneous equation.

Page 3: Solving a non-homogeneous equation - Powering Silicon Valley | San

The non-homogeneous equation

I Suppose we have one solution u. Then the general solution isu plus the general solution of the homogeneous equation.

I So, solving the equation boils down to finding just onesolution.

I But there is no foolproof method for doing that (for anyarbitrary right-hand side F (t)).

I We can do it in some useful common cases.

Page 4: Solving a non-homogeneous equation - Powering Silicon Valley | San

Constant coefficients or not?

I What we did up to now works for any second-order linearequation.

I What we will do next assumes constant coefficients.

I Textbook does not emphasize the transition

Page 5: Solving a non-homogeneous equation - Powering Silicon Valley | San

The method of undetermined coefficients

This method applies to a second-order linear equation withconstant coefficients if the right-hand side F (t) has one of a fewparticularly simple forms:

I A polynomial

I An exponential times a polynomial: eαtP(t). The exponent isa constant times t.

I Complex exponentials are allowed, so we also can handleP(t) cos t,

I P(t) sin t

I eαt cos t, etc.

Page 6: Solving a non-homogeneous equation - Powering Silicon Valley | San

Also the right-hand side can be a linear combination of expressionsof those forms, since if

au′′ + bu′ + cu = F (t)

andav ′′ + bv ′ + cv = G (t)

then y = au + bv satisfies

ay ′′ + by ′ + cy = aF (t) + bG (t)

Page 7: Solving a non-homogeneous equation - Powering Silicon Valley | San

The method of undetermined coefficients

I Assume that the sought-after solution y has the same form asthe right-hand side P(t).

I That assumption mentions some unknown coefficients.

I Plug in that solution to the differential equation and simplify

I You get equations for the coefficients.

I If they are solvable you are done.

Page 8: Solving a non-homogeneous equation - Powering Silicon Valley | San

Example: y ′′ − 3y ′ − 4y = 3e2t

I 3e2t is (a constant times) an exponential.

I Assume y = Ae2t .

I Plug and grind:

y ′ = 2Ae2t

y ′′ = 4Ae2t

y ′′ − 3y ′ − 4y = 4Ae2t − 3(2Ae2t − 4Ae2t

= −6Ae2t

= 3e2t if this is to be a solution

A = −1

2the equation is solvable, so it works.

Page 9: Solving a non-homogeneous equation - Powering Silicon Valley | San

Example: y ′′ − 3y ′ − 4y = 3e2t

I We found the particular solution

y = −1

2e2t

I To find the general solution we need to solve thehomogeneous equation too.

I The characteristic equation is

λ2 − 3λ− 4 = 0

which has roots λ = 4 and λ = −1.

I So the general solution of the homogeneous equation is

ae4t + be−t

I and the general solution of the non-homogeneous equation is

ae4t + be−t − 1

2e2t .

Page 10: Solving a non-homogeneous equation - Powering Silicon Valley | San

Special cases can cause trouble

I If the proposed solution of the non-homogeneous equation isactually already a solution of the homogeneous equation, thenthe equations for the coefficients cannot be solved.

I For example, in the preceding problem, the homogeneousequation had solutions e−t and e4t . What if the right-handside had been e4t?

y ′′ − 3y ′ − 4y = e4t

I Then we would have assumed y = Ae4t , but when we plug itin, we get 0 on the left, which can never be equal to e4t onthe right.

I So the method needs modification in such cases.

Page 11: Solving a non-homogeneous equation - Powering Silicon Valley | San

What to do in a special caseI If the proposed solution of the non-homogeneous equation is

already a solution of the homogeneous equation, then theassumed form should be multiplied by a factor of t.

I For example:y ′′ − 3y ′ − 4y = e4t

Since e4t is a solution of the homogeneous equation, weinstead assume

y = Ate4t .

I Now we plug and grind:

y ′ = Ae4t(4t + 1)

y ′′ = Ae4t(4 + 4(4t + 1)) = Ae4t(16t + 8)

y ′′ − 3y ′ − 4y = Ae4t(16t + 8)− 3Ae4t(4t + 1)− 4Ate4t

= −2Ae4t

I So if we take A = −1/2 we have a solution.I Note that the te4t terms canceled out. That’s because e4t

solves the homogeneous equation

Page 12: Solving a non-homogeneous equation - Powering Silicon Valley | San

Another special case

I If the right-hand side is already a solution of the homogeneousequation, and

I if in addition the characteristic equation has double roots, then

I multiply by t2 instead of only t.

I For exampley ′′ + 2y ′ + 1 = e−t

I The characteristic equation is (λ+ 1)2 = 0, so thehomogeneous equation has solutions e−t and te−t . So theright side is a solution of the homogeneous equation, but so iste−t (which we would otherwise try as a solution). So insteadwe try

y = At2e−t

and you can check that it works.

Page 13: Solving a non-homogeneous equation - Powering Silicon Valley | San

Summary of the Method of Undetermined Coefficients

I It’s for linear non-homogeneous second-order equations withconstant coefficients.

I Assume a solution that has the same form as the right handside.

I That is, a polynomial, or an exponential or trig function timesa polynomial.

I Use letters for the polynomial coefficients and solve for them.

I Use an extra factor of t if the right side already solves thehomogeneous equation, or an extra factor of t2 if in additionthe characteristic equation has multiple roots.

I For proof that it works, see pages 181-182 of the text. Youjust use letters for the coefficients of the right-hand side andplug and grind as you do when solving a particular example.

Page 14: Solving a non-homogeneous equation - Powering Silicon Valley | San

Variation of Parameters

I This method “works” on any second-order non-homogeneousequation, constant coefficients or not.

I But the “solution” involves an integral, so it may be harder towork with.

I Also it requires have a fundamental set of solutions of thehomogeneous equation, which may not be easy if the equationdoesn’t have constant coefficients.

I Therefore use the method of undetermined coefficients if it isapplicable.

Page 15: Solving a non-homogeneous equation - Powering Silicon Valley | San

Variation of Parameters

We consider the equation

y ′′ + p(t)y ′ + q(t)y = g(t)

and suppose we have somehow found a fundamental set of twosolutions y1 and y2 of the homogeneous equation

y ′′ + p(t)y ′ + q(t)y = 0.

The basic idea is to look for a solution in the form

y = uy1 + vy2

where u and v are not constants, but functions of t.

Page 16: Solving a non-homogeneous equation - Powering Silicon Valley | San

Variation of Parameters

Our plan is to plugy = uy1 + vy2

into the equation

y ′′ + p(t)y ′ + q(t)y = g(t)

So we start by differentiating y :

y ′ = u′y1 + uy ′1 + v ′y2 + vy ′2

Now we assume u′y1 + v ′y2 = 0. Then

y ′ = uy ′1 + vy ′2

y ′′ = u′y1 + uy ′′1 + v ′y ′2 + v ′′2

Page 17: Solving a non-homogeneous equation - Powering Silicon Valley | San

So now plug the expressions for y ′ and y ′′ into the originalequation. Specifically, plug

y ′ = uy ′1 + vy ′2

y ′′ = u′y1 + uy ′′1 + v ′y ′2 + v ′′2

intoy ′′ + p(t)y ′ + q(t)y = g(t)

The coefficient of u is y ′′1 + py ′1 + qy1, which is zero since y1 is asolution of the homogeneous equation. The coefficient of v issimilarly zero since y2 is a solution. We are left with

u′y ′1 + v ′y ′2 = g(t).

Page 18: Solving a non-homogeneous equation - Powering Silicon Valley | San

I We have proved that if we solve the equations

u′y1 + v ′y2 = 0 which we assumed above

u′y ′1 + v ′y ′2 = g(t)

then y = uy1 + vy2 will solve the non-homogeneous equation.

I But these are algebraic equations for u′ and v ′.

I The solution has the Wronskian W (y1, y2) in thedenominator, which is nonzero.

I So it’s always possible to solve for u′ and v ′.

I Then if we can integrate the answers, we have our solution.

Page 19: Solving a non-homogeneous equation - Powering Silicon Valley | San

Solving

u′y1 + v ′y2 = 0

u′y ′1 + v ′y ′2 = g(t)

we get

u′ = −y2g

W

v ′ =y1g

W

where W is the Wronskian

W = y1y′2 − y2y

′1

Therefore a solution is

u = −∫

y2(t)g(t)

W (t)dt + c1

v =

∫y1(t)g(t)

W (t)dt + c2

y = uy1 + vy2

Page 20: Solving a non-homogeneous equation - Powering Silicon Valley | San

An example: y ′′ + 4y = 3 csc t

I Although the coefficients are constant, the right side is not apolynomial times an exponential.

I So we can’t use the method of undetermined coefficients.

I We can solve the homogeneous equation, since thecoefficients are constant.

I The details of this example are on pages 185-187, presentedas a motivation for the method of variation of parameters.

Page 21: Solving a non-homogeneous equation - Powering Silicon Valley | San

An example: y ′′ − 3y ′ − 4y = t2

I What method should we use?

I Undetermined coefficients, since we have a polynomial on theright.

I What form should we assume for the solution?I y = a + bt + ct2. No exponential, since the right side is a

polynomial.I Plugging this into the equation we find it will work if

2c − 3b − 4a = 0

−6c − 4b = 0

−4c = 1

I It is possible to solve these equations:c = −1/4, b = 3/8, a = −13/32

I What is the general solution?

y = −13

32+

3

8t − t2

4+ Ae−t + Be4t .

Page 22: Solving a non-homogeneous equation - Powering Silicon Valley | San

An example: y ′′ − 3y ′ − 4y = t2

I What method should we use?I Undetermined coefficients, since we have a polynomial on the

right.I What form should we assume for the solution?

I y = a + bt + ct2. No exponential, since the right side is apolynomial.

I Plugging this into the equation we find it will work if

2c − 3b − 4a = 0

−6c − 4b = 0

−4c = 1

I It is possible to solve these equations:c = −1/4, b = 3/8, a = −13/32

I What is the general solution?

y = −13

32+

3

8t − t2

4+ Ae−t + Be4t .

Page 23: Solving a non-homogeneous equation - Powering Silicon Valley | San

An example: y ′′ − 3y ′ − 4y = t2

I What method should we use?I Undetermined coefficients, since we have a polynomial on the

right.I What form should we assume for the solution?I y = a + bt + ct2. No exponential, since the right side is a

polynomial.I Plugging this into the equation we find it will work if

2c − 3b − 4a = 0

−6c − 4b = 0

−4c = 1

I It is possible to solve these equations:c = −1/4, b = 3/8, a = −13/32

I What is the general solution?

y = −13

32+

3

8t − t2

4+ Ae−t + Be4t .

Page 24: Solving a non-homogeneous equation - Powering Silicon Valley | San

An example: y ′′ − 3y ′ − 4y = t2

I What method should we use?I Undetermined coefficients, since we have a polynomial on the

right.I What form should we assume for the solution?I y = a + bt + ct2. No exponential, since the right side is a

polynomial.I Plugging this into the equation we find it will work if

2c − 3b − 4a = 0

−6c − 4b = 0

−4c = 1

I It is possible to solve these equations:c = −1/4, b = 3/8, a = −13/32

I What is the general solution?

y = −13

32+

3

8t − t2

4+ Ae−t + Be4t .