1 00:00:00,000 --> 00:00:01,000 2 00:00:01,000 --> 00:00:04,299 Let's do some more nonhomogeneous equations. 3 00:00:04,299 --> 00:00:06,660 So let's take the same problem, but we'll change the 4 00:00:06,660 --> 00:00:07,360 right-hand side. 5 00:00:07,360 --> 00:00:09,200 Because I think you know how to solve the-- essentially, 6 00:00:09,199 --> 00:00:10,299 the homogeneous version. 7 00:00:10,300 --> 00:00:12,810 So the same problem as we did in the last video. 8 00:00:12,810 --> 00:00:17,380 The second derivative of y minus 3 times the first 9 00:00:17,379 --> 00:00:20,750 derivative y minus 4 times the function. 10 00:00:20,750 --> 00:00:23,940 And now in the last example, the nonhomogeneous part 11 00:00:23,940 --> 00:00:25,200 was 3e to the 2x. 12 00:00:25,199 --> 00:00:28,390 But we're tired of dealing with exponent functions, so 13 00:00:28,390 --> 00:00:29,879 let's make it a trigonometric function. 14 00:00:29,879 --> 00:00:33,350 So let's say it equals 2 sin of x. 15 00:00:33,350 --> 00:00:37,740 So the first step you do is what we've been doing. 16 00:00:37,740 --> 00:00:40,510 You essentially solve the homogeneous equation. 17 00:00:40,509 --> 00:00:42,890 So this left-hand side is equal to 0. 18 00:00:42,890 --> 00:00:45,149 You do that by getting the characteristic equation r 19 00:00:45,149 --> 00:00:49,159 squared minus 3r minus 4 is equal to 0. 20 00:00:49,159 --> 00:00:52,359 You get the solutions, r is equal equal to 4, r is equal 21 00:00:52,359 --> 00:00:54,839 to minus 1, and then you get that general solution. 22 00:00:54,840 --> 00:00:57,080 We did this in the last video. 23 00:00:57,079 --> 00:01:01,599 You get the general solution of the homogeneous. 24 00:01:01,600 --> 00:01:04,129 Maybe we'll call this the homogeneous solution. 25 00:01:04,129 --> 00:01:05,579 y homogeneous. 26 00:01:05,579 --> 00:01:14,840 We've got the C1 e to the 4x plus C2e to the minus x. 27 00:01:14,840 --> 00:01:17,480 And that's all and good, but in order to get the general 28 00:01:17,480 --> 00:01:21,410 solution of this nonhomogeneous equation, I 29 00:01:21,409 --> 00:01:23,590 have to take the solution of the nonhomogeneous equation, 30 00:01:23,590 --> 00:01:26,280 if this were equal to 0, and then add that to a particular 31 00:01:26,280 --> 00:01:29,049 solution that satisfies this equation. 32 00:01:29,049 --> 00:01:33,299 That satisfies-- when you take the second derivative minus 3 33 00:01:33,299 --> 00:01:35,399 times the first minus 4 times the function, I actually 34 00:01:35,400 --> 00:01:37,469 get 2 sin of x. 35 00:01:37,469 --> 00:01:40,129 And here once again we'll use undetermined coefficients. 36 00:01:40,129 --> 00:01:43,170 And undetermined coefficients, just think to yourself. 37 00:01:43,170 --> 00:01:46,650 What function, when I take its second and first derivatives 38 00:01:46,650 --> 00:01:49,530 and add and subtract multiples of them to each other, will I 39 00:01:49,530 --> 00:01:50,980 get sine of x? 40 00:01:50,980 --> 00:01:53,835 Well, two functions end up with sine of x when you take 41 00:01:53,834 --> 00:01:55,229 the first and second derivatives. 42 00:01:55,230 --> 00:01:58,049 And the sine and cosine of x. 43 00:01:58,049 --> 00:01:58,959 So it's a good guess. 44 00:01:58,959 --> 00:02:00,629 And that's really what you're doing it the method of 45 00:02:00,629 --> 00:02:01,969 undetermined coefficients. 46 00:02:01,969 --> 00:02:04,359 You take a guess of a particular solution and then 47 00:02:04,359 --> 00:02:07,400 you solve for the undetermined coefficients. 48 00:02:07,400 --> 00:02:15,710 So let's say that our guess is y is equal to-- I don't know, 49 00:02:15,710 --> 00:02:18,930 some coefficient times sine of x. 50 00:02:18,930 --> 00:02:21,020 And if this was sine of 2x, I'd put A 51 00:02:21,020 --> 00:02:22,920 times sine of 2x here. 52 00:02:22,919 --> 00:02:27,169 Just because I still want-- no matter what happens here-- the 53 00:02:27,169 --> 00:02:30,689 sine of 2x's or maybe cosine of 2x's to still exist. If 54 00:02:30,689 --> 00:02:33,729 this was a sine of 2x, there's nothing I could do to a sine 55 00:02:33,729 --> 00:02:35,919 of x, or nothing at least trivial that I could do 56 00:02:35,919 --> 00:02:36,639 to the sine of x. 57 00:02:36,639 --> 00:02:38,339 It would end up with a sine of 2x. 58 00:02:38,340 --> 00:02:40,900 So whatever's here, I want here. 59 00:02:40,900 --> 00:02:48,780 Plus B, some undetermined coefficient times cosine of x. 60 00:02:48,780 --> 00:02:50,289 And once again, this was sine of 2x. 61 00:02:50,289 --> 00:02:52,739 I'd want a cosine of 2x here. 62 00:02:52,740 --> 00:02:56,030 So let's figure out its first and second derivitives. 63 00:02:56,030 --> 00:03:05,756 So the first derivative of this y prime is equal to A 64 00:03:05,756 --> 00:03:08,680 cosine of x. 65 00:03:08,680 --> 00:03:15,170 Cosine derivative is minus sine, so minus B sine of x. 66 00:03:15,169 --> 00:03:16,509 And then the second derivitive-- 67 00:03:16,509 --> 00:03:18,929 I'll write down here. 68 00:03:18,930 --> 00:03:21,960 The second derivative is equal to what? 69 00:03:21,960 --> 00:03:28,640 Derivative of cosine is minus sine, so minus A sine of x 70 00:03:28,639 --> 00:03:30,509 minus B cosine of x. 71 00:03:30,509 --> 00:03:33,329 72 00:03:33,330 --> 00:03:35,420 I think you're starting to see that the hardest thing in most 73 00:03:35,419 --> 00:03:38,269 differential equations problems is not making 74 00:03:38,270 --> 00:03:39,040 careless mistakes. 75 00:03:39,039 --> 00:03:43,479 It's a lot of algebra and a lot of fairly basic calculus. 76 00:03:43,479 --> 00:03:47,250 And the real trick is to not make careless mistakes. 77 00:03:47,250 --> 00:03:48,930 Every time I say that, I tend to make one. 78 00:03:48,930 --> 00:03:51,240 So I'm going to focus extra right now. 79 00:03:51,240 --> 00:03:54,930 So anyway, let's take these and substitute them back into 80 00:03:54,930 --> 00:03:57,110 this nonhomogeneous equation. 81 00:03:57,110 --> 00:03:59,820 Let's see if I can solve for A and B. 82 00:03:59,819 --> 00:04:02,032 So the second derivative is that. 83 00:04:02,032 --> 00:04:04,559 84 00:04:04,560 --> 00:04:06,310 Let me just rewrite it, just so that you 85 00:04:06,310 --> 00:04:07,449 see what I'm doing. 86 00:04:07,449 --> 00:04:08,865 So I'm going to take the second derivative, y prime 87 00:04:08,866 --> 00:04:17,689 prime, so that's minus A sine of x minus B cosine of x. 88 00:04:17,689 --> 00:04:21,360 I'm going to add minus 3 times the first derivative to that. 89 00:04:21,360 --> 00:04:22,960 And I'm going to write the sines under the sines and the 90 00:04:22,959 --> 00:04:24,089 cosines under the consines. 91 00:04:24,089 --> 00:04:27,389 So minus 3 times this. 92 00:04:27,389 --> 00:04:28,639 So the sine is, let's see. 93 00:04:28,639 --> 00:04:39,370 It's plus 3B sine of x minus 3 times this. 94 00:04:39,370 --> 00:04:49,189 So minus 3A cosine of x. 95 00:04:49,189 --> 00:04:54,160 And then minus 4 times our original function. 96 00:04:54,160 --> 00:05:00,650 So minus 4A sine of x. 97 00:05:00,649 --> 00:05:01,049 Right? 98 00:05:01,050 --> 00:05:02,250 Minus 4 times that. 99 00:05:02,250 --> 00:05:04,269 Minus 4 times this. 100 00:05:04,269 --> 00:05:09,331 Minus 4B cosine of x. 101 00:05:09,331 --> 00:05:15,584 And when I take the sum of all of those-- that's essentially 102 00:05:15,584 --> 00:05:17,919 the left-hand side to this equation-- when I take the sum 103 00:05:17,920 --> 00:05:22,870 of all of that, that is equal to 2 sine of x. 104 00:05:22,870 --> 00:05:24,740 I could have written them out in a line, but it would have 105 00:05:24,740 --> 00:05:25,215 just been more confusing. 106 00:05:25,214 --> 00:05:28,839 And now this makes it easy to add up the sine of x's and the 107 00:05:28,839 --> 00:05:30,539 cosine of x's. 108 00:05:30,540 --> 00:05:32,960 So if I add up all the coefficients on the sine of x, 109 00:05:32,959 --> 00:05:35,979 I get minus A plus 3B minus 4A. 110 00:05:35,980 --> 00:05:46,290 So that looks like minus 5A plus 3B sine of x plus-- and 111 00:05:46,290 --> 00:05:47,620 now what are the coefficients here? 112 00:05:47,620 --> 00:05:50,149 113 00:05:50,149 --> 00:05:55,379 I have minus B and then I have another minus 4B, so minus 5B 114 00:05:55,379 --> 00:05:56,759 and then minus 3A. 115 00:05:56,759 --> 00:06:05,889 So minus 3A minus 5B cosine of x. 116 00:06:05,889 --> 00:06:08,519 The cosine of x should go right here. 117 00:06:08,519 --> 00:06:11,969 So anyway, how do I solve for A and B? 118 00:06:11,970 --> 00:06:17,710 Well, I have the minus 5A 3B is equal to whatever 119 00:06:17,709 --> 00:06:19,430 coefficients in front of sine of x here. 120 00:06:19,430 --> 00:06:25,090 So minus 5A plus 3B must be equal to 2. 121 00:06:25,089 --> 00:06:28,609 And then minus 3A minus 5B is the coefficient on cosine of 122 00:06:28,610 --> 00:06:30,319 x, although I kind of squeezed in the 123 00:06:30,319 --> 00:06:32,319 cosine of x here, right? 124 00:06:32,319 --> 00:06:35,040 So this must be equal to whatever the coefficient on 125 00:06:35,040 --> 00:06:37,319 cosine of x is on the right-hand side. 126 00:06:37,319 --> 00:06:40,159 Well the coefficient of cosine of x on the 127 00:06:40,160 --> 00:06:41,939 right-hand side is 0. 128 00:06:41,939 --> 00:06:44,480 So that sets up a system of two 129 00:06:44,480 --> 00:06:45,840 unknowns with two equations. 130 00:06:45,839 --> 00:06:47,500 A linear system. 131 00:06:47,500 --> 00:06:57,720 So we get minus 5A plus 3B is equal to 2. 132 00:06:57,720 --> 00:07:07,326 And we get minus 3A minus 5B is equal to 0. 133 00:07:07,326 --> 00:07:10,680 134 00:07:10,680 --> 00:07:14,170 And let's see if I can simplify this a little bit. 135 00:07:14,170 --> 00:07:14,790 Let's see. 136 00:07:14,790 --> 00:07:16,920 This is a system of two unknowns, two equations. 137 00:07:16,920 --> 00:07:23,530 If I multiply the top equation by 5 1/3s, right? 138 00:07:23,529 --> 00:07:27,409 Actually, let me multiply the top equation by 5 1/3s. 139 00:07:27,410 --> 00:07:41,630 I get minus 25/3 A plus 5B is equal to 5 1/3s times this. 140 00:07:41,629 --> 00:07:46,670 5 1/3s times 2 is 10 1/3s. 141 00:07:46,670 --> 00:07:50,990 And the bottom equation is minus 3A minus 142 00:07:50,990 --> 00:07:54,319 5B is equal to 0. 143 00:07:54,319 --> 00:07:56,310 Let's add the two equations. 144 00:07:56,310 --> 00:08:01,250 I get 10 1/3s is equal to-- these cancel out. 145 00:08:01,250 --> 00:08:17,569 That's minus 25/3 minus 9/3 A is equal to 10 1/3s. 146 00:08:17,569 --> 00:08:21,259 This is getting a little bit messier than I like, but we'll 147 00:08:21,259 --> 00:08:23,000 soldier on. 148 00:08:23,000 --> 00:08:28,230 So minus 25 minus 9. 149 00:08:28,230 --> 00:08:29,960 What's minus 25 minus 9? 150 00:08:29,959 --> 00:08:32,120 So that is 34. 151 00:08:32,120 --> 00:08:41,600 So we get 34 over 3A is equal to 10/3. 152 00:08:41,600 --> 00:08:44,058 We can multiply both sides by 3. 153 00:08:44,058 --> 00:08:45,769 Divide both sides by 34. 154 00:08:45,769 --> 00:08:52,360 A is equal to 10/34, which is equal to 5/17. 155 00:08:52,360 --> 00:08:53,830 Nice ugly number. 156 00:08:53,830 --> 00:08:58,000 5/17 and now we can solve for B. 157 00:08:58,000 --> 00:08:59,340 So let's see. 158 00:08:59,340 --> 00:09:05,800 Minus 3 times A minus 3 times A. 159 00:09:05,799 --> 00:09:12,529 5/17 minus 5B is equal to 0. 160 00:09:12,529 --> 00:09:13,429 So that's what? 161 00:09:13,429 --> 00:09:21,129 Minus 15/17 is equal to plus 5B. 162 00:09:21,129 --> 00:09:23,269 I just took this and put it on the right-hand side. 163 00:09:23,269 --> 00:09:28,429 And then divide both sides by 5. 164 00:09:28,429 --> 00:09:31,179 165 00:09:31,179 --> 00:09:31,989 Oh, you know what? 166 00:09:31,990 --> 00:09:33,330 I realized I made a careless mistake here. 167 00:09:33,330 --> 00:09:34,990 Minus 25 minus 9. 168 00:09:34,990 --> 00:09:38,159 That's the minus 34 over 3. 169 00:09:38,159 --> 00:09:40,529 so minus 34A is equal to 10. 170 00:09:40,529 --> 00:09:45,509 A is equal to minus 10/34 or minus 5/17. 171 00:09:45,509 --> 00:09:49,309 So minus 3 times minus 5/17. 172 00:09:49,309 --> 00:09:55,979 So 5/17 is equal to plus 5B, right? 173 00:09:55,980 --> 00:10:01,050 And then we get B is equal to 3/17. 174 00:10:01,049 --> 00:10:03,049 That was hairy. 175 00:10:03,049 --> 00:10:05,870 And notice, the hard part was not losing 176 00:10:05,870 --> 00:10:07,100 your negative sines. 177 00:10:07,100 --> 00:10:10,710 But anyway, we now have our particular solution to this. 178 00:10:10,710 --> 00:10:15,030 179 00:10:15,029 --> 00:10:17,139 let me try to write in a non-nauseating color, although 180 00:10:17,139 --> 00:10:19,149 I think I picked a nauseating one. 181 00:10:19,149 --> 00:10:27,480 The particular solution is A minus 5/17 sine of x-- right? 182 00:10:27,480 --> 00:10:33,159 That was a coefficient on sine of x-- plus B plus 3/17 times 183 00:10:33,159 --> 00:10:35,240 cosine of x. 184 00:10:35,240 --> 00:10:38,299 And if we look at our original problem, the general solution 185 00:10:38,299 --> 00:10:41,309 out of this nonhomogeneous equation would be this-- which 186 00:10:41,309 --> 00:10:44,009 is the general solution to the homogeneous equation, which 187 00:10:44,009 --> 00:10:47,950 we've done many videos on-- plus now our particular 188 00:10:47,950 --> 00:10:52,690 solution that we solved using the method of undetermined 189 00:10:52,690 --> 00:10:53,330 coefficient. 190 00:10:53,330 --> 00:10:56,420 So if you just take that and add it to that, you're done. 191 00:10:56,419 --> 00:10:57,849 And I am out of time. 192 00:10:57,850 --> 00:11:00,070 See you in the next video.