Chapter 3.6: equations Non-homogeneous So far, we have looked at homogeneous equations L[y] = y 00 + p(t)y 0 + q(t)y = 0. Homogeneous means that the right side is zero. Linear homogeneous equations satisfy the superposition principle: sums of solutions are solutions. We now look at non-homogeneous equations: L[y] = y 00 + p(t)y 0 + q(t)y = g(t), where the RHS is not necessarily zero. 1 The New Issue It is: Find a solution of an inhomogeneous equation, say Y (t): L[Y ] = Y 00 + p(t)Y 0 + q(t)Y = g(t). The general solution is then: y(t) = Y (t) + c1y1(t) + c2y2(t) where y1, y2 are a fundamental set of solutions of the homogeneous equation L[y] = 0. Reason: L[y] = L[Y ] + L[c1y1 + c2y2] = L[Y ] + 0 = g. 2 General solution Let’s make sure that y(t) = Y (t) + c1y1(t) + c2y2(t) is the general solution of L[y] = g. Suppose you have another, say yother . Then L[y] = g = L[yother ] =⇒ L[y − yother ] = 0 =⇒ y − yother = c1y1 + c2y2, for some c1, c2, since y−yother solves the homogeneous equation, and the RHS is the general solution. 3 How to solve L[Y ] = g The first method is the method of undetermined coefficients = MUC. It only applies when you know in advance what kind of solution the equation will have. In the next chapter, a more systematic method, variation of parameters, will be used. But for special equations such as constant coefficient equations, where the RHS g is an exponential function, MUC is quicker. This motivates learning how to guess the type of solution. 4 How to solve L[Y ] = g for CC equations Example: Find a solution of y 00 −3y 0 −4y = 3e2t. Key fact (which we already know): if Ly = ay 00 + by 0 + cy, then L[ert] = (ar2 + br + c)ert. Thus, in our problem, L[ert] = (r2 − 3r − 4)ert. When solving the homogeneous equation, we wanted the RHS = 0 so we chose r to be a solution of the characteristic equation. But now, we want the RHS to be 3e2t. Clearly, we have to pick r = 2. 5 Choosing the multiple We can’t always solve with Y = e2t but we can try Y = Ae2t and solve for A. Indeed, L[Ae2t] = A(22 − 3 · 2 − 4)e2t = 3e2t ⇐⇒ −6A = 3 ⇐⇒ A = − 1 2. 2t . Since it is Thus, one solution is Y = − 1 e 2 only one solution, we call it a particular solution. To find the general solution, we need to add the general solution of the homogeneous problem. (We won’t do it , because that was last chapter). 6 Harder example Find a solution of: y 00 − 3y 0 − 4y = 2 sin t. d sin t = cos t, d cos t = This is harder because dt dt − sin t. So sines and cosines are not quite preserved by the derivative. So we have to try: Y = A sin t + B cos t. Functions of this kind are preserved by taking a derivative. 7 Choosing the coefficients Write: L[y] = y 00 − 3y 0 − 4y. We claim that there exist constants A, B so that L[A sin t + B cos t] = 2 sin t. A bit of computation shows: L[A sin t + B cos t] = A(− sin t − 3 cos t − 4 sin t) + B(− cos t + 3 sin t − 4 cos t). So we need: A(− sin t − 3 cos t − 4 sin t) +B(− cos t + 3 sin t − 4 cos t) = 2 sin t. 8 Choosing the coefficients Equivalently, (−A − 4A + 3B) sin t +(−3A − B − 4B) cos t = 2 sin t ⇐⇒ −5A + 3B = 2, −3A − 5B = 0. Thus, 5 B = 2 ⇐⇒ B = 3 . A = −5 B =⇒ 3B + 5 3 3 17 5 and Y = − 5 sin t + 3 cos t. So A = − 17 17 17 9 A disease Unfortunately, this method does not work if the RHS g is a solution of the homogeneous equation L[g] = 0 on the LHS. For instance, y 00 + y = sin t. You cannot just try C1 cos t + C2 sin t since the LHS will kill it. The cure is, as in reduction of order, to multiply by t. Try y = C1t cos t + C2t sin t. Only do this when the RHS is a homogeneous solution! If you do this, you will find that terms with a t in front are killed. So what remains is the equation −2C1 sin t + 2C2 cos t = sin t. The factor of 2 comes from (yt)00 = 2y 0 + ty 00. 10 Example Solve the initial value problem: y 00 + 4y = sin 2t, y(0) = 0, y 0(0) = 1. The RHS is a solution of the homogeneous equation y 00+4y = 0 so we need to try At cos 2t+ Bt sin 2t. The equation becomes: −1 −4A sin 2t+4B cos 2t = sin 2t =⇒ A = , B = 0. 4 The general solution is: 1 y = C1 cos 2t + C2 sin 2t − t cos 2t. 4 Then, y(0) = C1 = 0; y 0(0) = −2C2 − 1 4 = 1. So the solution is 5 1 y = − sin 2t − t cos 2t. 8 4 11 Repeated root canal Yet a worse disease occurs if the LHS has repeated roots and the RHS is a solution of the homogeneous equation. For instance: L[y] = y 00 + 2y 0 + 1 = e−t. There is no point trying y = te−t because it is also a homogeneous solution. So the next step is to try y = t2e−t. L kills terms with t2 or t. The only remaining term is 2e−t. So a solution is: 1 y = t2e−t. 2 12 What else can the RHS be? So far we have solved L[y] = g when Ly = ay 00 + by 0 + cy and where g is an exponential or a cosine or a sine. We can also solve by undetermined coefficients if the RHS is a polynomial. This is because derivatives of polynomials are polynomials. The degree goes down with each derivative. If the RHS is a polynomial of degree n, and if c 6= 0, you can use a polynomial of degree n. E.g.: L[y] = y 00 + y = t2 + 2. Try y = at2 + bt + c. Then L[at2 + bt + c] = ⇐⇒ 2a + at2 + bt + c = t2 + 2 2a + c = 2, b = 0, a = 1. 13 Another example Example: y 00 − 3y 0 = 4t2 − 1. We can’t use a polynomial of degree 2 since the LHS will then be of degree one. Try y = polynomial of degree 3. Thus, y = At3 + Bt2 + Ct. We now have 3 undetermined coefficients (A, B, C). Plugging in, we get: (6At + 2B) − 3(3At2 + 2tB + C) = 4t2 − 1. Match coefficients of like powers of t: −9A = 4, 6A − 6B = 0, −3C = −1. 14 What else can the RHS be? A nice thing is that we can easily solve when g = g1 + g2 if we can solve separately for g1 and for g2. Indeed, if L[Y1] = g1, L[Y2] = g2 =⇒ L[Y1 + Y2] = g1 + g2 = g. This is the superposition principle again (i.e. linearity of L). So when L = aD2 + bD + c, our inventory of g’s now includes: sums of exponentials, sines, cosines and polynomials. 15 What else can the RHS be? If we can solve when the RHS is an exponential, then we can surely solve when the exponential is a complex one. That means we can solve if the RHS g = eλt cos t or g = eλt sin t or a sum of these. One can also solve when the RHS is a polynomial times an exponential. 16 Examples L[y] = y 00 − 4y = 2t + e2t. We solve one term at a time. First, we find y1 such that L[y1] = 2t. We can use at + b. Then L[y] = −4at − 4b and we get a = −1 2 , b = 0. Then we find y2 such that L[y2] = e2t. This is a solution of the homogeneous problem so we must use Ate2t. We get L[Ate2t] = 4Ae2t = e2t =⇒ A = 1 . 4 1 te2t. t + The solution is: y = − 1 2 4 17