WEBVTT 1 00:00:00.000 --> 00:00:07.600 Well hello everyone, welcome to our second lecture on partial differentiation. We introduced 2 00:00:07.600 --> 00:00:15.760 partial differentiation in our last lecture and we looked at functions of two variables 3 00:00:15.760 --> 00:00:22.280 and we then looked at the geometrical interpretation of partial derivatives and looked at some different 4 00:00:22.280 --> 00:00:27.680 notation for the partial derivative. We then went on to calculate the partial derivatives 5 00:00:27.680 --> 00:00:34.600 of some standard functions before finishing off with looking at some chain rules for differentiating 6 00:00:34.600 --> 00:00:41.520 a function of two variables. Today we're going to carry on with partial differentiation 7 00:00:41.520 --> 00:00:45.880 and we're going to look at the product rule for a function of two variables, the quotient 8 00:00:45.880 --> 00:00:51.680 rule for a function of two variables and we'll finish off by looking at higher order partial 9 00:00:51.680 --> 00:01:00.400 derivatives. So but first of all let's remind ourselves of the product rule for a function 10 00:01:00.400 --> 00:01:06.560 of one variable. So one important thing to notice if you've got two functions multiplied 11 00:01:06.560 --> 00:01:13.760 together something like x squared sine x two functions of one variable then the product 12 00:01:13.760 --> 00:01:19.720 rule is not as many people right? It's not the derivative of the first function times 13 00:01:19.720 --> 00:01:25.360 the derivative of the second function. That's completely wrong. To differentiate a product 14 00:01:25.360 --> 00:01:31.200 you must use what's called the product rule and the product rule is given here. We've 15 00:01:31.200 --> 00:01:36.800 got the product of two functions of x, f and g. I haven't bothered writing the brackets 16 00:01:36.800 --> 00:01:44.920 x because we just accept that these are functions of x. So the product rule says that it's a 17 00:01:44.920 --> 00:01:51.120 derivative of the first function times the second function, f dashed times g plus the 18 00:01:51.120 --> 00:01:56.640 first function times the derivative of the second function that's f times g dashed. So 19 00:01:56.640 --> 00:02:04.520 that is the formula we must use when we're differentiating a function that's a product 20 00:02:04.520 --> 00:02:09.600 and there's only one variable involved. So we must use this function and you'll have seen 21 00:02:09.600 --> 00:02:15.440 that in the past. We're now going to extend differentiating products to functions of 22 00:02:15.440 --> 00:02:24.440 two variables. I'm going to follow this pattern when we're deriving a rule for the product 23 00:02:24.440 --> 00:02:32.680 of two functions, the derivative of the product of two functions of two variables. So here's 24 00:02:32.840 --> 00:02:40.320 our function z of x, y is equal to f of x, y times g of x, y. Now I'm going to draw the 25 00:02:40.320 --> 00:02:47.760 x, y notation. It just gets a bit crowded. We know that these are f and g are functions 26 00:02:47.760 --> 00:02:53.080 of the two variables x and y. So we're going to calculate that product. Now the rule stays 27 00:02:53.080 --> 00:02:59.680 exactly the same really. Here we only had one variable so we could write f dash to represent 28 00:02:59.680 --> 00:03:08.320 the derivative with respect to x, a. In this case now we've got two variables. So writing 29 00:03:08.320 --> 00:03:14.200 f dashed isn't really clear because we don't know whether it's the x we're differentiating 30 00:03:14.200 --> 00:03:17.960 with respect to or whether it's the y we're differentiating with respect to. So what we 31 00:03:17.960 --> 00:03:24.040 do in this case is we use the notation we saw in the last lecture, an alternative notation 32 00:03:24.040 --> 00:03:30.860 for the partial derivative with respect to x. We write x as a subscript. So this means 33 00:03:30.860 --> 00:03:37.360 find the partial derivative of f with respect to x multiplied by the function g. To that 34 00:03:37.360 --> 00:03:45.400 we add the function f multiplied by the partial derivative of g with respect to x. So it's 35 00:03:45.400 --> 00:03:52.960 very very similar to the formula for the product rule when we've got a function of one variable 36 00:03:53.080 --> 00:03:57.640 when we're multiplying two functions of one variable. It's very similar except that now 37 00:03:57.640 --> 00:04:02.680 we must explicitly write the variable that we're differentiating with respect to. And 38 00:04:02.680 --> 00:04:08.680 that's all that does. And we've got a similar definition for the partial derivative with 39 00:04:08.680 --> 00:04:16.520 respect to y when we've got a product. So it's f sub y times g plus f g sub y, where 40 00:04:16.520 --> 00:04:21.880 the f sub y and the g sub y represent the partial derivative of f with respect to y 41 00:04:22.000 --> 00:04:28.560 and the partial derivative of g with respect to y. So that's what we have to do. So let's 42 00:04:28.560 --> 00:04:38.760 have a look at an example. So our function said equal to f of xy if you like, said as 43 00:04:38.760 --> 00:04:45.040 a function of x and y. It's a function of two variables. We've got this function to start 44 00:04:45.040 --> 00:04:50.880 with x cubed plus four y squared and we're multiplying it by the second function e to 45 00:04:50.880 --> 00:04:58.000 the two xy. So this is clearly a product and we need the product rule for it. Clearly a 46 00:04:58.000 --> 00:05:02.680 product of a function of two variables and another function of two variables. So we need 47 00:05:02.680 --> 00:05:07.840 the product rule here and we're asked to find the partial with respect to x and the partial 48 00:05:07.960 --> 00:05:16.240 derivative with respect to y. So I'm going to define one function equal to f and the 49 00:05:16.240 --> 00:05:22.560 other function equal to g. It doesn't matter which. So I'm going to define the first function 50 00:05:22.560 --> 00:05:27.800 x cubed plus four y squared. I'm going to define that as f of xy. So that's going to 51 00:05:27.800 --> 00:05:33.840 be my f function. My g function or g of xy function is the second function, the exponential 52 00:05:33.840 --> 00:05:41.960 function e to the two xy. And if we remember from the previous slide, these are the formulae 53 00:05:41.960 --> 00:05:47.760 for the first order partial derivative with respect to x and the first order partial derivative 54 00:05:47.760 --> 00:05:56.360 with respect to y. So that means I've got f and I've got g to get the partial of z with 55 00:05:56.360 --> 00:06:01.560 respect to x. And first of all, I've got to find the partial derivative of f with respect 56 00:06:01.600 --> 00:06:06.400 to x and the partial derivative of g with respect to x. That's before I can use the 57 00:06:06.400 --> 00:06:10.680 formula. And I've got to do a similar thing before I can get the partial with respect 58 00:06:10.680 --> 00:06:16.920 to y. I've got to find the derivative of f with respect to y and the partial derivative 59 00:06:16.920 --> 00:06:22.960 of g with respect to y. So let's get started on that. So first of all, we'll do partial 60 00:06:22.960 --> 00:06:30.800 derivative z by dx. And we defined f as being x cubed plus four y squared and g equal to 61 00:06:30.800 --> 00:06:39.040 e to the two xy. So I'll differentiate f with respect to x. Well, if I do that, differentiate 62 00:06:39.040 --> 00:06:46.040 x cubed with respect to x, I get three x squared. Now, remember, we treat y as a constant 63 00:06:46.040 --> 00:06:51.440 when we differentiate with respect to x. So y and any function of y, like y squared 64 00:06:51.440 --> 00:06:56.520 or four y squared is treated as a constant. And when you differentiate with respect to 65 00:06:56.520 --> 00:07:02.400 x, and if you differentiate a constant, you get zero. So that term will vanish when we 66 00:07:02.400 --> 00:07:07.960 differentiate it. So we just get three x squared. Now, our second function g, we've got to 67 00:07:07.960 --> 00:07:14.600 differentiate that with respect to x as well. So if we look at it, though, we've got an 68 00:07:14.600 --> 00:07:21.840 exponential function applied to the function two xy. So this is a function of a function, 69 00:07:21.840 --> 00:07:27.960 it's a composite function. So we need the chain rule. So g is equal to e to the two 70 00:07:27.960 --> 00:07:34.120 xy. I'm going to write it like this x two xy. It's maybe clearer for some people to 71 00:07:34.120 --> 00:07:41.560 see that we need the chain rule. An exponential function applied to the function two xy. So 72 00:07:41.600 --> 00:07:48.000 the chain rule, what do we do? We differentiate the outside function, and the exponential 73 00:07:48.000 --> 00:07:53.520 doesn't change when differentiated. So that just stays as an exponential, leave the bracket 74 00:07:53.520 --> 00:08:01.520 as it is, and differentiate the term inside the bracket with respect to x. Okay, so we're 75 00:08:01.520 --> 00:08:07.600 going to multiply by this quantity. So we're going to do partial d by dx of two xy. So 76 00:08:07.640 --> 00:08:18.640 we could, like we did in the last lecture, you know, we've got d by dx of two xy. So y and any 77 00:08:18.640 --> 00:08:24.280 function of y is a constant. So let's take the two y outside, and we've just got to find 78 00:08:24.280 --> 00:08:33.320 the partial with respect to x of x. So I'll just write that in. So that's partial d by dx 79 00:08:33.560 --> 00:08:42.120 of x, which is just one. So we've got two y times one, which is equal to two y. And you know, 80 00:08:42.120 --> 00:08:47.720 we're taking the exponential outside. So we've got the exponential times two y, and we can rearrange 81 00:08:47.720 --> 00:08:56.880 it as two y e to the two xy. So that's where that derivative comes from. Okay, so we're now ready 82 00:08:56.920 --> 00:09:05.160 to use our formula. So the partial of z with respect to x is f sub x times g plus fg sub 83 00:09:05.160 --> 00:09:11.840 x. And I've got all of these things up here. So f sub x is three x squared, and I can multiply 84 00:09:11.840 --> 00:09:18.080 that by g. So it's a diagonally opposite term that I multiply together. There you go there. And I 85 00:09:18.080 --> 00:09:26.520 also multiply, it's plus the product of those two diagonally opposite elements, f times g sub x. 86 00:09:26.720 --> 00:09:35.520 So that's what I've got here. Then, if I want to simplify the answer, I spot that I've got the same 87 00:09:35.520 --> 00:09:44.240 exponential term appearing in both of these expressions. So I could take this e to the two 88 00:09:44.240 --> 00:09:51.560 xy out as a common factor. That'll leave me three x squared here. And leave me this term x cubed plus 89 00:09:51.560 --> 00:10:00.000 four y squared all times two y. I've taken the exponential out of here, out of this term, and 90 00:10:00.000 --> 00:10:08.000 I've taken it out of that term. So that just leaves me this term, and that term. So I've got three x 91 00:10:08.000 --> 00:10:17.080 squared plus x cubed plus four y squared all times two y. I can then multiply out this term here. So 92 00:10:17.080 --> 00:10:24.880 I'll get two x cubed y plus eight y cubed, and that's all going to multiply the exponential e to the 93 00:10:24.880 --> 00:10:38.680 two xy. And that's it. That is the product rule applied to our function z. And we've calculated 94 00:10:38.680 --> 00:10:45.560 partial d z by dx. We've now got to get the partial d z by dy. So it's a similar process, right down 95 00:10:45.560 --> 00:10:54.520 my f and my g and differentiate both of them with respect to y. So if it's a y differentiation, I treat 96 00:10:54.560 --> 00:10:59.280 x and any function of x as a constant. So you differentiate a constant, you get zero. So that 97 00:10:59.280 --> 00:11:07.400 won't play any part. Differentiate four y squared with respect to y, I get eight y. Differentiate 98 00:11:07.400 --> 00:11:13.360 this exponential, it's a function of a function. So I need the chain rule. So this is what I'm going 99 00:11:13.400 --> 00:11:18.880 to do in this green bubble over here. I've got g equals e to the two xy. I'm going to write it as x 100 00:11:18.880 --> 00:11:25.560 to xy. So the rule, of course, for the chain rule is differentiate the outer function. Well, the 101 00:11:25.560 --> 00:11:30.880 exponential is its own derivative. So it stays the same. Leave the bracket as it is. So I'll have two 102 00:11:30.880 --> 00:11:38.440 xy in brackets, multiplied by the derivative with respect to y of the function inside the brackets. 103 00:11:39.040 --> 00:11:50.840 That's two xy. And again, I can write I've got d by dy. That's the partial d by dy of two xy. It's a y 104 00:11:50.840 --> 00:11:56.440 derivative. So x and any function of x can be taken outside. So that's what I'm going to do. And that 105 00:11:56.440 --> 00:12:02.800 just leaves me y in there. So I'm going to have two x the derivative of y with respect to y is just one. 106 00:12:02.960 --> 00:12:09.520 So it's equal to two x. And don't forget, of course, that's multiplying the exponential e to the two xy. 107 00:12:09.760 --> 00:12:17.480 So that's where that expression for the derivative of g with respect to y comes from. Then it's just a matter 108 00:12:17.520 --> 00:12:25.720 of applying the formula. So laid out in this form with f and g in the top line and f sub y and g sub y below 109 00:12:25.720 --> 00:12:35.600 them. I just multiply the diagonally opposite terms. So I'll have eight y times e to the two xy plus this term 110 00:12:35.640 --> 00:12:43.680 xq plus four y squared times two x e to the two xy. So that's what we've got. Again, I'll go and tidy this up a 111 00:12:43.680 --> 00:12:53.240 little. I've got my exponential function e to the two xy appears in both terms. There's one term there plus the 112 00:12:53.280 --> 00:13:03.960 second term, the exponential appears in both. So I can take that out as a common factor. And I'll have eight y plus this 113 00:13:03.960 --> 00:13:12.800 term xq plus four y squared times two x. I can then multiply out this bracket here to get two x to the power four 114 00:13:12.960 --> 00:13:23.080 plus eight xy squared. And all of that then multiplies the exponential. And that is my partial derivative with 115 00:13:23.120 --> 00:13:34.360 respect to y obtained using the product rule of my original function z. So there we go. So that is an example of the 116 00:13:34.360 --> 00:13:44.760 product rule being applied to differentiate the product of functions of two variables. Okay, let's do another example. 117 00:13:44.760 --> 00:13:54.960 So here we've got z to the z to log x cos xy. Do we need the product rule for this? Well, just let's just pause for a 118 00:13:54.960 --> 00:14:02.880 minute and look at this function a little closer. We've been asked to calculate the partial with respect to x to start 119 00:14:02.880 --> 00:14:11.480 with. Well, yes, we do need the product rule because our first function is log x, and that's multiplying another 120 00:14:11.520 --> 00:14:20.360 function of x cos xy. So one function of x log x, multiplying another function of x cos xy. So we definitely need the 121 00:14:20.360 --> 00:14:32.600 product rule for that. Okay, so let's do that. Let's call one of them f and the other one g. So I'm going to call the log 122 00:14:32.600 --> 00:14:40.680 x, I've called that f and g I'll call cos xy. So there's my f and there's my g. I've got to differentiate them both with 123 00:14:40.720 --> 00:14:46.840 respect to x. So differentiate log x with respect to x. Well, that's a standard derivative of a function of a single 124 00:14:46.840 --> 00:14:56.600 variable. It's just one over x. I've got to differentiate g now with respect to x. And if I look at this, I've actually got a 125 00:14:56.600 --> 00:15:08.400 function of a function. I've got the cosine function applied to the function xy. So I need to use the chain rule. So the chain 126 00:15:08.400 --> 00:15:17.560 rule, calculating the derivative with respect to x of cos xy, what does the chain rule say? Well, it says differentiate the 127 00:15:17.600 --> 00:15:27.200 outer function. So cos when you differentiate becomes minus sign, leave the bracket as it is. So you get minus sign xy and 128 00:15:27.240 --> 00:15:36.240 differentiate what's inside the bracket with respect to x. So if I do that, you know, I've got d by dx, if I just write it down 129 00:15:36.240 --> 00:15:47.880 here, I've got the partial d by dx of xy. So I can take the y outside if I like, and it's just d by dx of x, which is y times 130 00:15:47.880 --> 00:15:59.360 one, which is just y. So I'm going to have minus sign y times y. Or in other words, I can rearrange it if I want to as minus 131 00:15:59.360 --> 00:16:08.560 y, sign y. And that's where that comes from. And then it's just a straightforward matter of applying the formula. So here's your formula. The 132 00:16:08.560 --> 00:16:17.720 partial of z with respect to x is f sub x times g plus f times g sub x. And if you laid out like this, as I've said before, the f and the g 133 00:16:17.720 --> 00:16:27.440 on top and the partial derivatives down below, it's just a matter of multiplying the diagonally opposite terms. So I'll have one over 134 00:16:27.440 --> 00:16:37.200 x times cos xy to get that cos xy over x. And I'm going to have plus the product of those two. So it's going to be plus log x times 135 00:16:37.200 --> 00:16:49.720 minus y, sign xy. And the plus and the minus together gives a minus. So you're going to get minus y log x, sign xy. And that's it. That is the 136 00:16:49.720 --> 00:17:01.240 partial derivative with respect to x of this function z, which was a product of two functions of x. Okay, so now we'll have to find the 137 00:17:01.240 --> 00:17:09.540 partial derivative with respect to y. And you can use the product rule here if you like, you'll get the correct answer. But you might just 138 00:17:09.540 --> 00:17:19.920 notice something that yes, we do have two functions multiplied together. But the first function only involves x, and the second function 139 00:17:19.920 --> 00:17:27.320 involves x and y. So if we want the partial with respect to y, we don't need to use the product rule because this first function, 140 00:17:27.540 --> 00:17:38.180 log x can just be treated as a constant when we calculate the partial derivative with respect to y. So that's what I say here. 141 00:17:39.540 --> 00:17:49.620 I say note that we do not need the product rule to calculate partial descent by dy since we can treat log x as a constant. So if we do that, 142 00:17:49.620 --> 00:18:00.660 we've got partial descent by dy, we replace z with the given function. There it is. We've just finished saying that it's a y derivative. So x and any 143 00:18:00.820 --> 00:18:10.980 function of x like log x is treated as a constant. So that can be taken outside of the derivative. So there it is. And then all we have to do is 144 00:18:10.980 --> 00:18:22.300 differentiate cos xy with respect to y. And that's fairly straightforward. It's the chain rule again. Cos becomes minus sign when you 145 00:18:22.300 --> 00:18:33.820 differentiate it, leave the bracket as it is xy and differentiate xy with respect to y. You know, we can take the x outside and then get the derivative 146 00:18:33.820 --> 00:18:45.260 of y with respect to y which is 1. So the x times 1. So you'll end up with minus x sign xy. And you've got this product here. And we can just simplify that. 147 00:18:45.260 --> 00:19:01.500 Just rearrange it, move the bracket, just have minus log x, minus x log x, sorry, times sign xy. So that's yet another example of using the product rule with functions of two variables. 148 00:19:04.460 --> 00:19:14.740 Okay, moving on, that's the product rule. So we've seen the chain rule. We saw that last week and we've seen it quite a few times in this class already. And we've just looked at the product rule. 149 00:19:14.940 --> 00:19:26.860 That leaves us a quotient rule to look at. And we'll remind ourselves of the quotient rule for a function of one variable to start with and then look at how it's applied when you get a function, when you get 150 00:19:26.860 --> 00:19:43.500 functions of two variables. So let's just look at that. Okay, so the quotient rule for a function of one variable, it's f dash g minus f g times g dashed all over g squared. So, you know, if you 151 00:19:43.500 --> 00:20:03.780 remember a product rule, the way I'd written it, the way I'd written it, let's see, let's go back, there it is, product rule, the way I'd written it, it was, I had f dash g plus f g dash now written in this order to get the 152 00:20:03.780 --> 00:20:10.180 quotient rule, you just change the plus to a minus and you divide by g squared. That's all you have to do. 153 00:20:10.300 --> 00:20:33.660 Okay, so let's see if this can be extended to function of two variables and what the answer is yes it can. Here we've got a function z, which is formed by dividing a function f, which is a function of x and y by another function g, which is also a function of x and y. 154 00:20:34.060 --> 00:20:53.220 And the product rule tells us that what we have to do is, well, it's essentially the same as the single variable case, except here, you know, we can't just write f dashed g minus f g dashed because we won't really know which, you know, what f dashed refers to. 155 00:20:53.220 --> 00:21:11.540 We've referred to a differentiation with respect to x or we've referred to differentiation with respect to y. So again, what we do is we use the shorthand notation for the derivative, partial derivative with respect to x, it's f with a subscript x and we do the same thing for g, the partial 156 00:21:11.540 --> 00:21:35.900 derivative with respect to x is g sub x and that's our formula there. It's very similar to the single variable case and the same thing happens for y, except now that is a derivative with respect to y, you want to calculate of f and for g, you want to differentiate g with respect to y and we plug these into the formula and that's what we've got. 157 00:21:36.220 --> 00:21:47.940 So we've got a formula for the partial of z with respect to x and a partial formula for the partial of z with respect to y when we're using when we've got a quotient and we need to use the quotient rule. 158 00:21:48.740 --> 00:22:02.820 So let's just do an example and see how this works. So here's my function said is equal to x squared y divided by x squared plus y squared. Well, if you look at this, this is clearly 159 00:22:03.620 --> 00:22:24.300 on top, we've got a function which we'll call f. So this is clearly, I'm just get the pen and the tablet. So this is clearly z is equal to f of x, y. So x squared y is clearly a function of x and y as is the function below and that'll be g of x, y. 160 00:22:24.860 --> 00:22:37.980 So our function said is clearly a quotient involving a function on the top. That's a function of x, y, that's f and down below we've got g, which is a function of x, y. So we need the quotient rule. 161 00:22:38.660 --> 00:22:52.820 So that's all I've said here. I've decided that f is going to be equal to x squared y and g will be x squared plus y squared. So I've got my formula that I know that I discussed in the previous slide for 162 00:22:53.780 --> 00:23:02.820 the partial derivative with respect to x and the partial derivative with respect to y of a quotient f over g, this function here. 163 00:23:03.660 --> 00:23:17.980 So let's do partial respect to x first of all. So the partial with respect to x, there we are there, f and g. So I want to find and write f here and g here and down below I'll calculate the derivatives. 164 00:23:18.260 --> 00:23:30.100 So the partial with respect to x of x squared y. Well, there we are in the green bubble here. I can, it's an x derivative I'm calculating so I can take the y outside. 165 00:23:30.380 --> 00:23:39.900 All I've got to do then is differentiate x squared with respect to x and that gives me 2x and the derivative will be 2xy. So that's there. 166 00:23:40.580 --> 00:23:50.420 And similarly, I've got to calculate the partial derivative with respect to x of g. So x squared with respect to x, 2x. 167 00:23:51.820 --> 00:24:01.340 It's an x derivative. So we treat y and any function of y as a constant, differentiate a constant, you get zero. So all that survives here is 168 00:24:01.660 --> 00:24:08.300 the 2x. So the partial derivative of g with respect to x is just 2x. 169 00:24:09.260 --> 00:24:23.460 Okay, so let's put all of this together in our formula. So the formula says the top line. Well, again, if we've righted in this form with f and g on the top and the derivatives down below, it's going to be 170 00:24:23.900 --> 00:24:36.100 this diagonal, the opposite pair multiplied together. So we'll get 2xy times x squared plus y and it's minus the product of those two diagonally opposite ones. 171 00:24:36.180 --> 00:24:49.940 f times g sub x, so it's going to be 2x times x squared y. And what do we got in the denominator? We've got g all squared. So we've got to square this thing and that's what we have here. 172 00:24:50.180 --> 00:25:15.180 So we can tidy up the numerator a little. So let's multiply out these brackets. We'll get 2x cubed y plus 2xy cubed, okay, minus 2x cubed y. So that's fine. And now you might spot the first term, 2x cubed y minus 2x cubed y will give me zero. 173 00:25:15.580 --> 00:25:31.140 So the answer would just be 2xy cubed over x squared plus y squared all squared. So that's a partial derivative of our function said by using the quotient rule. That's a partial derivative with respect to x. 174 00:25:31.740 --> 00:25:58.300 I've now got to do the same thing to get the partial derivative with respect to y. So I'll define f as the top function and g as the bottom function. Down below, I'll calculate the derivatives. Now, f sub y, that means I've got to take the partial derivative with respect to y of this function, x squared y. 175 00:25:58.300 --> 00:26:11.220 It's a y derivative, so the x squared can be taken outside and that just leaves me x squared times the derivative of y with respect to y, which is just one. So it's just going to be x squared. So that's where that comes from. 176 00:26:11.980 --> 00:26:37.620 I've then got to differentiate the g function with respect to y, but that's easy because that x squared is just a constant. So that would be zero when you differentiate with respect to y. And this will become 2y. And again, I use my formula and basically it would be the product of those two, my f sub y times g. 177 00:26:37.860 --> 00:26:48.220 It would be the product of those two, x squared times x squared plus y squared minus the product of those two, minus x squared y times 2y. 178 00:26:49.220 --> 00:27:02.820 I can simplify the top, that become x to the power of 4 plus x squared y squared minus 2x squared y squared. 179 00:27:03.220 --> 00:27:13.020 Okay, there we are, that's it there. Can we simplify this in any way? Well, we can't do much with the x to the 4 term, so that stays, but look at this one. 180 00:27:13.420 --> 00:27:28.620 We've got one lot of x squared y squared minus two lots of x squared y squared, so it'll be minus one lot of x squared y squared. And if we want to, we can simplify the numerator a little by taking out a common factor. 181 00:27:29.020 --> 00:27:37.420 You've got an x squared here and x to the 4 is just x squared times x squared, so we take an x squared out as a common factor. 182 00:27:37.420 --> 00:27:49.920 So we'll need an x squared here to make our x to the 4 term and we must have minus y squared so that when we multiply it out, we'll get a minus x squared y squared and we'll put the second term in the numerator. 183 00:27:49.920 --> 00:28:12.020 So that is the partial derivative with respect to x of our original function z, which was the quotient of two functions of x and y and we applied the quotient rule to calculate partial dz by dy. 184 00:28:12.520 --> 00:28:15.120 So that's it calculated. 185 00:28:16.220 --> 00:28:38.920 Okay, so we've now seen the product rule for function of two variables. We've seen the quotient rule for function of two variables and we know from the examples we've done that it's a very similar process to when we're working with functions of a single variable when we're using the product of quotient rules for functions of single variables. 186 00:28:39.920 --> 00:28:51.920 We're now going to move on and look at something we've also seen before when we've got a function of one variable, higher order derivatives, particular higher order partial derivatives. 187 00:28:51.920 --> 00:29:01.920 But first of all, let's rewind a reminder cells of the higher order derivatives of functions of a single variable. 188 00:29:02.920 --> 00:29:13.920 So suppose you've got a function like y is equal to x cubed. If we differentiate y with respect to x, well, it's just the power rule, it'll become 3x squared. That would be the first derivative. 189 00:29:14.920 --> 00:29:29.920 We can differentiate this again to get the second derivative. So that will give us, so this is really, if I wrote this down, I've got my first derivative dy by dx. 190 00:29:30.920 --> 00:29:39.920 And I'm now going to differentiate this thing again with respect to x, so I get d by dx of that, and that gives us d squared y dx squared. 191 00:29:39.920 --> 00:29:52.920 So that is just the second derivative of our function y. So it's another word, it's a higher order derivative, a second order derivative. 192 00:29:52.920 --> 00:30:03.920 We are now going to extend this idea to functions of two variables and calculate the partial derivative, second order partial derivatives. 193 00:30:05.920 --> 00:30:21.920 So you might think that we would calculate the first order partial derivative with respect to x, and then the second order partial with respect to x, and do the same for y, the first order partial with respect to y, and get the second order partial with respect to y, and that would be it. 194 00:30:21.920 --> 00:30:34.920 Well, that's not quite true, not for second order partial derivatives. There's two other derivatives we've got to calculate, these are called the mixed second order partial derivatives, and I'll explain that through this diagram. 195 00:30:35.920 --> 00:30:40.920 So there are four types of second order partial derivatives. So let's start with our function. 196 00:30:40.920 --> 00:30:46.920 z is equal to f of x, y, z is some function of x and y. 197 00:30:48.920 --> 00:31:02.920 And we know that we can calculate, we can differentiate with respect to x to get the first order partial with respect to x, and we can differentiate with respect to y to get the first order partial with respect to y. 198 00:31:03.920 --> 00:31:20.920 We can then, with the first order partial with respect to x, we'll differentiate again with respect to x to get the second order partial with respect to x, and we can do the same thing with the first order partial with respect to y, differentiate that again with respect to y to get the second order partial with respect to y. 199 00:31:20.920 --> 00:31:36.920 Now as I said there are two other parts we must take into account. So over here in the left branch of our tree we differentiated z with respect to x and we differentiated again with respect to x. 200 00:31:36.920 --> 00:31:52.920 Now there is no reason why we can't take the first order partial respect to y with respect to x and differentiate z with respect to y. And that gives us one of the mixed second order partial derivatives. 201 00:31:52.920 --> 00:32:12.920 So coming down this branch we have done first derivative with respect to x, second derivative with respect to x. We have done first derivative with respect to x and instead of differential with respect to x we now differentiate that function there with respect to y to give us this mixed second order partial. 202 00:32:12.920 --> 00:32:24.920 Similarly in the right branch of the tree we can calculate the first order partial with respect to y, go down, differentiate again with respect to y to get the second order partial with respect to y. 203 00:32:24.920 --> 00:32:42.920 Again coming down we would differentiate with respect to y but this time we are going to differentiate this result with respect to x and that will give us the other second order mixed partial derivative. 204 00:32:42.920 --> 00:32:58.920 Now there is a result and it's based on something called Clairot's theorem or Schwartz's theorem that these two partial derivatives for the types of function we look at will always be equal. They will always be the same. 205 00:32:58.920 --> 00:33:13.920 It doesn't matter if you differentiate with respect to x first and then y or you differentiate with respect to y first and then x the result you get for the mixed second order partial will always be the same. 206 00:33:13.920 --> 00:33:24.920 Okay so let's just look at some alternative notation and have a little bit more explanation on this notation here. 207 00:33:24.920 --> 00:33:39.920 So the first order partial with respect to x we saw last time in the last lecture that we can write this in short hand notation as z sub x and the first order partial with respect to y we can write it as z sub y. 208 00:33:39.920 --> 00:33:47.920 So the x and the y in each case denote the variable with different with respect to. 209 00:33:47.920 --> 00:33:58.920 Well we can easily write that the second order partial is z sub xx and the second order partial with respect to y is z yy. 210 00:33:58.920 --> 00:34:15.920 What about these mixed partial derivatives? Well this one here what does this say? This was coming down the left branch get the partial derivative with respect to x first and then differentiate that with respect to y. 211 00:34:15.920 --> 00:34:23.920 So that was coming down here get the partial derivative with respect to x and differentiate that result with respect to y. 212 00:34:23.920 --> 00:34:32.920 So that was the notation we had here in short hand notation we write this as z sub xy. 213 00:34:32.920 --> 00:34:47.920 Now how do we know the order here? Well we work from the inside out with differentiate with respect to x first so we write the x first followed by a differentiation with respect to y so we have the y second. 214 00:34:47.920 --> 00:35:04.920 So that's why z sub xy. Similarly for this second order mixed partial derivative in this case we came down the right branch of our tree we differentiate the function z with respect to y first and then this result with differentiate with respect to x. 215 00:35:04.920 --> 00:35:16.920 So back to your tree remember we differentiate z with respect to y and then we differentiate this result with respect to x to give us this mixed second order partial. 216 00:35:16.920 --> 00:35:31.920 And in short hand notation because we do this the y derivative first we write y first and then x because it's a y derivative first followed by an x followed by differentiation with respect to x. 217 00:35:31.920 --> 00:35:41.920 And as we know these mixed second order partial derivatives must be equal if they're not you've made a mistake. 218 00:35:41.920 --> 00:35:53.920 Let's have a look at an example. So what do we got here? So we've got z is equal to 3x squared y cubed plus 10y to the 4 minus 8x to the 6. 219 00:35:53.920 --> 00:36:05.920 So that is certainly a function of x and y so z is equal to f of xy that's it given there that's a function z is a function of x and y. 220 00:36:05.920 --> 00:36:15.920 So I want to calculate determine all the first and second order partial derivatives just write pd's for partial derivatives. 221 00:36:15.920 --> 00:36:26.920 The first order partial derivative to start with we did these in the first lecture and it's fairly straightforward. 222 00:36:26.920 --> 00:36:34.920 We're just adding and subtracting terms so we can go in and differentiate them one at a time just to term by term differentiation. 223 00:36:34.920 --> 00:36:39.920 It's an x derivative so we treat y as a constant and any function of y. 224 00:36:39.920 --> 00:36:46.920 So in this case the y cubed can be taken outside and actually we'll take the 3y cubed outside. 225 00:36:46.920 --> 00:36:52.920 I was just going to differentiate x squared and of course multiplied by 3y cubed in this one. 226 00:36:52.920 --> 00:37:00.920 Well, it's a single variable so we just leave it as it is and we'll do the same for that just leave it as it is because it's a single variable. 227 00:37:00.920 --> 00:37:12.920 I differentiate x squared with respect to x I get 2x so I simplify this I get 6xy cubed so that's that expression. 228 00:37:12.920 --> 00:37:24.920 Now I differentiate this thing here which is purely a function of y it's an x derivative so we treat this as a constant so you differentiate a constant you get 0. 229 00:37:24.920 --> 00:37:41.920 I differentiate 8x to the 6 with respect to x just the power law down it comes gives me 48x take one away 48x to the 5 and that's minus of course so I can simplify my expression to give me my answer at the foot of the page. 230 00:37:41.920 --> 00:37:48.920 So that's my first order partial derivative with respect to x. 231 00:37:48.920 --> 00:37:59.920 And now I could go and calculate the first order with respect to y but I think since I've got this one I'll just differentiate it again with respect to x to get the second order partial derivative with respect to x. 232 00:37:59.920 --> 00:38:09.920 So the second order partial with respect to x simply says take the first order partial with respect to x and differentiate it again with respect to x. 233 00:38:09.920 --> 00:38:12.920 So that's what this rotation here means. 234 00:38:12.920 --> 00:38:24.920 So the second order partial with respect to x is the derivative with respect to x of the first order partial which we just calculated on the previous slide there it is. 235 00:38:24.920 --> 00:38:41.920 And again I can do it term by term it's an x derivative so I take y in any function or y outside so the 6y cubed will come out and I've just got to differentiate x with respect to x so that's just one 6y cubed times one 6y cubed. 236 00:38:41.920 --> 00:38:56.920 My second function is just a function of x so that's just the derivative or function of a single variable using the power law down it comes and take one away from it and if I do that I get 240x to the power 4. 237 00:38:56.920 --> 00:39:05.920 So that's that one done as well and I put them together and that gives my final answer for the second order partial derivative with respect to x. 238 00:39:05.920 --> 00:39:11.920 So let's look at the first order with respect to x and the second order partial derivative with respect to x. 239 00:39:11.920 --> 00:39:22.920 I now need to do the same thing for y so let's do the first order partial derivative with respect to y and again I replace it with a given function there it is. 240 00:39:22.920 --> 00:39:34.920 It's just adding and subtracting so I'll just do them term by term that's all I'm doing here and wherever I've got a product involving x and y I'm going to look at which variable might differentiate with respect to. 241 00:39:34.920 --> 00:39:47.920 Well it's y so I treat x and any function of x as a constant so I'm taking the x squared out I could have actually taken the 3x squared out it doesn't matter I'll get the same answer anyway. 242 00:39:47.920 --> 00:39:53.920 And these are just functions of a single variable so I just leave them as they are. 243 00:39:53.920 --> 00:40:04.920 So let's differentiate 3y cubed with respect to y gives me 9y squared that's times x squared so that gives me 9x squared y. 244 00:40:04.920 --> 00:40:13.920 Differentiate 10y to the 4 with respect to y gives me 40y cubed so I've got plus 40y cubed. 245 00:40:13.920 --> 00:40:32.920 I've got a function of x 8x to the 6th with differentiate with respect to y so that's just 0 because we treat x and any function of x as a constant so you differentiate with respect to y it becomes 0 so there's my final answer at the foot of the slide here. 246 00:40:32.920 --> 00:40:44.920 So that's my first order partial derivative with respect to y and I now want to differentiate this once again with respect to y to get my second order partial derivative with respect to y. 247 00:40:44.920 --> 00:40:55.920 So here we are there's my first order with respect to y but I calculated on the previous slide and I'm going to differentiate that one more time with respect to y. 248 00:40:55.920 --> 00:41:04.920 So the partial derivative with respect to y from the previous slide there it is I'm adding them together so I can just do this term by term. 249 00:41:04.920 --> 00:41:15.920 So I'm going to do this term first I got a product of x and y so it's a y derivative so I'm going to take x and any function of x outside the operator. 250 00:41:15.920 --> 00:41:35.920 So there it goes 9x squared comes outside the derivative operator and that's just a requirement to differentiate y squared with respect to y so it's just 2y and I'll get 9x squared times 2y will give me 18x squared y and then I'm going to differentiate my second term with respect to y. 251 00:41:35.920 --> 00:41:49.920 It's just a function of a single variable and since the power law it'll give me 120y squared so there at the foot of the slide is my second order partial derivative with respect to y. 252 00:41:49.920 --> 00:42:06.920 So I've now got my two second order partial derivatives one of them with respect to x so I've come down the left branch on the outside of the left branch of my tree diagram to get the second order partial with respect to x. 253 00:42:06.920 --> 00:42:35.920 I've come down the extreme right branch of my tree to get the second order partial with respect to y that just leaves me the mixed second order partial to calculate so I must come down here get the first order partial with respect to x which I've already done and differentiate that with respect to y and here I've got to get the first order partial with respect to y again I've done that already and I must differentiate that with respect to x. 254 00:42:35.920 --> 00:42:45.920 These two functions in here these two expressions must be the same so let's go back and do that. 255 00:42:45.920 --> 00:43:01.920 So there we are so first of all I'm going to take I'm going to go in the left branch of the tree and I'm going to take my first order partial derivative with respect to x and I'm going to differentiate that with respect to y. 256 00:43:01.920 --> 00:43:18.920 So my first order partial derivative that was the first calculation I did actually it was 6x y cubed minus 48x to the 5 and I've got to differentiate this with respect to y again additional subtraction so we can do it term by term. 257 00:43:18.920 --> 00:43:37.920 My first term is going to product of x and y so I know that it's a y derivative so I can take x and any function of x outside so the 6x comes out and it just leaves me y cubed to differentiate with respect to y so it will be 3y squared I can simplify this to give me 18xy squared. 258 00:43:38.920 --> 00:44:01.920 My second term well it only involves x it's a function of a single variable only involving x and it's a y derivative I want so x and any function of x is treated as a constant you differentiate a constant you get 0 so my final answer is 18xy squared so that's my first mixed second order partial derivative. 259 00:44:02.920 --> 00:44:20.920 That was taken the partial respect to x and differentiate that with respect to y now I have to do the other one now I've got to take the first order partial respect to y and differentiate that with respect to x and I should get the same answer I should get 18xy squared if I do everything correctly. 260 00:44:20.920 --> 00:44:49.920 Now my first order partial respect to y I calculated earlier on it was 9x squared y squared was 40y cubed so we're just adding two terms so we can just differentiate term by term it's an x derivative so in here any function of y can be taken outside so if I want to I can take out the 9y squared and that's exactly what I've done here so I'm just differentiating term by term. 261 00:44:50.920 --> 00:45:06.920 And I'm taking out any function of y because it's an x derivative so outcomes of 9y squared that leaves me x squared to differentiate that's just 2x of course when I differentiate respect to x and that becomes 18xy squared. 262 00:45:06.920 --> 00:45:35.920 My second term was 40y cubed and I differentiate that with respect to x so y and any function of y is just a constant so when I differentiate it with respect to x I get 0 so my answer is 18xy squared and my look back at the previous slide that's exactly the same and that is what I expected that the mixed second order partial derivative is equal they have to be otherwise. 263 00:45:36.920 --> 00:45:49.920 Something's gone wrong so I've just verified that they are the same so that is the answer the full answer to that question I've calculated all second order partial derivatives all four of them. 264 00:45:50.920 --> 00:45:59.920 The second order partial respect to x the second order partial respect to y and the two mixed second order partial derivatives which are equal to each other. 265 00:46:00.920 --> 00:46:08.920 Okay so that's so we can represent this in a tree diagram if we want just so we can see we've already seen the tree diagram. 266 00:46:10.920 --> 00:46:23.920 So there's my original function z I differentiate respect to x to get this function here I differentiate that again with respect to x to get this function these are the calculations I've done in the previous slides. 267 00:46:24.920 --> 00:46:39.920 I then do the same thing for y differentiated once with respect to y and differentiate by first order derivative with respect to y differentiated again to get the second order partial with respect to y. 268 00:46:40.920 --> 00:46:49.920 I now do the mixed second order partial so I differentiate by function z with respect to x to get the first order partial derivative with respect to x. 269 00:46:49.920 --> 00:46:59.920 I differentiate that with respect to y to get the second mixed order partial derivative the second mixed order partial derivative. 270 00:46:59.920 --> 00:47:15.920 And I do the same thing in this branch of the tree I take my first order partial derivative with respect to y and I differentiate that with respect to x to get the second order the the other second order mixed partial derivative. 271 00:47:15.920 --> 00:47:21.680 partial derivative and we saw from the previous slide that these two were in fact equal. So this 272 00:47:21.680 --> 00:47:28.400 just summarizes everything that we just did in a tree diagram. So we've got another example here, 273 00:47:28.400 --> 00:47:34.720 another very similar example really. So we can go through it. It's a function of two variables, 274 00:47:34.720 --> 00:47:41.840 such x and y appearing in the function. So again, we want the first order partial respect to x. 275 00:47:42.720 --> 00:47:49.120 So z is given by this function to replace z by the given function. First order partial respect 276 00:47:49.120 --> 00:47:57.120 to x to term by term. It's respect to x or y in any function or y can be taken outside. So the 277 00:47:57.120 --> 00:48:03.840 7y to the 5 comes out and that just leaves me x cubed to differentiate respect to x and that's 278 00:48:03.840 --> 00:48:12.080 3x squared. So I can simplify this first term. I'll get 21x squared y to the 5. That's fine. My 279 00:48:12.080 --> 00:48:18.400 second term, well it's only a function of a single variable and it's a power loss. It'll be 24x cubed. 280 00:48:18.960 --> 00:48:28.640 So minus 24x cubed, there it is. My last term involves y only. We've got a function of y, 281 00:48:28.640 --> 00:48:35.600 8y squared. So we treat it as a constant differential respect to x, we get 0. So that's the first order 282 00:48:35.600 --> 00:48:42.720 partial derivative with respect to x. I now take that result and I differentiate it again with 283 00:48:42.720 --> 00:48:47.360 respect to x to get my second order partial derivative with respect to x. Once again, 284 00:48:48.560 --> 00:48:55.280 we've got just two terms subtracted. So I can do term by term differentiation. 285 00:48:55.840 --> 00:49:02.960 Again, it's an x derivative. So with this first term, I can take any function of y out 286 00:49:02.960 --> 00:49:09.200 and I'll take the 21y to the 5 outside and that'll just leave me x squared to differentiate 287 00:49:09.200 --> 00:49:17.280 respect to x and we know that that's 2x. So I can simplify this expression here to get 42x y to the 288 00:49:17.280 --> 00:49:27.600 5. My second term is 24x cubed. Well it's a function of a single variable. It's a power loss. So it'll be 72x 289 00:49:28.320 --> 00:49:35.920 squared. So my answer will be 42x y to the 5 minus 72x squared. So now I've got the first 290 00:49:35.920 --> 00:49:40.560 order partial derivative with respect to x. I've also got the second order partial derivative with 291 00:49:40.560 --> 00:49:47.280 respect to x. So I'll repeat the calculation and get the second order partial with respect to y. 292 00:49:47.920 --> 00:49:53.360 But first of all, of course, I've got to get the first order with respect to y. Again, I can replace 293 00:49:53.360 --> 00:50:00.720 said by the given function. We're just adding or subtracting terms. So it's going to be term by 294 00:50:00.720 --> 00:50:07.440 term and the derivatives are all with respect to y. So it's a y derivative. So x and any function 295 00:50:07.440 --> 00:50:14.160 of x can be taken out. So the 7x cubed gets taken out, leaving me y to the power 5 to differentiate 296 00:50:14.160 --> 00:50:22.800 respect to y. So it'll be 5y to the 4. I can simplify this to give me 35x cubed y to the 4. So that's 297 00:50:22.800 --> 00:50:31.760 that first term. My next expression, my next term, this one here, only involves x. So I've got a function 298 00:50:31.760 --> 00:50:38.720 of x 6x to the 4 differentiate now with respect to y with 3 to x constant. So when you differentiate it, 299 00:50:38.720 --> 00:50:47.280 you get 0. My third term is 8y squared. It's a function of one variable. 8y squared differentiate 300 00:50:47.280 --> 00:50:56.080 with respect to y is just 16y. Don't forget the minus. So I'll get 35x cubed y to the 4 minus 16y. 301 00:50:56.720 --> 00:51:02.080 So that's the first order partial derivative with respect to y. And I now want to take this 302 00:51:02.080 --> 00:51:07.520 expression and differentiate it again with respect to y to get the second order partial 303 00:51:07.520 --> 00:51:12.640 derivative with respect to y. And that's what this notation here is saying. My first order partial 304 00:51:12.640 --> 00:51:19.680 derivative with respect to y, differentiate that one more time with respect to y. So we got this 305 00:51:19.680 --> 00:51:24.640 first order partial with respect to y. We've got that on the previous slide. There it is. I can 306 00:51:24.640 --> 00:51:29.840 differentiate this term by term. That's what I've got here. Both the derivatives are of course with 307 00:51:29.840 --> 00:51:39.040 respect to y. It's a y derivative. So x and any function of x, like 35x cubed, can be taken outside. 308 00:51:39.040 --> 00:51:44.960 There it is. And that just leaves me y to the power 4 to differentiate with respect to y. And that is 309 00:51:44.960 --> 00:51:55.280 just 4y cubed. I can simplify this expression to give me 140x cubed y cubed. That's fine. Back 310 00:51:55.280 --> 00:52:02.320 now to the second term. 16y with differentiate with respect to y will be just 16. Don't forget 311 00:52:02.320 --> 00:52:11.600 there's a minus there. And so that comes through to my answer. 140x cubed y cubed minus 16. So that 312 00:52:12.160 --> 00:52:18.720 is now the first order partial derivative with respect to x and y calculate. The second order 313 00:52:18.720 --> 00:52:23.520 partial derivative with respect to x and y calculate it. I now need to calculate the two 314 00:52:24.160 --> 00:52:31.520 mixed second order partial derivatives. So the first one, for no particular reason, 315 00:52:31.520 --> 00:52:36.720 I've decided to take the first order partial with respect to y and differentiate that with 316 00:52:36.720 --> 00:52:42.640 respect to x. So the first order partial with respect to y we found earlier. There it is. 317 00:52:42.640 --> 00:52:48.880 Again, I can do term by term differentiation. And the differentiation is with respect to x. So both 318 00:52:48.880 --> 00:52:55.200 terms get differentiated with respect to x. So I look at my first expression. 319 00:52:57.360 --> 00:53:04.320 It's an x derivative. So y and any function of y can get taken outside. So the 35y to the 4 320 00:53:04.320 --> 00:53:10.240 gets taken outside. And that just leaves me x cubed to differentiate with respect to x. And 321 00:53:10.240 --> 00:53:18.080 that's just 3x squared. Now I can simplify this to give me 105x squared y to the 4. My second term 322 00:53:19.360 --> 00:53:27.120 16y. It's a functional y and I'm differentiated with respect to x. So we treat any function of y 323 00:53:27.120 --> 00:53:35.120 as a constant. And when differentiated with respect to x we get 0. So my final answer for the mixed 324 00:53:35.120 --> 00:53:45.200 order partial derivative is 105x squared y to the 4. So that was when I calculated the 325 00:53:46.080 --> 00:53:51.360 first order with respect to y first and differentiated with respect to x. Let's do it the other way 326 00:53:51.440 --> 00:53:57.040 around. Let's get the first order partial with respect to x and differentiate that with respect 327 00:53:57.040 --> 00:54:04.880 to y. So there you are. Partial dz by dx is now going to be differentiated with respect to y. I 328 00:54:04.880 --> 00:54:11.840 know what this is. It's the first thing I calculated in this question. There it is there. I'm differentiated 329 00:54:11.840 --> 00:54:19.840 with respect to y. There's two terms. So I can do them term by term. It's a y derivative. So any 330 00:54:19.840 --> 00:54:26.640 function of x gets taken outside. So the 21x squared gets taken outside and that just leaves me 331 00:54:26.640 --> 00:54:35.120 y to the 5 to differentiate with respect to y and it becomes 5y to the 4. Multiply all this together. 332 00:54:35.120 --> 00:54:42.240 I get 105x squared y to the 4. But I've also got my second term to differentiate here. 333 00:54:42.240 --> 00:54:49.520 But it's a function of x. It's 24x cubed and when we differentiate the function of x with respect 334 00:54:49.520 --> 00:54:55.840 to y we treat it as a constant and when you differentiate a constant you get 0. So this 335 00:54:55.840 --> 00:55:03.120 will not contribute. And my final answer would be 105x squared y to the 4. So that's our other 336 00:55:03.120 --> 00:55:08.240 mixed second order partial derivative. And if I compare it with the one on the previous slide 337 00:55:08.240 --> 00:55:14.880 I find it's exactly the same and that's really what we would have expected. That the mixed second 338 00:55:14.880 --> 00:55:25.520 order partial derivatives are equal to each other and they certainly are. So that's that one. So 339 00:55:25.520 --> 00:55:34.880 let's do another example. So we've got set is equal to x squared plus e to the xy. Well it's 340 00:55:34.880 --> 00:55:42.560 definitely a function of x and y. It's certainly a function of two variables and we've got to 341 00:55:42.560 --> 00:55:51.760 determine all first and second order partial derivatives. So I can calculate each of these 342 00:55:51.760 --> 00:55:56.960 down here. So that's the first order and the second order but I haven't done the mixed order 343 00:55:56.960 --> 00:56:04.320 once yet. But I'll explain these first of all. So in red I'm doing the differentiation with respect 344 00:56:04.320 --> 00:56:09.280 to x. The first order derivative with respect to x and the second order derivative with respect to 345 00:56:09.280 --> 00:56:15.920 x. And similarly in the blue I do the first and second order partial derivative with respect to y. 346 00:56:16.640 --> 00:56:24.800 So first of all let's do the first order partial with respect to x. So differentiate x squared I get 347 00:56:24.800 --> 00:56:32.080 2x. Now I'm going to differentiate the second function e to the xy. I'm going to differentiate 348 00:56:32.080 --> 00:56:37.360 that with respect to x. So it's the chain rule because we've got a function of a function the 349 00:56:37.360 --> 00:56:44.960 exponential function being applied to the function xy. So the rule says in the chain rule says leave 350 00:56:46.000 --> 00:56:51.840 differentiate the outside function. So the exponential just differentiates to give us the 351 00:56:51.840 --> 00:56:57.680 exponential it doesn't change. So the exponential stays the same how we differentiate. Leave the 352 00:56:57.680 --> 00:57:04.800 bracket as it is and multiply by the derivative of the thing in brackets. So this if you like is 353 00:57:04.800 --> 00:57:12.400 just like a constant we're doing the derivative of a constant times x because it's a derivative 354 00:57:12.400 --> 00:57:18.480 with respect to x so we treat y as a constant. So if we differentiate a constant times x that'll 355 00:57:18.480 --> 00:57:23.520 just leave a constant. So y is playing the role of the constant here so we get a y there. So we 356 00:57:23.520 --> 00:57:33.760 tidy this up a little bit and we get 2x plus y e to the xy. Okay so we now want to differentiate 357 00:57:34.400 --> 00:57:40.400 this guy one more time with respect to x to get the second order partial derivative with respect 358 00:57:40.400 --> 00:57:46.400 to x and that's what this notation here represents. So I know what that first order partial derivative 359 00:57:46.400 --> 00:57:54.000 does I just calculated on the previous line and I've written it like this 2x plus y e to the xy 360 00:57:54.000 --> 00:58:02.240 I've just written xxy. Okay so let's do this term by the two terms so I can just do a term by term 361 00:58:02.240 --> 00:58:10.240 differentiate 2x with respect to x well that gives me two. Now I've got to differentiate y e to the 362 00:58:10.240 --> 00:58:22.160 xy with respect to x so y and any function of y can be taken as 3 is a constant so the y can get 363 00:58:22.160 --> 00:58:29.200 taken outside we can't take this out because we've got x appearing in here it's a it's a product 364 00:58:29.200 --> 00:58:35.440 involved in x so we can't take that outside if it was just e to the y it could come out but there's 365 00:58:35.440 --> 00:58:45.920 an x involvement there so we've got y times the partial derivative of xxy now we don't actually 366 00:58:45.920 --> 00:58:53.520 need to do this again because if you remember we've already done this we're already differentiated 367 00:58:53.520 --> 00:59:04.240 e to the xy here partial d by dx of xxy we've found to be y e to the xy so it's exactly the same 368 00:59:04.320 --> 00:59:12.480 calculation here partial d by dx of xxy so it must be equal to this thing so there it is y 369 00:59:12.480 --> 00:59:18.080 e to the xy don't forget we've got a y on the outside here we'll multiply by so we can tidy this 370 00:59:18.080 --> 00:59:26.240 up and you get 2 plus y squared e to the xy so the thing here just to be aware that you've already 371 00:59:26.240 --> 00:59:35.440 done this calculation you've already done the derivative of xxy with respect to x we did it up here 372 00:59:37.120 --> 00:59:42.800 so hopefully we can we can get something like that happening when we're doing the partial 373 00:59:42.800 --> 00:59:48.640 respect to y as well so let's see if we can so we've got to do the partial with respect to y 374 00:59:48.640 --> 00:59:55.120 of our function here so let's do this so first of all we're going to do the partial 375 00:59:55.840 --> 01:00:02.480 of x squared with respect to y well it's a y derivative so we treat x and any function of x 376 01:00:02.480 --> 01:00:07.600 like x squared is a constant differentiate a constant you get zero so that's where that zero comes 377 01:00:07.600 --> 01:00:16.320 from then we're going to differentiate e to the xy with respect to y so I'll write it as x xy 378 01:00:17.040 --> 01:00:24.240 so the rule says chain rule says differentiate the outside function so the exponential just stays 379 01:00:24.240 --> 01:00:30.240 the same that's the rule for differentiating exponential doesn't change its own derivative so 380 01:00:30.240 --> 01:00:40.000 x leave the bracket as it is so you get x xy and I want to differentiate the thing inside the brackets 381 01:00:40.720 --> 01:00:46.880 with respect to y now x has been treated as a constant so that's just like something like 382 01:00:47.600 --> 01:00:53.840 differentiating 3y with respect to y and the answer there all that would survive would be the 383 01:00:53.840 --> 01:01:00.720 constant so x is playing the role of the constant here so when you differentiate xy with respect to 384 01:01:00.720 --> 01:01:08.080 y with x being a constant the only thing that survives is the x so you know I mean I can just 385 01:01:08.080 --> 01:01:14.240 maybe quickly write something down just to explain that a little bit more so let's just maybe do it 386 01:01:14.800 --> 01:01:26.080 read so I've got d by dy of xy differentiate nothing in brackets it's a y derivative so the x 387 01:01:26.080 --> 01:01:35.200 comes out so you get d by dy of y so that just becomes one so it's x times one so it's just x so 388 01:01:35.200 --> 01:01:46.480 that's where that x comes from so if I just simplify this I can write this x e to the xy 389 01:01:47.360 --> 01:01:54.160 okay so I now want to find the second order partial derivative with respect to y and to do that I 390 01:01:54.160 --> 01:02:00.160 differentiate the first order partial derivative with respect to y once more with respect to y 391 01:02:00.160 --> 01:02:06.720 I know this thing I just found that the calculation above so what I've got to do is I've got to 392 01:02:06.720 --> 01:02:14.160 calculate the partial derivative with respect to y of x e to the xy and I've written it like this 393 01:02:14.160 --> 01:02:20.400 now it's a y derivative so the x can get taken outside so there we are and all we have to do 394 01:02:20.400 --> 01:02:27.280 here is calculate the partial with respect to y of e to the xy and I look back up and say well I've 395 01:02:27.280 --> 01:02:36.560 already done that there it is and the answer was x e to the xy so the this becomes x e to the xy 396 01:02:36.560 --> 01:02:42.560 when you do the derivative you're multiplying by x don't forget that so the answer is x squared 397 01:02:42.560 --> 01:02:50.960 e to the xy so let me just get rid of that just to tidy it up a little okay so now we've got the 398 01:02:50.960 --> 01:02:58.000 first and second order partial derivatives with respect to x here in red and with respect to y 399 01:02:58.000 --> 01:03:07.840 in blue I've now got to get the mixed second order partial derivatives so to do that which one 400 01:03:07.840 --> 01:03:13.920 I do first well I'll take the first order partial with respect to x and I'll differentiate that 401 01:03:13.920 --> 01:03:20.400 with respect to y there from the previous slide the first order partial partial dz by dx 402 01:03:21.120 --> 01:03:30.720 was here 2x plus y e to the xy there it is 2x plus y e to the xy there it is there so I've 403 01:03:30.720 --> 01:03:41.360 got to differentiate this with respect to y so I can do a term by term the first term 2x is just 404 01:03:41.440 --> 01:03:47.040 a function of x so we treat it as a constant when we differentiate with respect to x so it 405 01:03:47.040 --> 01:03:54.080 becomes zero we differentiate so that would be zero now the second part is slightly more complicated 406 01:03:54.800 --> 01:04:03.680 because it's a y derivative and we've actually got two functions both involved in y so we need 407 01:04:03.680 --> 01:04:13.200 the product rule here so we need to use the product rule and we'll actually need the chain rule as 408 01:04:13.200 --> 01:04:18.640 well to differentiate e to the xy so let's have a look at this now I'm going to differentiate 409 01:04:19.440 --> 01:04:27.040 y e and as you can see I've just called that I've just given a name and called it w w is equal to y 410 01:04:27.520 --> 01:04:36.000 e to the xy I'm going to you I need the product rule I'm going to let f be equal to y so that one 411 01:04:36.640 --> 01:04:49.840 I'll let f so I'll just say let f equal y and g equal e to the x y so it's a y derivative I'm 412 01:04:49.840 --> 01:05:00.960 calculating so f sub y of y with respect to y you know that's just your d by dy of y so differentiate 413 01:05:00.960 --> 01:05:10.480 y with respect to y it's just one and g sub y is equal to what well it's a derivative of e to the xy 414 01:05:10.480 --> 01:05:20.400 with respect to y have we done that before well yes we have haven't we yes we have we've calculated 415 01:05:20.400 --> 01:05:35.600 the derivative of e to the xy with respect to y we did it here in blue the derivative of e to the 416 01:05:35.600 --> 01:05:49.760 xy with respect to y is x e to the xy so there we are so what have we got we know that it's x e to 417 01:05:49.760 --> 01:05:55.520 the xy we just calculated we've done that calculation before and then I want to use the 418 01:05:57.200 --> 01:06:03.280 product rule so it's just the diagonally opposite once multiplied together so it's one times e to the 419 01:06:03.280 --> 01:06:15.200 xy plus y times x e to the xy like that and that's where this result comes from this thing here was 420 01:06:15.200 --> 01:06:21.120 a bit more complicated needed the product rule because it's a product of two functions that each 421 01:06:21.120 --> 01:06:29.520 involve y and this bit the exponential needed us to use the chain rule but fortunately we remembered 422 01:06:29.600 --> 01:06:38.640 we'd actually done that before the derivative of g equals e to the xy there with respect to y we found 423 01:06:38.640 --> 01:06:45.520 was x e to the xy so we've done that before so that saves us a little bit of work and then if we really 424 01:06:45.520 --> 01:06:53.040 wanted to we could tidy this up a little bit and we spot that the exponential function appears in here 425 01:06:54.000 --> 01:06:59.760 in this term and in this term so we can take it out as a common factor so we take it out as a 426 01:06:59.760 --> 01:07:08.720 common factor so we need two terms in the bracket now to get e to the xy we must multiply e to the xy 427 01:07:08.720 --> 01:07:13.840 by one so that's why that's a one there sometimes people get a little bit confused about that you 428 01:07:13.840 --> 01:07:23.360 need a one in here and then to get this term obviously you will need xy to multiply the e to the xy to 429 01:07:23.360 --> 01:07:31.280 get this term so that's the first of our mixed second order partial derivatives and we can now go on 430 01:07:31.280 --> 01:07:36.720 and calculate the second one and we'll hope that it's equal to this if it isn't we made a mistake 431 01:07:36.720 --> 01:07:47.200 so let's do that then so this one involves taking the first order partial derivative with respect to 432 01:07:47.200 --> 01:07:55.680 y and differentiating that with respect to x so if we look back let's go and find the first order 433 01:07:55.680 --> 01:08:03.360 partial with respect to y we'll have it here there it is it's x e to the xy so this is the 434 01:08:03.360 --> 01:08:10.160 thing that I now want to differentiate with respect to x and I've sported something I've 435 01:08:10.160 --> 01:08:17.440 sported that this will need the product rule because I've got a function of x multiplying another 436 01:08:17.440 --> 01:08:24.800 function that involves x so this is just similar to the calculation I did over leaf so I've got 437 01:08:24.800 --> 01:08:38.160 w is equal to x e to the xy so I'm going to let f equal x and g equal e to the xy now I'm 438 01:08:38.160 --> 01:08:45.200 count it's an x derivative that I want here so f sub x well that's an easy one it's just one 439 01:08:46.320 --> 01:08:54.320 and g sub x well I wanted to differentiate e to the xy with respect to x have I done that before 440 01:08:54.800 --> 01:09:02.000 well yes I have there it is that's the derivative of e to the xy with respect to x 441 01:09:02.560 --> 01:09:11.680 is given by this and tied it up it's just y e to the xy so thankfully I've done that before 442 01:09:11.680 --> 01:09:18.720 so that saves me a bit of work it's y e to the xy there we are I can now use my 443 01:09:19.040 --> 01:09:28.640 um product rule I use my product rule so it's these diagonally opposite ones f sub x times g 444 01:09:28.640 --> 01:09:38.640 so it's one times e to the xy there you are plus x times y e to the xy so that's it that is the 445 01:09:38.640 --> 01:09:44.400 product rule applied to this function here and of course we had to use the chain rule on the 446 01:09:44.480 --> 01:09:49.760 exponential part of it so we can write this like so 447 01:09:52.320 --> 01:09:58.240 one times e to the xy is just e to the xy again I've spotted that I've got the same exponential 448 01:09:58.240 --> 01:10:06.640 term appearing in both the terms so I can take e to the xy outside as a common factor 449 01:10:07.600 --> 01:10:12.800 to get this here I need to have a one in here so that will give me e to the xy times one will 450 01:10:12.800 --> 01:10:23.840 give me that and here I'll have xy so that e to the xy times xy will give me my second term and 451 01:10:23.840 --> 01:10:29.440 if I look back at the previous slide where I got the other mixed second order partial derivative 452 01:10:29.440 --> 01:10:40.240 I can see that they are in fact equal as we expected so that's how we do that so that's um 453 01:10:41.200 --> 01:10:47.280 as we've now looked at the product rule and the quotient rule and we've also looked at 454 01:10:48.000 --> 01:10:56.000 higher order derivatives from working with a function of two variables so just to summarize 455 01:10:56.000 --> 01:11:02.000 all of this the unit it's extended the idea of differentiation of a function of one variable 456 01:11:02.560 --> 01:11:08.080 and we've introduced the concept of a partial derivative of a function of two variables so 457 01:11:08.080 --> 01:11:15.280 we're now able to understand what we mean by a partial derivative remember in the last class we 458 01:11:15.280 --> 01:11:22.560 looked at some a geometrical interpretation of calculating partial derivatives of a function 459 01:11:22.560 --> 01:11:30.960 of two variables and we're also after the examples were just done we're also able to determine partial 460 01:11:30.960 --> 01:11:37.280 derivatives up to second order of a function of two variables and we're also able to apply the 461 01:11:37.280 --> 01:11:43.200 standard rules of differentiation like the chain product and quotient rules to calculate 462 01:11:44.880 --> 01:11:53.120 partial derivatives of a function of two variables so you should now be able to in addition to the 463 01:11:53.120 --> 01:11:58.480 questions we saw that you'd be able to attempt in the last lecture I've just gathered everything 464 01:11:58.480 --> 01:12:03.280 together here so you should be able to attempt all the mobius questions those questions one to four 465 01:12:03.280 --> 01:12:10.000 associated with partial differentiation and working on the tutorial questions from the notes 466 01:12:10.000 --> 01:12:18.800 you should be able to attempt these ones that I've listed here so that is the end of our partial 467 01:12:18.800 --> 01:12:24.560 differentiation lectures we had two lectures on partial differentiation the next topic that we'll 468 01:12:24.560 --> 01:12:32.480 move on to is looking at solving ordinary differential equations so we'll leave it at that for now 469 01:12:32.480 --> 01:12:36.880 okay bye