Multivariable Calculus A Unified View of Derivatives for Mappings

This lesson is going to be a little different than the others. It is not going to be something that is necessary for any of the future work that we do. This is a little bit of a rest, and we are going to discuss sort of a unified global view of derivatives for mappings, a general approach that works for all mappings from any dimensional space to any other dimensional space, and how to deal with the derivative of those things. This is just an opportunity for us to pull back, take a quick view. We are not going to be doing anything theoretical as far as proofs, or getting into the nitty gritty.

*These practice questions are only helpful when you work on them offline on a piece of paper and then use the solution steps function to check your answer.

Answer

A Unified View of Derivatives for Mappings

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

Transcription: A Unified View of Derivatives for Mappings

It is not going to be something that is necessary for any of the future work that we do.0009

This is a little bit of a rest bit, and I am going to discuss sort of a unified global view of derivatives for mappings.0014

Sort of a general approach that works for all mappings from any dimensional space to any other dimensional space, and how to deal with the derivative of those things.0020

This is just an opportunity for us to pull back, take a quick view. Again, if this is something that you are not necessarily interested in, feel free to skip this particular lesson.0032

You are not going to be missing anything, this is just for your own personal edification, for those of you who are a little more interested in sort of the global theory.0044

Now, we are not going to be doing anything theoretical as far as proofs, or getting into the nitty gritty. It is not that, it is just a way of pulling back and seeing the forest from the trees.0052

That is what we want to do. We want to make sure that we are able to what is going on and it will sort of help to make sense of all of the things that we have done so far in specific cases.0063

Again, you are absolutely welcome to skip this lesson if you want, you will not miss a thing, this is not something we are going to be using for the rest of the course.0071

It will be something that is important for those of you who go on to study, in particular, partial differential equations.0080

Again, let us just jump in and see what we can do. Okay, so let us just start with a definition.0086

So, given a differentiable mapping, f from RN to RM, so any n, any m, the derivative of this mapping is the M by N matrix, where the ith row of the matrix is the gradient of the ith coordinate function.0093

Which will all make sense in a minute when we start doing the examples.0175

Okay, so just real briefly, let me talk about what this says. So given a differentiable mapping of f from RN to RM, let us say from R3 to R4.0182

So, you are mapping and taking a point in 3 space and you are mapping to a point in 4-space.0193

The derivative of this mapping is the M by N matrix, where the ith row of the matrix, in other words where the third row of the matrix is the gradient of the, let us say, third coordinate function for that mapping.0198

Now, up to now, we have been doing mappings that are... we did curves, which are mapping from R to RN, right?0210

R2 to R2, R3 to R3, and we also did functions of several variables. In other words where we start with a vector, a point in let us say R3 and we are doing something to it and we spit out a number, something to R.0218

So we have gone R to RN, R3 to R, so 1 to say let us say 3, and 3 to 1.0233

We have not dealt yet with something like, for example, R2 to R3, or R3 to R2, R4 to R6. Well this is just a general approach to this.0237

We are just going to do some examples and hopefully it will give you a nice global view of what is going on and how to handle something like this.0248

Now notice, in single variable calculus, the derivative was a number. Now that we are dealing with functions of several variables, well you have already noticed that the derivative of a, of a curve happens to be a vector.0255

The derivative of a function of several variables is also a vector. The gradient vector.0269

Well now, if you have a mapping from a 1-space to another, where the dimensions of the spaces, where both of them are greater than 1, now what you get is a matrix.0275

As it turns out, a matrix, you remember from some of the work you did in high school, a matrix behaves just like a number does.0285

I mean, in a lot of ways, not always, it is not commutative, like multiplication is not commutative, but for all practical purposes, you can add numbers, you can add matrices, you can subtract numbers, you can subtract matrices.0291

You can multiply numbers, you can multiply matrices, commutativity does not apply always, and you can divide numbers, and you can divide matrices.0303

Division of matrices is basically just multiplying by the inverse, which is really what division is of numbers.0311

