8. Multivariable calculus

Functions of multiple variables

We would like to study functions of multiple variables, which means that the functions we will consider depend on more than one argument, e.g.:


is a function of two variables. Such functions obviously appear in the real world, e.g. temperature on a surface which depends on coordinates x,y. Or the height of a terrain.

Obviously, we can also easily check the domain of such a function. In the case of two arguments it will be a subset of a plane. E.g. the domain of f(x,y)=\frac{1}{x+y} is \{(x,y)\colon x+y\neq 0\}, so those are all the points of the plane except from the line y=-x.

Limits and continuity of functions

We say that a function f (assume that it depends on two arguments) has a limit in a point (x,y) equal to g, if for any sequence of points (x_n,y_n)\neq (x,y) in the domain, such that x_n\to x and y_n\to y, we get \lim_{n\to\infty}f(x_n,y_n)=g. But if for some of such sequences this limit does not exist or there are different limits for some different sequences, that the limit of the function in question does not exists. E.g. f(x,y)=xy has in (0,0) limit, because for any (x_n,y_n), such that x_n\to 0 and y_n\to 0, we have \lim_{n\to\infty}x_ny_n=0.

Similarly, as in the case of one-dimensional functions, a function is continuous in a point if its limit in this point equals its value.

Partial derivatives

Given a function f, e.g.: f(x,y,z)=2xy+z^2-y^2z+x^3, we can calculate its derivatives with respect to subsequent arguments (considering the rest of arguments as constants). Such derivatives are called partial derivatives and we denote them as \frac{\partial f}{\partial x} etc. In this case: \frac{\partial f}{\partial x}(x,y,z)=2y+3x^2, \frac{\partial f}{\partial y}(x,y,z)=2x-2yz, \frac{\partial f}{\partial z}(x,y,z)=2z-y^2.

We can also calculate further on, namely calculate second derivatives, so, e.g.: \frac{\partial^2 f}{\partial x\partial y}(x,y,z)=\frac{\partial \frac{\partial f}{\partial x}}{\partial y}(x,y,z). In our case: \frac{\partial^2 f}{\partial x^2}(x,y,z)=6x, \frac{\partial^2 f}{\partial x\partial y}(x,y,z)=2, \frac{\partial^2 f}{\partial x\partial z}(x,y,z)=0, \frac{\partial^2 f}{\partial y^2}(x,y,z)=-2z, \frac{\partial^2 f}{\partial y\partial z}(x,y,z)=-2y and \frac{\partial^2 f}{\partial z^2}(x,y,z)=2.

Notice that (if a function is fine enough), the order of differentiation is not relevant.


Similarly as in the one-dimensional case we can find local maxima and minima by analysing derivatives. The necessary condition (for fine enough functions) is that the first partial derivatives equal zero. But this condition is not enough and we have to look into the second derivatives also in the point with zero first derivatives.

Second derivatives can be viewed as a so called differential of a function in a given point. A differential of f (assume that it is a function of two variables), is df_{(x,y)}(h_1,h_2)=\frac{\partial^2 f}{\partial x^2} h_1^2+2\frac{\partial^2 f}{\partial x\partial y} h_1 h_2+ \frac{\partial^2 f}{\partial y^2} h_2^2. If this differential gives only positive values for any h_1,h_2 (except when both h_1,h_2 equal zero), there is a local minimum in (x,y). If it gives always negative values, we get a maximum. If it allows negative and positive values depending on h_1,h_2, there is no extreme in this point.

Let us check this using function x^3+x^2+y^2. First derivatives: \partial f/\partial x=3x^2+2x, \partial f/\partial y=2y, are equal zero for y=0 and x=0 or x=-2/3. Let us calculate second derivatives: \partial^2 f/\partial x^2=6x+2, \partial^2 f/\partial x\partial y=0, \partial^2 f/\partial y^2=2, so the differential in (0,0) is: df_{(0,0)}(h_1,h_2)=2h_1^2+2h_2^2+0h_1h_2, and is always positive, so we have a minimum here. For (-2/3,0), we get df_{(-2/3,0)}(h_1,h_2)=-2h_1^2+2h_2^2+0h_1h_2, which gives -2 for h_1=1, h_2=0 and 2 for h_1=0, h_2=1, so it is not an extremum.

Double integrals

Assume that we would like to calculate the volume of a pyramid with a base in form of a isosceles right triangle (with boundary of axes and line y=-x+1) and height 1, so in point (x,y) the height is given by the following formula h(x,y)=-x-y+1. Therefore the section at x has area P_x=\int_0^{1-x} h(x,y)\, dy, so the volume is:

    \[\int_0^1\left(\int_0^{1-x} h(x,y)\,dy\right)\, dx= \int_0^1\left(-xy-y^2/2+y\right)|_0^{1-x}\,dx=\]


which is consistent with our knowledge about geometry.