Both partial derivatives of a function can exist at a point where the function is not even continuous, so having partial derivatives cannot be what it means for a function of two variables to be differentiable.
The example is the function whose limit depends on the direction of approach, and it shows that partial derivatives, the one direction slopes of the previous lesson, are too weak on their own. This lesson finds the right notion by asking what a derivative did in one variable and demanding the same of a plane, then turns the resulting tangent plane into approximations and into an estimate of how errors in measured inputs spread into a computed result. It assumes partial derivatives, written and , and the equation of a plane.
Two slopes are not enough
Take with . On the axis the function is identically , so its slope in the direction at the origin is , and the same argument on the axis gives . Both partial derivatives exist. Yet along the line the function equals at every point, however close to the origin, so it is not continuous there.
The partials describe a surface along two lines only, the axes through the point. Here the surface is flat along both, at height , which suggests that near the origin it should look like the plane . It does not: along the diagonal it stays half a unit above that plane all the way in. Two slopes say nothing about the infinitely many other directions, the same weakness the limit had when only some paths were checked.
Treat the candidate plane as an approximation and measure its error. At the function is and the plane is , so the error is however small is. An approximation whose error does not even go to zero is no approximation at all, and that is the property to repair.
What a derivative really promises
In one variable, is defined as a limit of slopes, but the same fact can be stated as a promise about approximation. Write the change in as the tangent line's prediction plus an error:
Dividing by gives , and the definition of the derivative says exactly that this tends to . So is differentiable at precisely when some number makes the error of shrink faster than itself, . The error of a mere continuous function only tends to zero; the error of a differentiable one is small even compared with the step.
This version generalises without any trouble, because it never divides by a vector. A function of two variables is differentiable at if there are numbers and such that
with as . The denominator is the distance from to the new point, so the requirement reads: the error of the linear prediction shrinks faster than the distance, in every direction at once.
The numbers and are forced. Set and the condition becomes , which says . Setting gives . So a differentiable function has both partials, and they are the only possible coefficients. Differentiability also forces continuity: as the terms , and all tend to , so .
The pathological function now fails cleanly. Its only candidates are , and at the error is while the distance is , so the ratio is , which grows without bound instead of shrinking. The function is not differentiable at the origin, as its discontinuity already guaranteed.
A well behaved function passes just as cleanly. For at any , expanding gives . The partials are and , so the error is exactly . Since , the error is at most half the square of the distance , and . The error is quadratic in the distance, which is the typical pattern.
The tangent plane
When is differentiable at , the linear part of the promise, written in terms of and , is the tangent plane to the graph :
It passes through the point on the surface, and it is the only plane that hugs the surface in the strong sense of the definition: any other plane through that point has an error that shrinks only as fast as the distance, or not at all.
The geometry agrees with the algebra. Slicing the surface with the plane gives a curve whose slope at the point is , so its tangent line runs in the direction : one step in , none in , a rise of . The slice gives the direction . A tangent plane must contain both lines, and the cross product of the two directions is a normal to it:
The plane through with this normal is , which rearranges to the formula above.
Example. Find the tangent plane to at the point above , and compare it with the surface at .
The value is . The partials are and , so and . The plane is , which simplifies to , with normal . At the plane gives and the surface gives . The error is , and expanding shows that it is exactly , minus the square of the distance, whatever the step. The plane lies above the surface, as it must for a dome.
Now you. Find the tangent plane to at the point above , and use it to estimate the height of the surface at .
Answer
Here , and at the point, so the plane is , which simplifies to . At it gives , against the true value .
Continuous partials are enough
Checking the definition directly is tedious for anything larger than , so in practice differentiability is recognised by a theorem.
Theorem. If and exist near and are continuous at , then is differentiable at .
The idea of the proof is to travel from to along two legs parallel to the axes, first to and then up to , so that on each leg only one variable moves and Calculus I applies. By the mean value theorem, the change along the first leg is for some point on that leg, and the change along the second is for some point on it. Subtracting the linear prediction leaves
Since and are each at most the distance , dividing by gives . As the point closes in, and are squeezed towards , and continuity of the partials sends both brackets to . That is the definition.
The theorem does its work through the inventory of continuous functions from the lesson on limits and continuity. The partials of a polynomial are polynomials, the partials of or are built from continuous pieces, and so every function assembled from the usual functions is differentiable wherever its formula and its partials make sense. The pathological function fails the hypothesis, as it must: away from the origin , which on the axis is and blows up as the origin approaches. The converse of the theorem is false (there are differentiable functions whose partials are not continuous), but they are rarities built to make the point, and the theorem covers everything met in practice.
Linear approximation
Near a point of differentiability, the tangent plane is a cheap substitute for the function. The linear approximation of at is
and it needs only three numbers computed once at a convenient point: the value and the two partials. Every estimate nearby is then a matter of multiplying the small changes by the partials and adding.
Example. Estimate from the linear approximation of at , and check it against the true value.
At the value is . The partials are and , which there are and . The steps are and , so the estimate is . The true value is , so the error is about , while the distance moved is . The error is a third of a percent of the distance.
Halving both steps, to , shows the definition at work. The estimate is , the error drops to about , a quarter of what it was, and the distance halves to . The ratio of error to distance has halved too, from to , and it keeps halving with each halving of the step. That is what shrinking faster than the distance looks like in numbers.
Now you. Use the linear approximation of at to estimate , and compare with the true value.
Answer
At the value is , with and . The estimate is , against the true value .
The approximation is only local. Using the same plane to estimate , a distance away, gives , while the true value is again exactly . The surface is a cone whose slope turns as the point moves round it, and how far a step can go before the error matters depends on how fast the partials themselves change, which is a question of second derivatives.
The total differential
The linear approximation has a compact notation that is worth adopting because it carries over to any number of variables. For the total differential is
where and are independent small changes in the inputs and is the change they produce along the tangent plane. The actual change in , written , differs from by the error term, which is small compared with the size of the step. For three variables, , the definition and the theorem go through word for word with three terms and the distance in space, and .
Each term answers a separate question: how much does the output move if only this input moves? Near the point, the answers simply add. That additivity is the whole content of differentiability, and it fails for the pathological function, where moving alone or alone changes nothing but moving both together changes the value by .
For formulas built from products and powers, dividing by the function gives a relative form that is easier to use. The volume of a cylinder is , so
and dividing through by gives
The relative change in the volume is twice the relative change in the radius plus the relative change in the height. The exponents become weights: a quantity raised to the power passes on times its relative change, and a quantity in the denominator passes on its relative change with a minus sign.
Propagating measurement error
Every measured input carries an uncertainty, and a quantity computed from measured inputs inherits one. The total differential says how much. If is known to within and to within , and these are small, then the computed is off by at most about
The absolute values are there because a measurement error can go either way, and the worst case is the one where both terms push in the same direction. This is the standard worst case bound quoted in engineering and in the first year laboratory.
Example. A cylindrical can has a measured radius of cm and height of cm. Estimate the maximum error in its computed volume, absolute and relative.
The volume is , about cm³. The differential gives , so the volume is uncertain by about cm³. The relative form gives the same answer more quickly: , a relative error of about . As a check, the largest possible can, , exceeds by cm³, and the smallest, , falls short by cm³. The differential sits between the two, as a linear estimate of a slightly curved change should.
The breakdown is the useful part. Of the , the radius contributes and the height less than , even though both were measured to the same cm, because the radius is smaller and is squared. A better volume needs a better calliper for the diameter, not a better ruler for the height.
Now you. One mole of gas at a measured temperature of K occupies a measured volume of m³. The ideal gas law gives the pressure as with J/(mol K). Find and the maximum relative error in it.
Answer
The pressure is Pa, about kPa. The differential is , and dividing by gives . The worst case adds the sizes: , a relative error of about , or roughly Pa.
The worst case bound is deliberately pessimistic. Independent random errors rarely conspire, and statistics replaces the sum of the terms by the square root of the sum of their squares: for the can, , or instead of . Either way the differential supplies the terms, and either way the errors must be small enough for the tangent plane to be trusted.
Compositions
Differentiability, a single plane whose error vanishes faster than the distance in every direction at once, is the notion the previous lesson was missing. It implies continuity, it holds wherever the partials are continuous, and its practical form, the total differential, turns small changes in the inputs into a change in the output.
In practice the inputs are rarely free to vary on their own. The temperature recorded by a weather balloon is evaluated along the balloon's path, where , and are themselves functions of time. The volume of a can being heated has a radius and height that both depend on the temperature. A formula given in and may be needed in terms of the polar and . Each is a composition: a function of several variables whose variables depend on something else.
The total differential already hints at what happens. If and both and change because time does, then should turn into a rate by dividing by . Whether that is legitimate, what it becomes when the inner functions have several variables of their own, and how it recovers implicit differentiation in one line are the business of the chain rule, the subject of the next lesson.