Title: Default for 18.1 Functions of Several Variables
Course: HELM Workbooks 2023-2024

Functions of Several Variables

A function of a single variable \(y=f(x)\) is interpreted graphically as a planar curve. In this Section we generalise the concept to functions of more than one variable. We shall see that a function of two variables \(z=f(x,y)\) can be interpreted as a surface. Functions of two or more variables often arise in engineering and in science and it is important to be able to deal with such functions with confidence and skill. We see in this Section how to sketch simple surfaces. In later Sections we shall examine how to determine the rate of change of \(f(x,y)\) with respect to \(x\) and \(y\) and also how to obtain the optimum values of functions of several variables.

Functions of several variables

We know that \(f(x)\) is used to represent a function of one variable: the input variable is \(x\) and the output is the value \(f(x)\). Here \(x\) is the independent variable and \(y=f(x)\) is the dependent variable. Suppose we consider a function with two independent input variables \(x\) and \(y\), for example \(f(x,y)=x+2y+3\). If we specify values for \(x\) and \(y\) then we have a single value \(f(x,y)\). For example, if \(x=3\) and \(y=1\) then \(f(x,y)=3+2+3=8\). We write \(f(3,1)=8\).

Example

Find the values of \(f(2,1),\ f(-1,-3)\) and \(f(0,0)\) for the following functions.

1. \(f(x,y)=x^2+y^2+1\),
2. \(f(x,y)=2x+xy+y^3\).

Solution

1. \(f(2,1)=2^2+1^2+1=6\), \(f(-1,-3)=(-1)^2+(-3)^2+1=11\), \(f(0,0)=1\).
2. \(f(2,1)=4+2+1=7\), \(f(-1,-3)=-2+3-27=-26\), \( f(0,0)=0\)

Functions of two variables

The aim of this Section is to enable the reader to gain confidence in dealing with functions of several variables. In order to do this we often concentrate on functions of just two variables. The latter have an easy geometrical interpretation and we can therefore use our geometrical intuition to help understand the meaning of much of the mathematics associated with such functions. We begin by reminding the reader of the Cartesian coordinate system used to locate points in three dimensions. A point \(P\) is located by specifying its Cartesian coordinates \((a,b,c)\) defined in the following Figure.

[Image: A point P in 3 dimensional cartesian coordinates.]

Within this 3-dimensional space, we can consider simple surfaces. Perhaps the simplest is the plane.

From the Section on vectors, we recall the general equation of a plane: \(Ax+By+Cz=D\) where \(A,\ B,\ C,\ D\) are constants.

This plane intersects the \(x\)-axis (where \(y=z=0\)) at the point \(\left(\dfrac{D}{A},\ 0,\ 0\right)\), intersects the \(y\)-axis (where \(x=z=0\)) at the point \(\left(0,\ \dfrac{D}{B},0\right)\) and the \(z\)-axis (where \(x=y=0\)) at the point \(\left(0,\ 0,\ \dfrac{D}{C}\right)\).

See the following Figure where the dotted lines are hidden from view behind the plane which passes through three points marked on the axes.

[Image: A plane in 3 dimensional space intersecting the coordinate axes.]

Exercise

Find the values of \(f([value],[value]), \, f([value],[value]), \, f([value],[value]) \) for the function \[f(x,y) = [value].\]

1. \(f([value],[value])=\)
2. \(f([value],[value])=\)
3. \(f([value],[value])=\)
Feedback: For the function \(f(x,y) = [value]\): 1. \(f([value],[value])= [value] = [value]\) 2. \(f([value],[value])=[value] = [value]\) 3. \(f([value],[value])=[value] = [value]\)

Exercise

Find the values of \(f([value],[value]), f([value],[value])\) and \(f([value],[value])\) for the function \[f(x,y) = [value].\]

1. \(f([value],[value])=\)
2. \(f([value],[value])=\)
3. \(f([value],[value])=\)
Feedback: For the function \(f(x,y) = [value]\): 1. \(f([value],[value])= [value]= [value]\) 2. \(f([value],[value])=[value] = [value]\) 3. \(f([value],[value])=[value] = [value]\)

In a similar way we can define a function of three independent variables. Let these variables be \(x,y\) and \(u\) and the function \(f(x,y,u)\).

Example

Given \(f(x,y,u)=x^2+yu+2\), find \(f(0,1,0),\ f(-1,-1,2)\).

Solution

\(f(0,1,0)=0^2+1\times 0+2=2\),  \( f(-1,-1,2)=1-2+2=1\)

Exercise

Given \(f(x,y,u) = [value]\), find the values of \(f([value],[value],[value]), \, f([value],[value],[value]).\)

1. \(f([value],[value],[value])=\)
2. \(f([value],[value], [value])=\)
Feedback: For the function \(f(x,y,u) = [value]\). 1. \(f([value],[value],[value] )= [value] = [value].\) 2. \(f([value],[value],[value])=[value] = [value].\)

Exercise

Find  \(f([value],[value],[value])\) for \(f(x,y,u) = [value]xy+[value]yu+[value] ux.\)

\(f([value],[value],[value])=\)
Feedback: For the function \(f(x,y,u) =[value]xy+[value]yu+[value] ux\): \(f([value],[value],[value] )= [value] = [value].\)

Exercise