In other words if I take the number 5 ×... or 5/3, I am not really dividing by 3. What I am doing is I am multiplying by the inverse of 3, which is 1/3. That is what I am really doing.0317

It is multiplication. Division is a derived operation for multiplication.0329

So, in some sense, matrices are just like numbers, they are just bigger objects, so that is it. That is all that is happening here.0334

Let us do some examples, keeping this definition in mind, and we will see what we can do. So example number 1.0341

Example number 1. Let f be a mapping from R to R3, so a curve in 3-space, defined by f(t) = sin(t)cos(t), and let us say tan(t).0352

This is the first coordinate function, this is the second coordinate function, and this is the third coordinate function. That is it, that is all we mean when we say coordinate function.0373

So, this word right here, this coordinate function, all it means is when you are mapping to a different dimension like 3-dimensional space, you need 3 numbers.0382

Well, sin(t) is 1 number, cos(t) is another number, tan(t) is another number, for a given value of t. That gives you a point in 3-space, that is all it means. The coordinate function does this.0392

Well, based on this definition, the derivative of this f(t) is a 3 by 1 matrix. A 3 by 1 matrix. 3 rows, 1 column, well, here is what it is.0404

The derivative of f = ... we said it is the gradient of the ith coordinate function, well the first coordinate, so the first row is the gradient of the first coordinate function.0424

Well, since this function is sin(t), it only has 1 variable, it is just the derivative. It is cos(t).0438

The second row is the second... the gradient of the second coordinate function. The second coordinate function is the cos(t), it only has 1 derivative because it is a single variable t. So, this is -sin(t).0445

The third coordinate function becomes the third row, the derivative of the tangent is sec2(t).0459

There you go, that is it. I have this 1 by 3 matrix, and you already know this, we have been doing this all along, except we have been writing it this way, cos(t)-sin(t)sec2(t).0466

We have been writing is as a row and we have been separating is at columns. Now we are going to treat it more generally.0485

Any time you have a function of RN to RM, the derivative matrix is the M by N matrix, so 3 by 1, we just write it as a matrix, no longer as this list, or as this... you know... row vector, if you will.0490

Okay, let us do another example. This is actually a very, very, unified vision, a way of thinking about things, because again, the derivative of a function of a single variable is a number, is 1 function.0506

The derivative of a mapping, say from 2-space to 2-space, now you have a 2 by 2 matrix. Where that 2 by 2 matrix has 4 entries, that whole thing is a derivative, it is really kind of exciting.0524

It is just bigger objects. You are treating them exactly the same. It is a single object, but it is a matrix, it has multiple parts.0539

Okay, so let f be a mapping this time from R3 to R, so a function of 3 variables. Let me make my 3 a little more clear here. R3 to R.0546

This is going to be defined by, so f(x,y,z), we are taking a point in 3-space, and we are spitting out a number.0563

We take the derivative with respect to z, which is x2y2, there you go... I am sorry, that is x2y3.0637

I guess I have a love affair with the number 2 here, x2y3, there we go, that is it.0647

Notice, this is just the gradient vector that we have been doing all along, except now I do not need to put these commas here because I am treating them like a matrix.0653

This is the first entry of the matrix, this is the second entry of the matrix, and this is the third entry of the matrix.0663

Again, now we are thinking of it in terms of matrices. Yes, it happens to be a 1 by 3 matrix, and anything that has either 1 row or 1 column... you know, that we generally call them a vector... but again, this is just nomenclature.0670

This is just names that are being thrown around. Seeing it like this is really, really nice. Let me just write: notice, this is just the gradient of f expressed as a matrix.0685

Again, let me reiterate, there is nothing in this particular lesson that we are going to be using for the rest of the course.0735

So, by all means, if this is something that you are not interested in, it if it something that the flavor of it, you know, you just do not really like it or care for it, you are not going to be missing anything. So by all means, this is just for your edification, if you should feel so inclined.0740

Okay, example 3. Now, let f be a mapping from R2 to R2 be defined by f(x,y) = x2 + y2, and x2y2.0755

This is the first coordinate function, and this is the second coordinate function. Okay, well, we said that derivative is going to a 2 by 2 matrix.0779

