 Last time we talked about chain rule and remember what I finished with basically saying the inverse function theorem of course. So we remind you. And of course, since I didn't write it down, it's probably going to mess it up, but it's okay. So we have some function n from R. Well, let's write for R in Rn. Because otherwise it doesn't even really work. This has to be continuously differentiable in a neighborhood. Let's say u contains someone going x0. And then f has a local inverse g, which is also from R in R in obviously. Let's say f of x0 is y. And so we have a local inverse g from R in to R in. So I want to say there is a g from R in to R in so that a y0 is x0, g from some neighborhood I guess v into u is defined as continuously differentiable. And then I wrote this backwards if, this is now the condition which is sufficient but not necessary, dg df at x0 is not zero. So we take the derivative matrix and it's invertible. So that is, I guess there's a little more. And in this case dg at x0 at y0 is just df at x0. I think this is what I wrote, or at least something like it. That's a set membership that goes the wrong way. It means containing. I'm writing this except I wrote it the other way because I want to say u exists, not x, not x. So I wrote this and you just read it the other way. So you just have to be reading right to left or left to right. Yeah, so like, you know, those of you that know Hebrew or Arabic, this is no problem for you. Those of you that know Japanese, I'll have to start writing this way. Do you write this one in Chinese? No. Not anymore? Not anymore. Yeah. Okay, so I maybe have, since I didn't, well, anyway, this is pretty much right. There might be one or two, they're not typos because I didn't type anything, but there might be one or two wrong ones, but I don't think so. So anyway, this is saying that if you have some function, and it's obviously here, it really only works if you go from r into rn because the derivative matrix needs to have an inverse, and we can only have an inverse with square matrix. Non-square matrices don't have inverses, so. So I'm restricting from r into rn. Those of you that care, you won't encounter it for a while, you won't encounter it later. There is a more general version where we can go from rn to rm, and then we get something called a generalized inverse, and things are more complicated, but probably you don't have to worry about that. You found us. Okay, you. Okay, so this is not what I'm talking about today. This is what I said at the end of my last class. I'm not going to prove this. In fact, I don't think I'm proving anything to you. So I want to use something that relies on this. So say we have, it's much better. Suppose we have some situation like x squared plus y squared plus z squared is 4, and x plus y plus z is 3. So this guy defines a sphere. Radius squared is 2. Ah, rad is 3. What? What's that? No. No? The distance, oh, the distance from x, y, z origin is the square root of 4. And this has some plane. So what this is really talking about, I will try to draw it, but probably do it badly. I, hello, can I write? So can everyone see my fingers? Tell me when you can't see my fingers. You're better. What? You like my reading? That's fine. So somewhere around here. All right. So I have some sphere. Let me just write it. Try to give me helper quadrant. I have some sphere there. That's the sphere. It goes in the back, so whatever. This is the sphere. x squared plus y squared plus z squared is 4. And then this is cut by a plane which goes through 3,0003 and da, da, da. So it's behind. No. This is 2, so it's out here. This is cut by a plane which is actually in front of it, but it cuts through right here. So the sphere pops out right here. Can you see that? I don't know if you can figure it out. So this triangle is the piece of plane x plus y plus z is 3 and the sphere is behind the plane except for right here where it pops through. Why? Well, because the distance from this plane along the line here is less than 2 but out here is more than 2. So we have this sphere sort of sticking through but in particular these two things together define the circle sort of floating up here. This is where both are true. That's fine. So in some sense this circle, so we can solve this equation, right? We can, for example, pick one of the variables and solve each for the other and plug in and blah, blah, blah. But this circle is a function of it. We can think of this circle as a function of x and y, which gives us a height, right? But I don't want to do that. So we can think of this circle as being defined implicit. And maybe we know some point on this circle. What is the point that I found? So say I have a point x is 1 minus root 2 over 2 and y is 1 plus root 2 over 2 so there's a height 1. Say this point. So say if I have a point, so what's the tangent vector 1 minus root 2 over 2 1 plus root 2 over 2, 1. So that's a point on both because, well, certainly this is 3 and if you work it out, it also works out to be. So it's at some point there, okay? So let me not do that yet. So let me remind you of something that you do already. Say I have a simpler situation where I have x squared plus y squared equals 1. Now this is single variable calculus. So I'm going back to calculus 1 here. We have a circle x squared plus y squared equals 1 implicitly defined, so I can solve is say square root of, oops, backwards, 1 minus x squared or y is minus the square root of 1 minus x squared or let's call this maybe g1 of x g2 of x or I could have something. So this guy gives me the top half of the circle. This guy gives me the bottom half of the circle or I could do some. So this is, I guess, in both cases x has to be between minus 1 and 1 but I could also do something where I take this piece of the circle and this piece of the circle and that's a perfectly good one. g3 is 1 minus x squared if x is 0 less than or equal to x less than or equal to 1 and minus 1 minus x squared or minus 1 less than or equal to x less than 0 so that also gives me a perfectly good and I can do any sort of combination of that. Right? So I have lots of choices of inverse functions depending on what I feel like choosing but I seem to be writing crooked a lot but I can also do some calculus here if I wanted to know the slope at well, any point, say in order to find the slope dy dx so here I choose one of these functions and I don't really need to tell you which one just yet I don't even need to be able to find the function just from this write it this way then I just use implicit differentiation right? Not necessary because it's easy but maybe we have something that's harder to solve so if that means that I'm thinking why is some function gx and I don't care what that function is then I'm going to think that this is smooth so differentiable at some point that's not why not so I have an implicit I mean I have an inverse function and if I think of that then I can easily get so this really tells me x squared plus g of x squared minus 1 is 0 so taking derivatives 2x dx dx plus 2 g of x g prime of x is also 0 and so that tells me that in fact let me write it as dy dx to emphasize that so that tells me that what? Solving dy dx is minus x over y so we're going to do that right? yes so if y is not 0 y is 0 then I have not a well-defined tangent because it's infinite and so everything's good here and so for example at the point that say x equals I don't know I can't even think of something that's terrible so if we know x and y then we know the slope right so how about that x equals 1 over root 2 y equals negative 1 over root 2 slope is 1 so here the slope is 1 okay? so this is not this is better not be new to anybody I hope it's not new to anybody I'm just reminding you of something you already know so now let's try and apply that to this situation well actually I'm not quite ready to apply that to this I'm going to write that a little more generally okay so a little more generally again this is still the single variable case I have some function f of x g of x which is 0 and then I can use the chain rule to get just taking derivatives here dy dx out of this because if I take this as some function which really just depends on x and then I use the chain rule to pull it out so now I want to try and put this in that same kind of a thing so let's write z as a function x and y is a function of z so then I can dx, dz and dy, dz we'll have two different derivatives right? I'll have dx, dz, and dy, dz here I'm thinking of z as a function x and y is a function of z in this case because here I have three equations and two equations and three unknowns I can get rid of everything except one of them right so I could solve if I wanted to so in this situation I have f of function g of z which is really x, y what am I writing x the other way around let me just not do it let me just do this so I can do the same nonsense right I can just take the derivative of this so here that is I have z is sorry so I can have x as some function of z and y is some function of z right if I know z from this picture I know the height then I know at least nearby x and y I'm seeing some confused faces yeah let me come back to big f let's forget about big f I'll come back to it so let me just it's not there think about this situation I have this equation I could if I like you know write z equals 3 minus x minus y plug that in here and take the square root and blah blah blah if I want to z equals 3 minus x minus y from this equation then from this equation I have x squared plus y squared plus I don't want to do this equals 4 squared and I can call for this so if I know z then I know everything so I'm doing that because it just sucks so I'm not going to do this so I'm thinking here that I have some that this is some function let's call it g g of z because I know z does this describe the circle right now then you have the circle it satisfies both of these equations at the same time right and so g is a function here r r2 it parameterizes this circle at least locally give me a little path here that tells me what the x and y are and so there's a function vector there we can figure out the derivative and it works exactly the same way so if this function is nice then dx dz dy exist we can find them so what do we do? we do exactly the same nonsense thinking here that x and y would end on z so I take the derivative of this with respect to z so I can take the derivative here with respect to z to get 2x dx dz plus 2y dy dz plus 2z dz dz is 0 and here I get dx dz plus dy dz plus 1 is also 0 there's implicit differentiation on each equation independently and both of these things need to be true so now we know how to solve equations is it linear in the derivatives we know how to solve these linear equations let me just do it rather than setting it up as a matrix and blah blah blah let me just do it by hand here so this guy tells me that dx dz is 1 minus dy dz and now I put that up here and get oh probably yeah it's probably true so dx dz is negative 1 plus 2 and so now I put that up here and I get minus x times 1 plus dy dz plus y dy dz plus z is 0 and in fact I guess 12 okay so now I'm kind of done here well let me just finish it up so I put x minus z over here taking those guys over there and now I get 1 plus y no sorry it's just so here I get minus x dy dz plus y dy dz and so that tells me that dy dz is x minus z over y minus x and so that means that in general dx dz dy dz is whatever the heck it is well I got dy dz is x minus z over y minus x and dx dz is minus 1 plus y minus z right so now I know the derivative everywhere except along the line y equals x I know dx dz and dy dz except along right here and right here where right so in particular at that point which I would have plugged in here I have to do right so I know how x changes when I change z and I know how y changes when I change z so that says yeah that's why it's here so if I move z up and down then I know how x and y change but here I can't move z up and down because that's exactly perpendicular trying to move z up I don't know whether to go right or left right because it's sort of at the bottom of the circle and at the top of the circle if I try to move z up I don't know whether to go right or left so this just tells me how x and y will change if I move z over okay so that's one thing we can do I already did that good so okay so now I want to try and put this in a more general context and then try and make sense of what it's saying this wording is maybe a little bit probably in this group so here in this case and there's more examples in the book with other variations these examples aren't quite in the books they're close so what do we have here I'm thinking that I have some big function f from rn plus m to rm so that is I have m equations in n plus m unknowns I have big f taking r3 to r2 I have this circle I have two equations in 2 plus 1 unknowns and now I want to find the derivative in terms of n so I can have so this means a local inverse let's call it g and I really want g inverse well how about that so this isn't what I wrote in my notes anyway I should be able to find a function g from rm to rm that is the number of variables that I have I mean the number of equations that I have which is invertible and then I'll be able to find the derivative of f in terms of those n variables I mean the n variables let's just say that part okay does this kind of make sense for example this m is 2 and n is 1 and I had two equations in 3 unknowns I have one variable left over and so I can find the derivative in terms of that one variable and that tells me what's going on alright so but I need well I need that dg for that to work so let me see if I can give the right space so let me write this a little more mathy yeah mathy so this is what the pf was so so let me actually in that case I have my big f which depends on x, y, and z is two equations x squared plus y squared plus z squared minus four and x plus y plus z minus three and I was trying to see what happens and here I want f of x, y, z is zero and since I chose to solve for x and y in terms of z my g in this case sorry backwards is that and so that means I found sort of df in terms of what's left over this makes sense what did you want to do so it's equal to zero would you like it to be equal to five I mean it's easier if we set it to zero because it just sort of makes everything into a thing rather than saying so by zero you mean zero is just some constant what might be both of those I want, no, yeah so this is the same statement right okay so by zero it's a zero vector so this is really right because it's from rn plus m to rm but here my zero vector what's the zero number as well oh but I thought it was oh no I guess it's zero vector sorry okay and then here also yeah so here's a g it's from i into i yeah so correct I guess something's wrong here or one, well here okay yeah I think I screwed I think this is not my this is not my okay okay so I screwed it up okay so let me let me write the implicit function there I'm going to try and figure out what I'm saying okay so I have so I have this which is continuously differentiable near I don't know what you should call it x0 and for some x0 in rn n yes y0 in rn we have the following things well first we have f of x0 y0 zero vector and also the derivative of f with respect to the y variable y is a vector so let's write it as df this is I don't know how to write that the notation sucks that's a d that's a d I was off by a letter alright okay so that this guy is invertible so the derivative is not zero there x0 y0 yes yeah this is m rn yes okay this is in rn so really what I'm thinking here this is a this is an n vector and this is an m vector and so I'm sort of separating it into the stuff I can invert and the stuff that I want to solve in terms of so and if I take if I think of f the derivative of f with respect to the stuff I can invert that's my g I guess so if I have that then there is a continuous differential continuously differential and it's unique what's left from the m equations that we have so that this is defined so it's continuously differentiable near x0 so that I guess I should move up here I have two things g of x0 y0 and also dg which is now a square matrix and sorry and f of x0 g of x0 which gives me my y's not non 0 and one more thing sorry one more thing we can calculate as minus this vector derivative of f that's a matrix it's an m by m matrix and we compute the product of that with the x derivative of I guess this is a x not not so this is an m okay so this maybe black so let me do an example okay so this is sort of completely generalizing the implicit differentiation stuff in the case let me just say this in the one variable case for a minute in the one variable case I can write y well I want to write y in terms of x but I don't want to actually write down a function but if I check then as long as the derivative is non zero there as long as there is a derivative then I can write a formula relating x and y this is kind of the of course I've erased it already in fact I just erased it this is kind of the equation that you get when you do implicit differentiation right when I do implicit differentiation so let's take the example just the easy example x squared plus y squared equals 1 then my g function here is g of x equals y and I get something this is my function here which I just write this way this is my f this is my f from r to r r1 plus 1 to r1 this is in the single variable case and then when I take my derivatives and I solve this is what I do I take the derivative with respect the derivative with respect to y and I take the derivative with respect to x and I divide by bring it over to one side and I divide out and I'm good yeah big f is just little f on the left side what do you know it's big f big f here is your collection of equations big f is your collection of equations equal to zero right so in this example here's my big f so in that one it just happens to be one equation because really there's only one yeah variables one equation and two unknowns and there's just one here right since I have two outputs I have two equations I can give them all but one and I can calculate the tangent vector in the xy because I can solve but okay and in general it's always going to work because I'm not going to write the proof of this you really want to know how to take math 322 what's 322 322 is it's called I don't know what it's called it's the course that you take after you take the first real analysis course it's multivariable analysis but I don't remember what it's called it's calculus unmanifold how about that so let me do an example here x squared y plus xz and xz plus yz so there's some function and I want to know what I'm going to take here so I need I can solve for one I can solve for one in terms of two because I have three variables two unknowns so here I can take x to just be x and y this notation sucks but anyway to be yz take the y vector so I can solve this is a function from r3 to r2 think f is r3 r2 so I have to pick two variables and given two variables I can find the other one in terms of the two in the previous case I had a function from r3 to r1 so I only had one variable to deal with which isn't sad so so my g here is going to be from r2 to r2 so y is my variable that gx so I'm taking here f of x g of yz not g of y so I'm going to look the y's and the z's together into the variable that gx and I'm going to try and figure out what's going on so calculate the partial of f with respect to x which is just x and evaluate it at some point x, y, z and this is why can't I do this my brain just rolls up so here I'm just taking the partial with respect to x in fact let's put x there so I'm going to take the partial of f with respect to x here I get 2xy plus z and here I get z that's it because it's the partial and now if I take f let me write it as yz so I'm thinking now this f I'm going to write it so I'm going to get a 2x2 matrix now because I'm going to take the partial with respect to y and the partial with respect to z so the partial with respect to y gives me x squared that's gone and z and with respect to z I get x and I get y and let's just do all of this so at the point probably I'm taking respect to z so that means that in general I can find the inverse of the function that takes and I have some function g of yz which is x which I don't want to try and solve for but I can find its derivative and its derivative is given by that formula so I would invert this matrix take its negative and multiply it by this matrix so let's just do it with numbers rather than with because I don't really want to I mean we can write the inverse of this in general yeah should that z be zero since you're writing for y x squared c x plus y yeah I'm back with services and that one 2 x y plus c x isn't that right I mean the other one was right okay it doesn't matter because I'm going to take it at a point it doesn't matter because I'm going to take it so write the derivative here I'm going to take the first function with respect to each of the variables and the second function with respect to each of the variables is that what I did yeah yeah okay so let's just look at one negative one one so let's just find one one so let's check that that's on there if x is one and y is negative one this is negative one so here f of one negative one one is supposed to be the zero vector so that's negative one plus one and negative one minus one so this is going to be the zero vector so I'm happy so now that means that f of x negative one one should be five before alright well okay it is what it is and this f y c one one is one one one two two before okay is it x plus y or x plus z? I take the derivative with respect to x I mean I take here the derivative with respect to y I get z and I take here the derivative with respect to z and I get x plus y alright okay well it's still okay yeah this should be four no two plus one is three no negative one alright well it's what it ever is okay so the inverse of this matrix so we have to compute f okay I used to have a little box that left just like that so when I was a kid I had this little thing I could just turn on it would laugh like that so anyway I want to compute the inverse of this matrix which is what one negative one negative one isn't that right okay so here isn't this right why can't I compute the inverse of this matrix I don't think this is right now is that right that's zero I want that to be zero well see it's not the matrix that I did before why can't I do the inverse today I don't know let's just do it one one zero one one zero zero and so here if I subtract that from that alright that one's okay and if I subtract this from this I get zero one and this one this one minus one and so the inverse here should be zero zero one one negative one right right that's the inverse matrix so if you look at that there I have the inverse matrix and so that means that DG at my point wherever my point is one negative one one is negative this product zero one one negative one negative one one which is one negative two zero one minus one is negative two there sorry I can't calculate even that's why I did it in my office first but obviously I screwed that thing huh negative one negative one negative one so I could do more examples but I prefer not can't imagine why this function is sort of complicated and hard to understand but the thing to keep in mind is if we have n plus m variables if we have k variables with n unknown with k bigger than n then we can find an inverse and we can find it's true that's essentially the other one yeah G G is the function that tells me X in terms of Y and Z so this tells me that if I move Y a little bit so that tells me that that tells me that near what is this telling me this is a different function so this is saying X is so near point one negative one one on this intersection of those two curves those two surfaces X is about one well exactly one so X is about one no zero plus something wrong one so X is one plus minus one times however much I moved in the Y direction so let's call it Y plus one plus two times Z minus one plus higher order terms that I don't know that's what it's telling me it's telling me that if I move Y and Z a little bit then I have this tangent plane that tells me how X moves G X Y so this is telling me G of X Y G of Y Z looks like that if you prefer to do it in terms of X Y and find Z as a function of X Y then we would have had to take this to be our Z and this to be X Y and we have a different partial which is maybe what I did over there when I got five and three instead I don't know but we could do that too so if we rather solve for Z in terms of X Y that's okay too it's sort of a mess to try and solve this for X and Y in terms sorry for X in terms of Y and Z that's not that bad right this one's easy this one's a little bit messy these surfaces this is a complicated curve yeah so if you have to like four variables going to two what would you take X and Y so if I have four variables going to two so let's put plus U plus so now I have X Y Z U I have four variables going to two so I have to pick two of them that I solve in terms of the other two right so pick two let's take X to be X U Y to be Y Z and then when I take this partial this will be a two by two matrix I mean I changed it so let's change it did I do something wrong properly this guy with respect to X and then this guy with respect to U is one this guy with respect yeah so there I get that and then here well this all dies nothing changed there right when I take the derivative with respect to anything that is in U that's zero with respect to anything that is so if I take the derivative with respect to Y or Z this term doesn't the U term didn't affect anything because I just added plus U right so now I have a two by two and a two by two I don't have my numbers anymore I guess at U equals zero I know it so at U equals zero right so yeah let's just modify this so now I have okay this is still the same that's still zero zero so that's good and then here I threw in U equals zero and when I plug in U equals zero well now this is my new matrix right this is the same because this is the same so no change there it's inverse is the same so now DG will be a different product what was this minus one will be minus one one one one and that had better not be good the derivative determinant is negative two so that's good I didn't check but yeah okay and so that will be this product right which is why can't I do it it is one zero no minus one minus one is usually minus two and this one's zero good so that tells me then now I'm going to have since I changed my function near this point my G of YZ which is now going to give me both X and U will be well now I have two guys here well it's really X minus one and U so this will be X minus one plus U here and minus two X minus one this shouldn't be X minus one this is a function of Y and Z so this should be Y plus one and Z minus one sorry it was being stupid so this is Y plus one plus Z minus one there and here I have minus two Y plus one right so now I have this function so this is my X U so for this new function where I added another variable I now know how the two variables relate to the two variables let's say one of them finds BG in general 16 variables and 8 unnotices I want to find BG in general how would you invert like F with YZ treat those are just numbers so you just find the inverse it sucks right I mean I have to find you can do it because it's linear but I don't want to do it okay yeah we don't actually know what BG is we're just trying to approximate it just like just like just like you don't really know what this function is how do you know what do you think your computer does this is not a function that you calculate other than by saying well actually I guess right you calculate this in terms of this you don't really know what this function is you calculate it in terms of the sign of Y it's the same business here we don't know a nice formula for the inverse but it sort of doesn't matter because we can find I mean okay if you want to really work hard you can do this in more variables and you can locally invert it as much as you want you can write the Taylor series by doing this business but Taylor series in multivariables is really kind of harrow and you can do it you saw it in that one homework problem and it just gets worse so it depends on the Hessian and stuff like that so that's what we're doing but now in okay let me any more questions about this so if you get to do a few for homework yay I mean these are a little bit hairy and I understand these can be a little bit hairy and yeah yeah so let me where did the negative go? oh I probably lost it yes I lost it right here I lost it right here you know conceptually everything's good in terms of actual written stuff not so good I don't even know why I bother with notes they don't match what I do okay so we're a little bit behind about one section behind where I expected to be and let me well let me start and then I'll start again that's why we're behind also actually let me point out before I start while I'm chasing back and forth in the main five minutes that the second midterm will be on the the second Wednesday of November which is what the 13th yes I moved it ahead a week and I'm going to be away the 11th and the 13th be it in the um so I will be away cool so I will get someone else to cover the class either we can just blow it off if you want I don't care okay wait a minute let me tell you okay so here November 6th is here that is the fourth is here this is a Monday this is a Wednesday this is a somewhat abbreviated calendar for November so on this day the plan is to review and on this day the plan is to take a test so I can either ask someone else to do the review because you also have afterwards you have recitation with okay what name are they used now Jim Ashley Jim Jim so how about here since I'm going to be in India okay so um so you have also recitation with Arun I can ask Arun to cover the class and then you can have two hours of review or I can ask someone else who already owes me because I covered his class all last week to just come and answer questions and then you have a different perspective on stuff so don't care which one would you prefer do you want your friend Arun or do you want you want the other guy his name is Arten that's actually his name what class is this he's teaching 127 right now so people would in general rather have Arten for the first hour and Arun for the second hour okay so I will make sure that Arten comes and I will give him stuff to answer questions on so I will