1 00:00:00,000 --> 00:00:00,970 2 00:00:00,970 --> 00:00:02,929 A lot of what you'll learn in differential equations is 3 00:00:02,930 --> 00:00:06,640 really just different bags of tricks. 4 00:00:06,639 --> 00:00:08,929 And in this video I'll show you one of those tricks. 5 00:00:08,929 --> 00:00:11,359 And it's useful beyond this. 6 00:00:11,359 --> 00:00:14,049 Because it's always good when, if maybe one day, you become a 7 00:00:14,050 --> 00:00:16,129 mathematician or a physicist, and you 8 00:00:16,129 --> 00:00:17,500 have an unsolved problem. 9 00:00:17,500 --> 00:00:19,890 Some of these tricks that solved simpler problems back 10 00:00:19,890 --> 00:00:23,949 in your education might be a useful trick that solves some 11 00:00:23,949 --> 00:00:25,730 unsolved problems. So it's good to see it. 12 00:00:25,730 --> 00:00:28,260 And if you're taking differential equations, it 13 00:00:28,260 --> 00:00:29,240 might be on an exam. 14 00:00:29,239 --> 00:00:29,910 So it's good to learn. 15 00:00:29,910 --> 00:00:32,140 So we'll learn about integrating factors. 16 00:00:32,140 --> 00:00:35,810 So let's say, we have an equation that has this form. 17 00:00:35,810 --> 00:00:38,120 Let's say this is my differential equation. 18 00:00:38,119 --> 00:00:44,609 3xy-- I'm trying to write it neatly as possible-- plus y 19 00:00:44,609 --> 00:00:58,539 squared plus x squared plus xy times y prime is equal to 0. 20 00:00:58,539 --> 00:01:01,950 So, especially since we've covered this in recent videos, 21 00:01:01,950 --> 00:01:04,700 whenever you see an equation of this form where you have 22 00:01:04,700 --> 00:01:07,310 some function of xy, then you have another function of x and 23 00:01:07,310 --> 00:01:11,350 y times y prime equals 0, you said, oh, this looks like this 24 00:01:11,349 --> 00:01:13,439 could be an exact differential equation. 25 00:01:13,439 --> 00:01:14,679 And how do we test that? 26 00:01:14,680 --> 00:01:17,460 Well, we can take the partial derivative of this with 27 00:01:17,459 --> 00:01:20,119 respect to y, and we could call this 28 00:01:20,120 --> 00:01:21,990 function of x and y, M. 29 00:01:21,989 --> 00:01:27,469 So the partial of that, with respect to y, so M partial 30 00:01:27,469 --> 00:01:33,760 with respect to y, would be 3x plus 2y. 31 00:01:33,760 --> 00:01:37,670 And if this function right here, that expression right 32 00:01:37,670 --> 00:01:41,530 there, that's our function N, which is a 33 00:01:41,530 --> 00:01:42,739 function of x and y. 34 00:01:42,739 --> 00:01:46,519 We take the partial with respect to x, and we get that 35 00:01:46,519 --> 00:01:49,775 is equal to 2x plus y. 36 00:01:49,775 --> 00:01:52,619 And in order for this to have been an exact differential 37 00:01:52,620 --> 00:01:55,439 equation, the partial of this with respect to y would have 38 00:01:55,439 --> 00:01:58,170 to equal the partial of this with respect to x. 39 00:01:58,170 --> 00:02:00,120 But we see here, just by looking at these two, they 40 00:02:00,120 --> 00:02:02,510 don't equal each other. 41 00:02:02,510 --> 00:02:03,600 They're not equal. 42 00:02:03,599 --> 00:02:06,149 So, at least superficially, the way we looked at it just 43 00:02:06,150 --> 00:02:09,939 now, this is not an exact differential equation. 44 00:02:09,939 --> 00:02:14,409 But what if there were some factor, or I guess some 45 00:02:14,409 --> 00:02:16,710 function that we could multiply both sides of this 46 00:02:16,710 --> 00:02:19,980 equation by, that would make it an exact 47 00:02:19,979 --> 00:02:21,149 differential equation? 48 00:02:21,150 --> 00:02:24,870 So let's call that mu. 49 00:02:24,870 --> 00:02:26,789 So what I want to do is I want to multiply both sides of this 50 00:02:26,789 --> 00:02:30,969 equation by some function mu, and then see if I can solve 51 00:02:30,969 --> 00:02:33,319 for that function mu that would make it exact. 52 00:02:33,319 --> 00:02:35,259 So let's try to do that. 53 00:02:35,259 --> 00:02:37,449 So let's multiply both sides by mu. 54 00:02:37,449 --> 00:02:40,359 And just as a simplification, mu could be a 55 00:02:40,360 --> 00:02:41,560 function of x and y. 56 00:02:41,560 --> 00:02:42,670 It could be a function of x. 57 00:02:42,669 --> 00:02:44,559 It could be a function of just x. 58 00:02:44,560 --> 00:02:46,270 It could be function of just y. 59 00:02:46,270 --> 00:02:48,880 I'll assume it's just a function of x. 60 00:02:48,879 --> 00:02:50,810 You could assume it's just a function of y and 61 00:02:50,810 --> 00:02:51,810 try to solve it. 62 00:02:51,810 --> 00:02:54,150 Or you could just assume it's a function of x and y. 63 00:02:54,150 --> 00:02:56,710 If you assume it's a function of x and y, it becomes a lot 64 00:02:56,710 --> 00:02:57,500 harder to solve for. 65 00:02:57,500 --> 00:02:59,340 But that doesn't mean that there isn't one. 66 00:02:59,340 --> 00:03:03,530 So let's say that mu is a function of x. 67 00:03:03,530 --> 00:03:05,340 And I want to multiply it by both of these equations. 68 00:03:05,340 --> 00:03:16,909 So I get mu of x times 3xy plus y squared plus mu of x 69 00:03:16,909 --> 00:03:24,460 times x squared plus xy times y prime. 70 00:03:24,460 --> 00:03:26,750 And then, what's 0 times any function? 71 00:03:26,750 --> 00:03:27,990 Well, it's just going to be 0, right? 72 00:03:27,990 --> 00:03:31,010 0 times mu of x is just going to be 0. 73 00:03:31,009 --> 00:03:34,159 But I did multiply the right hand side times mu of x. 74 00:03:34,159 --> 00:03:35,719 And remember what we're doing. 75 00:03:35,719 --> 00:03:39,219 This mu of x is-- when we multiply it, the goal is, 76 00:03:39,219 --> 00:03:41,639 after multiplying both sides of the equation by it, we 77 00:03:41,639 --> 00:03:43,209 should have an exact equation. 78 00:03:43,210 --> 00:03:49,180 So now, if we consider this whole thing our new M, the 79 00:03:49,180 --> 00:03:51,960 partial derivative of this with respect to y should be 80 00:03:51,960 --> 00:03:54,070 equal to the partial derivative of this with 81 00:03:54,069 --> 00:03:55,569 respect to x. 82 00:03:55,569 --> 00:03:58,549 So what's the partial derivative of this with 83 00:03:58,550 --> 00:04:01,490 respect to y? 84 00:04:01,490 --> 00:04:04,280 Well, if we're taking the partial with respect to y 85 00:04:04,280 --> 00:04:07,550 here, mu of x, which is only a function of x, it's not a 86 00:04:07,550 --> 00:04:10,570 function of y, it's just a constant term, right? 87 00:04:10,569 --> 00:04:13,060 We take a partial with respect to y. x is just a constant, or 88 00:04:13,060 --> 00:04:15,729 a function of x can be viewed just as a constant. 89 00:04:15,729 --> 00:04:19,778 So the partial of this with respect to y is going to be 90 00:04:19,778 --> 00:04:31,170 equal to mu of x, you could just say, times 3x plus 2y. 91 00:04:31,170 --> 00:04:33,939 That's the partial of this with respect to y. 92 00:04:33,939 --> 00:04:38,009 And what's the partial of this with respect to x? 93 00:04:38,009 --> 00:04:40,110 Well, here, we'll use the product rule. 94 00:04:40,110 --> 00:04:42,810 So we'll take the derivative of the first expression with 95 00:04:42,810 --> 00:04:45,370 respect to x. mu of x is no longer a constant anymore, 96 00:04:45,370 --> 00:04:48,050 since we're taking the partial with respect to x. 97 00:04:48,050 --> 00:04:51,350 So the derivative of mu of x with respect to x. 98 00:04:51,350 --> 00:04:55,470 Well, that's just mu prime of x, mu prime, not U. 99 00:04:55,470 --> 00:04:57,980 mu prime of x. 100 00:04:57,980 --> 00:04:58,975 mu is the Greek letter. 101 00:04:58,975 --> 00:05:02,560 It's for the muh sound, but it looks a lot like a U. 102 00:05:02,560 --> 00:05:07,449 So mu prime of x times a second expression, x squared 103 00:05:07,449 --> 00:05:12,569 plus xy, plus just the first expression. 104 00:05:12,569 --> 00:05:15,149 This is just the product rule, mu of x. 105 00:05:15,149 --> 00:05:17,409 Times the derivative of the second expression 106 00:05:17,410 --> 00:05:19,390 with respect to x. 107 00:05:19,389 --> 00:05:26,899 So times-- ran out of space on that line-- 2x plus y. 108 00:05:26,899 --> 00:05:30,759 And now for this new equation, where I multiplied 109 00:05:30,759 --> 00:05:31,689 both sides by mu. 110 00:05:31,689 --> 00:05:34,810 In order for this to be exact, these two things have to be 111 00:05:34,810 --> 00:05:36,300 equal to each other. 112 00:05:36,300 --> 00:05:37,960 So let's just remember the big picture. 113 00:05:37,959 --> 00:05:40,789 We're kind of saying, this is going to be exact. 114 00:05:40,790 --> 00:05:43,340 And now, we're going to try to solve for mu. 115 00:05:43,339 --> 00:05:46,069 So let's see if we can do that. 116 00:05:46,069 --> 00:05:57,310 So let's see, on this side, we have mu of x times 3x plus 2y. 117 00:05:57,310 --> 00:06:00,209 And let's subtract this expression from both sides. 118 00:06:00,209 --> 00:06:07,049 So it's minus mu of x times 2x plus y. 119 00:06:07,050 --> 00:06:08,850 You'll see a lot of these differential equation problems 120 00:06:08,850 --> 00:06:09,470 that get kind of hairy. 121 00:06:09,470 --> 00:06:12,100 They're really just a lot of algebra. 122 00:06:12,100 --> 00:06:14,350 And that equals-- what do we have left? 123 00:06:14,350 --> 00:06:15,780 I'll write it in yellow. 124 00:06:15,779 --> 00:06:18,269 That equals-- I'm going to run out of space. 125 00:06:18,269 --> 00:06:19,699 I'm going to do it a little bit lower. 126 00:06:19,699 --> 00:06:21,670 That equals, just this term right here. 127 00:06:21,670 --> 00:06:29,830 That equals mu prime of x times x squared plus xy. 128 00:06:29,829 --> 00:06:35,019 And let's see, if we factor out a mu of x here, we get mu 129 00:06:35,019 --> 00:06:46,859 of x times 3x plus 2y minus 2x minus y is equal to mu prime 130 00:06:46,860 --> 00:06:49,780 of x, the derivative of mu with respect to x, times x 131 00:06:49,779 --> 00:06:52,084 squared plus xy. 132 00:06:52,084 --> 00:06:55,159 133 00:06:55,160 --> 00:06:56,200 Now, we can simplify this. 134 00:06:56,199 --> 00:07:05,519 So we get mu of x times-- what is this-- 3x minus 2x is x. 135 00:07:05,519 --> 00:07:10,839 2y minus y, so x plus y, is equal to-- and I'm just going 136 00:07:10,839 --> 00:07:13,129 to simplify this side a little bit-- is equal 137 00:07:13,129 --> 00:07:15,959 to mu prime of x. 138 00:07:15,959 --> 00:07:16,949 Let's factor out an x here. 139 00:07:16,949 --> 00:07:19,259 And the reason why I'm doing that is because it seems like 140 00:07:19,259 --> 00:07:21,629 if I factor out an x here, I'll get an x plus y. 141 00:07:21,629 --> 00:07:29,180 So this is mu prime of x times x times x plus y. 142 00:07:29,180 --> 00:07:31,709 x times x plus y is x squared plus xy. 143 00:07:31,709 --> 00:07:34,159 So that's why I did it, and I have this x plus y on both 144 00:07:34,160 --> 00:07:37,540 sides equation, which I will now divide both sides by. 145 00:07:37,540 --> 00:07:40,560 So if you divide both sides by x plus y, we could maybe 146 00:07:40,560 --> 00:07:43,240 assume that it's not 0. 147 00:07:43,240 --> 00:07:44,850 That simplifies things pretty dramatically. 148 00:07:44,850 --> 00:07:54,710 We get mu of x is equal to mu prime of x times x. 149 00:07:54,709 --> 00:07:57,459 150 00:07:57,459 --> 00:08:01,729 And now, just the way my brain works, I like to rewrite this 151 00:08:01,730 --> 00:08:05,439 expression just in our operator form, where instead 152 00:08:05,439 --> 00:08:06,930 of writing it mu prime of x, we could write 153 00:08:06,930 --> 00:08:08,660 that as d mu dx. 154 00:08:08,660 --> 00:08:09,790 So let's do that. 155 00:08:09,790 --> 00:08:17,420 So we could write mu of x is equal to d, the derivative of 156 00:08:17,420 --> 00:08:22,250 mu with respect to x, times x. 157 00:08:22,250 --> 00:08:23,970 And this is actually a separable differential 158 00:08:23,970 --> 00:08:25,520 equation in and of itself. 159 00:08:25,519 --> 00:08:27,319 It's kind of a sub-differential equation to 160 00:08:27,319 --> 00:08:28,290 solve our broader one. 161 00:08:28,290 --> 00:08:29,840 We're just trying to figure out the integrating factor 162 00:08:29,839 --> 00:08:30,719 right here. 163 00:08:30,720 --> 00:08:34,038 So let's divide both sides by x. 164 00:08:34,038 --> 00:08:41,600 So we get mu over x, this is just a separable equation now, 165 00:08:41,600 --> 00:08:46,009 is equal to d mu dx. 166 00:08:46,009 --> 00:08:50,789 And then, let's divide both sides by mu of x, and we get 1 167 00:08:50,789 --> 00:08:57,219 over x is equal to 1 over mu. 168 00:08:57,220 --> 00:08:59,490 That's mu of x, I'll just write 1 over mu right now, for 169 00:08:59,490 --> 00:09:03,810 simplicity, times d mu dx. 170 00:09:03,809 --> 00:09:06,079 I'm actually going to go horizontal right here. 171 00:09:06,080 --> 00:09:12,150 Multiply both sides by dx, you get 1 over x dx is equal to 1 172 00:09:12,149 --> 00:09:15,169 over mu of x d mu. 173 00:09:15,169 --> 00:09:18,669 Now, you could integrate both sides of this, and you'll get 174 00:09:18,669 --> 00:09:20,889 the natural log of the absolute value of x is equal 175 00:09:20,889 --> 00:09:22,830 to the natural log of the absolute value of mu, et 176 00:09:22,830 --> 00:09:23,250 cetera, et cetera. 177 00:09:23,250 --> 00:09:26,659 But it should be pretty clear from this that x is equal to 178 00:09:26,659 --> 00:09:29,069 mu, or mu is equal to x, right? 179 00:09:29,070 --> 00:09:29,930 They're identical. 180 00:09:29,929 --> 00:09:32,399 If you look at both sides of this equation there, you can 181 00:09:32,399 --> 00:09:36,159 just change x for mu, and it becomes the other side. 182 00:09:36,159 --> 00:09:42,559 So, this is obviously telling us that mu of x is equal to x. 183 00:09:42,559 --> 00:09:44,649 Or mu is equal to x. 184 00:09:44,649 --> 00:09:46,590 So we have our integrating factor. 185 00:09:46,590 --> 00:09:48,470 And if you want, you can take the antiderivative of both 186 00:09:48,470 --> 00:09:50,310 sides with the natural logs, and all of that. 187 00:09:50,309 --> 00:09:51,869 And you'll get the same answer. 188 00:09:51,870 --> 00:09:55,269 But this is just, by looking at it, by inspection, you know 189 00:09:55,269 --> 00:09:57,419 that mu is equal to x. 190 00:09:57,419 --> 00:09:58,500 Because both sides of this equation are 191 00:09:58,500 --> 00:10:00,179 completely the same. 192 00:10:00,179 --> 00:10:02,809 Anyway, we now have our integrating factor. 193 00:10:02,809 --> 00:10:04,299 But I am running out of time. 194 00:10:04,299 --> 00:10:06,229 So in the next video, we're now going to use this 195 00:10:06,230 --> 00:10:07,009 integrating factor. 196 00:10:07,009 --> 00:10:09,649 Multiply it times our original differential equation. 197 00:10:09,649 --> 00:10:10,689 Make it exact. 198 00:10:10,690 --> 00:10:13,110 And then solve it as an exact equation. 199 00:10:13,110 --> 00:10:15,539 I'll see you in the next video. 200 00:10:15,539 --> 00:10:15,899