Evaluate \(f(x,y,u,t) = [value]\) when: \(x=[value],\) \(y=[value],\) \(u=[value],\) \(t=[value].\)

\(f([value],[value],[value],[value])=\)
Feedback: For the function \(f(x,y,u,t) = [value]x^2 - [value]y^2 - [value]u^2 - [value]t.\) \(f([value],[value],[value], [value])= [value]= [value].\)

There are some special cases of note.

- \(\ B=C=0\quad A\ne 0.\) Here the plane is \(x=D/A\). This plane (for any given values of \(D\) and \(A\)) is parallel to the \(zy\) plane a distance \(D/A\) units from it. See Figure (a).

- \(A=0,\ C=0\quad B\ne 0.\) Here the plane is \(y=D/B\) and is parallel to the \(zx\) plane at a distance \(D/B\) units from it. See Figure (b).

- \(A=0,\ B=0\quad C\ne 0.\) Here the plane is \(z=D/C\) which is parallel to the \(xy\) plane a distance \(D/C\) units from it. See Figure (c).

[Image: Three planes parallel to the coordinate axes.]

Planes are particularly simple examples of surfaces. Generally, a surface is described by a relation connecting the three variables \(x,y,z\). In the case of the plane, this relation is linear \(Ax+By+Cz=D\). In some cases, as we have seen, one or two variables may be absent from the relation. In three dimensions such a relation still defines a surface, for example, \(z=0\) defines the plane of the \(x\)- and \(y\)-axes.

Although any relation connecting \(x,y,z\) defines a surface, by convention, one of the variables (usually \(z\)) is chosen as the dependent variable and the other two therefore are independent variables. For the case of a plane \(Ax+By+Cz=D\) (and \(C\neq 0\)) we would write, for example,

\(z=\dfrac{1}{C}(D-Ax-By).\)

Generally, a surface is defined by a relation of the form \(z=f(x,y)\) where the expression on the right is any relation involving two variables \(x,y\).

Sketching surfaces

A plane is relatively easy to sketch since it is flat all we need to know about it is where it intersects the three coordinate axes. For more general surfaces what we do is to sketch curves (like contours) which lie on the surface. If we draw enough of these curves our ‘eye’ will naturally interpret the shape of the surface.

Let us see, for example, how we sketch \(z=x^2+y^2\).

Firstly we confirm that \(z=x^2+y^2\) is a surface since this is a relation connecting the three coordinate variables \(x,y,z\). In the standard notation our function of two variables is \(f(x,y)= x^2+y^2\). To sketch the surface we fix one of the variables at a constant value.

\(\bullet\)   Fix \(x\) at value \(x_0\).

From our discussion above we remember that \(x=x_0\) is the equation of a plane parallel to the \(zy\) plane. In this case our relation becomes: \(z=x_0^2+y^2\).

Since \(z\) is now a function of a single variable \(y\), with \(x_0^2\) held constant, this relation: \(z=x_0^2+y^2\) defines a curve which lies in the plane \(x=x_0\).

In the first of the following Figures, we have drawn this curve (a parabola). Now by changing the value chosen for \(x_0\) we will obtain a sequence of curves, each a parabola, lying in a different plane, and each being a part of the surface we are trying to sketch. In the second Figure we have drawn some of the curves of this sequence.

[Image: Illustration of how to plot curves by fixing the value of one variable.]

What we have done is to slice the surface by planes parallel to the \(zy\) plane. Each slice intersects the surface in a curve. In this case we have not yet plotted enough curves to accurately visualise the surface so we need to draw other surface curves.

\(\bullet\)   Fix \(y\) at value \(y_0\)

Here \(y=y_0\) (the equation of a plane parallel to the \(zx\) plane.) In this case the surface becomes \(z=x^2+y_0^2\). Again \(z\) is a function of single variable (since \(y_0\) is fixed) and describes a curve: again the curve is a parabola, but this time residing on the plane \(y=y_0\). For each different \(y_0\) we choose a different parabola is obtained: each lying on the surface \(z=x^2+y^2\). Some of these curves have been sketched below. These have then combined with the curves in the previous Figure.

[Image: Plots of parabolas in the zx plane]

We now have an idea of what the surface defined by \(z=x^2+y^2\) looks like but to complete the picture we draw a final sequence of curves.

\(\bullet\)Fix \(z\) at value \(z_0\).

We have \(z=z_0\) (the equation of a plane parallel to the \(xy\) plane.) In this case the surface becomes \(z_0=x^2+y^2\)

But this is the equation of a circle centred on \(x=0\), \(y=0\) of radius \(\sqrt{z_0}\). (Clearly we must choose \(z_0\ge 0\) because \(x^2+y^2\) cannot be negative.) As we vary \(z_0\) we obtain different circles, each lying on a different plane \(z=z_0\). In the following Figure we have combined the circles with the curves of in the previous Figures to obtain a good visualisation of the surface \(z=x^2+y^2\).

[Image: Completed sketch showing a surface in cartesian coordinates.]

(Technically the surface is called a paraboloid, obtained by rotating a parabola about the \(z-\)axis.)

With the wide availability of sophisticated graphics packages the need to be able to sketch a surface is not as important as once it was. However, we urge the reader to attempt simple surface sketching in the initial stages of this study as it will enhance understanding of functions of two variables.