If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Quadratic approximation example

## Video transcript

when we last left off in the riveting saga of quadratic approximations of multivariable functions we were approximating a two variable function f of X Y and we ended up with this pretty monstrous expression and because it's written in its full abstract form I almost feel like it looks more monstrous than it needs to so I'm going to go ahead and go through a specific example here and just to remind you of kind of what all these terms are how there's actually kind of a pattern to what's going on this here represents you could think of it as the constant term where you know this is just going to evaluate to some kind of number these two terms are what you might call the linear term linear because if you actually look the only places where the variable x and y comes up is here where it's just being multiplied by a constant and here where it's just being multiplied by a constant so it's just variables times constant in there and then all of this stuff at the end which is kind of the whole essence of a quadratic approximation where you start to have things like you get an x squared and you get like X gets to be multiplied by Y all of this stuff is the quadratic term and though it seems like a lot now you'll see in the context of an actual example it's it's not necessarily as bad as it seems so let's say we're looking at the function f of X Y and let's say it's going to be e to the X divided by 2 x sine of Y this is our multiply very function and let's say we want to approximate this near some kind of point and I'm going to choose a point that's you know something that we can actually evaluate these at so like X it would be convenient if that was 0 and then Y I'll go with PI halves because that's something where I'll know how to evaluate sine and where I'll know how to evaluate its derivatives things like that so we're trying to approximate this function near this point now first things first we're just going to need to get all of the different partial derivatives and second partial derivatives we know we're going to need them so let's just kind of start working it through and figuring out what all of them are so let's start with the partial derivative with respect to X so this is also a function of XY and we look up at the original function the only place where X shows up is in this e to the x over 2 the derivative of that is 1/2 we bring down that 1/2 times e to the X over 2 and this is being multiplied by something that looks like a constant as far as X is concerned sine of Y now when we do the partial derivative with respect to Y what we get this first part just looks like a constant so we kind of keep that constant there as far as Y is concerned and the derivative of sine is cosine cosine of Y and then now we let's start taking second partial derivatives so I'll start by doing the one where we take the partial derivative with respect to X twice now here I'll actually do this I'll do this in a different color what let's do like yellow just to make clear which ones are the second partial derivatives so partial with respect to X twice also a function of X Y like all of these guys and so let's look up the original partial derivative with respect to X and we're now going to take its derivative again with respect to X this is the only place where X shows up that 1/2 kind of comes down again so now it's going to be 1/4 times e to the x over 2 and we just keep that sine of Y because it looks it looks like we're just multiplying by a constant sine of Y next we'll do the mixed partial derivative where you do first with respect to X then with respect to Y or you could do it the other way because with almost all functions it kind of doesn't matter which order you take the two so I'll go ahead and just look at the one that was with respect to X and now let's think of its derivative with respect to Y this whole 1/2 e to the X halves looks like a constant derivative of sine of Y is cosine Y so we take that constant the 1/2 e to the e to the X halves and then we multiply it by the derivative of sine of Y which is cosine of Y and then finally we take we take the second derivative second partial derivative with respect to Y twice in a row so F with respect to Y twice in a row and for this one let's take a look at the partial derivative with respect to Y this part is the only part where Y shows up derivative of cosine is negative sine and then e to the X halves just still looks like a constant so we bring that negative out front that constant e to the X halves and it was sign so that negative one out front sign of why so that's that's all of the partial differential information that we're going to need and now we know we're going to need to evaluate all of these guys all of these partial derivatives at the specific point because if we go up and look at the original function that we have we're going to need to evaluate F at this point both of the partial derivatives at this point the second partial derivatives I'm realizing actually that I made a little bit of a mistake here this should be a one-half out in front of each of these guys that should be plus one half of this second partial derivative and one half of this second partial derivative the mixed partial derivative it's still one but these guys should have a one-half that's a that was a mistake on my part another case that we're going to need to evaluate all of these guys so if we go back down let's just start plugging in the point 0 and PI halves to each one of these so the function itself when we plug in 0 e to the 0 is 1 and sine of PI halves sine of PI halves is also 1 so this entire thing just comes to 1 if we do this for the next one again e to the e to the 0 is going to be 1 sine of Y is also going to be 1 but now we have that 1/2 sitting there so that'll end up as 1/2 if we look at the partial derivative with respect to Y cosine of PI halves is 0 so this entire thing is going to be 0 moving right along if we do let's take a look at the second partial derivative with respect to X again e to the 0 will be 1 and sine of PI halves will be 1 so this ends up just being that 1/4 the mixed partial derivative here if we have 1/2 by you know the pattern starting to continue have got the 1 this one's actually zero so cosine of PI halves is 0 so the whole thing will be 0 and then the last one it'll be negative 1 times that one again for sine of PI halves as 1 so all of that just comes out to be negative 1 so this is I mean it kind of chose a convenient example right where all the derivatives look very similar to the thing itself which is actually pretty common so we get to leverage a lot of the work that we did earlier so now we have these six different Stinson's kind of can't keep them all on the screen at the same time but we've got this six different constants so now we just plug each one of these into the quadratic approximation so if I make our quadratic approximation of our function the first term is that constant term so we take a look up and we say where does f of X Y go at this point and it'll just be one I'm going to have to do a lot of scrolling back and forth here there's a lot of text to deal with and then the next thing is going to be something times X minus minus zero the kind of x coordinate of our specified point and that something is the first derivative with respect to X so that's going to be one half so coming back down here that one half and then similarly we're going to have something multiplied by y minus the y coordinate of the point about which we are approximating and for that we take a look at the partial derivative with respect to Y which was just zero so that's pretty convenient that's just going to end up being zero and then for the second partial derivative terms maybe I'll actually be able to keep it on the same screen here we're going to have something multiplied by X minus you know it's coordinate squared and that something is whatever the partial derivative with respect to X twice's which is 1/4 so we go ahead and plug in 1/4 and then for the mixed partial derivative I'll put it down here it'll be something multiplied by you know X minus its constant and then Y minus that PI halves and that something is the mixed partial derivative which in this case is zero what I'm realizing I made the same mistake again it's a it's not 1/4 it's 1/2 we you know for the same reason that I made a mistake up here earlier where it's actually 1/2 multiplied by this second partial derivative and 1/2 by the second partial derivative there I guess I keep forgetting that good lesson I suppose that that's a that's an easy thing to forget if you find yourself computing one of these where I'll put it in here multiply that guy by 1/2 it's similar to a Taylor expansion in single variable calculus where you kind of have to remember what's what that squared term would be has a 1/2 associated with it so for that same reason now we're going to have and this time I won't forget it will be 1/2 multiplied by something multiplied by the Y minus PI halves minus that y-coordinate of the point we're approximating there and this time that something is is negative 1 so we can kind of plug in here negative 1 and now this is something we can we can simplify quite a bit because that one stays there 1/2 of X minus 0 that's just X halves this whole part cancels out to 0 so there's nothing there over here we have 1/2 times 1/4 1/8 times x squared so that's x squared divided by 8 this mixed partial derivative term is 0 so that's pretty nice and then this last term here is just a negative 1/2 so let's see how I write it down as negative 1/2 by Y minus PI halves squared by Y minus PI halves squared so that that is the quadratic approximation and you can see this is low this actually feels like a quadratic function we've got you know up to x squared and up to Y squared and there's a sense in which this is a a simpler function I mean it looks like it's got more terms than the original one which was e to the X have sine of Y but if it's you know if it's a computer that needs to compute these things for example it's much easier to deal with polynomials that's that's a faster thing to do also for Theoretical purposes it can be nice to deal with just a quadratic polynomial to make conclusions about things we'll see that in the context of something called the second partial derivative test which is just to get a feel for what this what this means let's pull up the graph of the relevant functions so this here is the graph of the original function e to the X halves times sine of Y and the point that we're approximating near was where x equals 0 so let's see how we get oriented X is equal to 0 and then Y is equal to PI halves so this is the point we're approximating near and the quadratic approximation when you plug everything in has a graph that looks like this white surface here so if I get rid of that original graph this is how we're approximating the function near that point and then that does a pretty good job right because even as you step pretty far away from that point it's pretty closely hugging the original surface if you go very far away you know it certainly doesn't get the oscillating nature of that sign component and the the exponential component grows faster than the quadratic one but nearby nearby this actually gives a very good feel for the the shape of the graph and again later on we'll see how this is a pretty useful theoretical tool for drawing conclusions about qualitative features of the shape of the graph the fact that this looks kind of like a saddle is going to end up being kind of important in certain contexts but before we get to any of that in the next couple videos I'm going to talk about a a simpler or rather a more generalizable form of writing down this quadratic approximation using vector notation because right now we're just limited to you know two variables and you can imagine how monstrous this might look if you were dealing even just with a three variable function right where think of all the different possible second partial derivatives of a three variable function or a four available variable function it would quickly get out of hand but there is kind of a nice general way to write all of these so with that I will see you next video