Again, it is very, very important. The arrival space, the dimension of the arrival space, that is going to be the number of rows.0793

The dimension of the departure space, that is going to be the number of columns. So 2 by 2, this is actually 2 by 2, that way.0803

We are mapping this way, but the matrix is 2 by 2. Okay. 2 by 2 matrix, and the derivative looks like this.0811

Well, we said that the first row is the gradient of the first coordinate function.0820

The first coordinate function is x2 + y2, therefore the gradient of this is, well the derivative with respect to x is 2x, the derivative with respect to y is 2y.0828

Now we go to the second coordinate function, that one right there. The derivative with respect to x is 2xy2, and the derivative with respect to y is 2x2y.0839

We have our derivative of this mapping. How incredible is that. This is really, really kind of extraordinary. It is a single object. It behaves as a single object mathematically.0850

We can actually do things with this the same way we do with any other derivative, except now we are working in 2-space instead of just 1-space. This is very, very powerful stuff.0865

So, let us go to example 4. Now, let us let f be a mapping from 2-space to 4-space, how is that? R2 to R4.0877

We will define it by the following. f(x,y) = x2 + y2 is the first coordinate function, x2 - y2 is the second coordinate function, x2y2 is the third coordinate function, and xsin(y) is the fourth coordinate function.0895

Now there is no way to make sense of this geometrically. Again, but we can make sense of it algebraically, and we can work with it algebraically. This is what makes this extraordinary.0921

Well, we know that the derivative, there is a derivative for this mapping from 1-space to another, and it is a 4 by 2 matrix. So df is a 4 by 2 matrix.0931

So, let us go ahead and write that out. I will go ahead and put the matrix bars around it in just a bit.0947

So, it is a 4 by 2 matrix. Each row of the matrix is the gradient of that coordinate function. So the first row is going to be the gradient of the first coordinate function.0955

Well, this is 2x and 2y. The second coordinate function, x2 - y2, so this is 2x and this is -2y.0968

The third row is going to be the gradient of the third coordinate function, which is 2xy2, I think.0981

The fourth coordinate function is xsin(y), so the derivative of that with respect to x is sin(y), and the derivative with respect to y is xcos(y), I think.0997

Again, I hope that you are confirming these for me. So, this is my derivative.1009

This whole thing is my derivative, for that function. The same way that f(x) = x3, f'(x) = 3x2. This is a single object.1016

It takes on different values for different values of x. Well, this is a slightly more complicated function, this is now not a mapping from R1 to R1, this is a mapping from R2 to R4. This is the derivative.1033

It is a single object, for different values of x and y in the given space, this thing takes on different values. It is just bigger, that is all it is. It is just bigger because our spaces are bigger. That is how you have to think about it.1043

So, let us see what we have here. Now, we will move on to the next level.1061

Well, you remember what we did -- what we have been doing actually -- for the last several lessons. We have a curve, and so we have a curve c(t), right?1070

Then we have a function... let me do this in terms of pictures... so we have a R1, 2, so this is R and we have a curve. It is a mapping from let us say R to R2.1081

Then we have a function, let us say, that is a function of two variables that maps from R2 to R.1096

Well, we can form, so this is let us say c(t), and let us say this is f(x,y). Well, we can actually form the composite function, f(c(t)), right? That is what we have been doing.1102

Then we have been taking the derivative of that, and we have a formula for the derivative. We were doing lots of example problems for handling this derivative.1115

Now, we can go ahead and we can give a general definition for how to actually find the derivative of the composite function for a mapping from a space of any dimension to any dimension. Let us go ahead and do that.1125

So, given g, which is a mapping from let us say RN to RS, and f, which is a mapping from RS to RM, all of these different numbers, or not. They can be equal that can be different.1140

We can form the composite function... Excuse me... We can form the composite function f(g), which is a mapping from RN to RM, right?1163

RN to RS, then f takes the values of RS, maps them to RN, so what we have is a function that goes from RM to RN, right?1186

Now, the derivative of the composite function, which we will notate the same way we notate any other, df(g) -- write it like that -- is the M by N matrix.1197

Again, you are going from RN to RS, RS to RM. Well, you are actually going... the composite function goes from RN to RM, so the derivative is an M by N matrix, gotten by multiplying exactly what you think.1229

Exactly what you think, the matrix for the derivative of f, and the matrix for the derivative of g, in a given order.1253

I write in a given order because matrix multiplication is not commutative, it depends on the order in which you do it.1271

Now we will actually write it in mathematical form. That is the derivative of f(g) = the derivative of f evaluated at g × the derivative of g.1278

So, if it is f(g), the f goes first, the g goes next. That is it, you just are actually multiplying matrices. How incredible is that?1302

You have a function which has a derivative matrix, you have another function which has a derivative matrix. If you can form the composite of those 2 functions, f(g) or g(f), you can actually find the derivative simply be multiplying the matrices of the respective derivatives. That is amazing.1311

Let us go ahead and actually do an example, and I think it will make sense. So, example 5.1329

We will let g be a mapping from R to R2, so a curve in 2-space defined by g(t) = cos(t)sin(t), so this is just a curve in 2-space.1344

We will let f be a mapping from R2 to R, be a function of several variables -- two variables in this case.1366

So we do g first, we get this and this. These values, they are the x and the y. This is a composite function, because we are doing g first, and then the values that we get for x and y, for the first coordinate function and the second coordinate function, they go into here.1388

So basically, f(g) is actually just a function of t. So, f(g) is a mapping from R to R, R to R2, R2 to R. We are going from R to R.1405

The derivative of f(g) is a 1 by 1 matrix, which means just a function, just a number. A 1 by 1 matrix is a number, is a function, just one thing.1425

It is equal to, so the derivative of f(g) is equal to the derivative of f evaluated at g. That matrix × the derivative of g. That is it. Now, let us do it.1439

Well, what is d(f)? Let us find d(f) first. Well, the derivative of x(f) is equal to the gradient, right? That is what the derivative is. It is a... so f is going to be a 1 by 2 matrix.1460

It is going to be... the row is going to be the gradient of this coordinate function, there is only one coordinate function, so we get 2x... let me express it as a matrix, so 2x and 3y2, how is that? That is that one.1477

Now, we evaluate at g, which means we put... this is x and this is y, right? cos(t) is x, and sin(t) is y because this is a composite function.1495

When we evaluate at g, what we are doing is we are putting in the actual coordinate functions for g in for x and y.1519

Let us see what we have got here. Let us draw a little picture. That is R2, that is R2, and this is R1, so g maps from R2 to points in R2. That is g.1805

f takes these points in R2 and it actually maps them to R1. Therefore we can form the composite, which is f(g), which takes points in R2 and maps them to R1. That is all that is happening here.1820

In other words, f(g) is actually going to take Rθ and it is going to map them to some number, some function. So f(g) is a function of Rθ.1838

G is a function of Rθ, f is a function of xy. x and y are just variables.1854

The composite function, which is just a mapping from R2 to R1, is a function of the 2 variables Rθ, that is it. That is all that is happening here.1861

Let us just run through the mathematics here. So, basically what we are going to have at the end, notice R2 to R2, R2 to R1, so f(g) is a mapping from R2 to R1.1869

Let us write that down. f(g) is a mapping from R2 to R1, so what we are going to end up having is a 1 by 2 matrix.1883

So, we are going to have df(g)/dr, it is going to be one partial derivative that we have, and the other is going to be df(g)/dθ. That is what we are going to end up with at the end, so let us just do it according to our method.1895

When we take the derivative of f it is going to equal, well f was a function, and so it is going to be a 1 by 2 matrix, and that row is going to be the gradient of the coordinate function, so we get 2x + 4y...1913

You know what? Let me go ahead and write the functions again, I want you to see them on the same page as I actually take the derivatives of.1936

So, f was f(x,y) = x2 + 4xy, and g(rθ) = rcos(θ)rsin(θ). We are forming f(g), that is what we are doing.1943

Let us go ahead and take the derivative of f. The derivative of f is going to equal the 1 by 2 matrix, and it is going to be the gradient of this coordinate function.1967

What we are going to get is 2x + 4y is our first... I will leave it as a matrix so I will not have columns -- I mean I will not have commas.1978

Then the derivative with respect to y is going to be 4x. That is our derivative of f.1989

Now we are going to take our derivative of f, and we are going to evaluate it at g. g is this.1995

That means take this and take this as our x and y and put them into here, because we are forming the composite function.2003

We end up with the following. We end up with 2rcos(θ) + 4rsin(θ), and we end up with 4x, which is 4rcos(θ). So, this is our first.2014

Now, we will do d(g). d(g) is a mapping from R2 to R2, so it is going to be a 2 by 2 matrix, so the first row is going to be the gradient of that function, the second row is going to be the gradient of that function.2036

So, it is going to be... the derivative with respect to r is going to be cos(θ), and the derivative with respect to θ is going to be -rsin(θ).2050

Now, this function, the derivative with respect to r is going to be sin(θ), and the derivative with respect to θ is going to be rcos(θ). There you go.2064

Now we will go ahead and actually do the multiplication. So, the derivative of f(g), the composite function is just equal to this thing × this thing, in that order. This one goes first.2077

We will write 2rcos(θ) + 4rsin(θ), and then we will have 4rcos(θ), so this is our matrix there.2099

Then we are going to have cos(θ) - rsin(θ), then we have sin(θ), then we have rcos(θ)... oops, there we go.2117

This is a 1 by 2 matrix. This is a 2 by 2 matrix. The middle things go away, our answer is going to be a 1 by 2 matrix, so we are going to multiply this by that, that is going to be our first entry, and then we are going to multiply this by that, that is going to be our second entry.2131

Again, I presume here that you have seen matrix multiplication at the very least. I know that you have in high school, and I know that you probably did a little bit of it in calculus.2152

At least here or there, so I know that it is something that you are familiar with, and again, if you are not, no worries. This section is not going to show up anywhere else.2159

You are more than welcome to ignore it if you want to. Okay, so now let us do this multiplication. When we actually multiply it out, here is what we get.2166

We get the derivative of f(g) = 2rcos2(θ)... I am going to write it vertically... + 4rsin(θ)cos(θ) + 4rsin(θ)cos(θ).2178

Now I can put some things together, that is not a problem. 4rsin(θ)cos(θ), 4rsin(θ) is 8rsin(θ)cos(θ), but I will go ahead and just leave it like this.2213

Now, our second entry is going to be -2r2sin(θ)cos(θ) - 4r2sin2(θ) + 4r2cos2(θ).2222

This is what we have ended up with. Our composite function, f(g), the derivative of that is this right here, this whole thing.2247

Now, f(g) was a mapping. We said that f(g) was a mapping from R2 to R. We know that its derivative is going to be a 1 by 2 matrix. This is what we have got, a 1 by 2 matrix -- 1 row, 2 columns.2257

This right here, f(g) was a mapping, was a function of Rθ, right? That was the original departure space that left, so it is a function of Rθ.2281

Therefore, what we have when we take this derivative is d(f(g))/dR, d(f(g))/dθ. That is that one, that is that one. That is all that we have done here.2299

I hope this helped a little bit. If not, do not worry about it. It is just something that I wanted you to see.2324

A little bit more of a global idea, something that generalizes 2 mappings of... mappings from a space of any number of dimensions to any numbers of dimensions, to demonstrate that we can still do calculus.2330

This is actually kind of extraordinary that we are not limited to a single space. We can work from two entirely, completely, different spaces, mapping from one space to the other, and we can still do calculus on this.2343

The ideas are the same. We are just taking derivatives. Now instead of a derivative being a single function, now a derivative is a matrix, and the matrix can be of any dimension.2355

In those matrix, the entries of the matrix are the actual functions that we deal with, the partial derivatives if you will.2366

Thank you for joining us here at educator.com. Next time we will go ahead and continue on with our discussion of maximum, minimum, bye-bye.2373