HELM Workbook 18 Functions of Several Variables
HELM Workbook 18 Functions of Several Variables
HELM Workbook 18 Functions of Several Variables
Functions of
Several Variables
18.1 Functions of Several Variables 2
18.2 Partial Derivatives 8
18.3 Stationary Points 21
18.4 Errors and Percentage Change 30
Learning outcomes
In this Workbook you will learn about functions of two or more variables. You will learn that
a function of two variables can be interpreted as a surface. You will learn how to sketch
simple surfaces. You will learn what a partial derivative is and how the partial derivative
of any order may be found. As an important application of partial differentiation you will
learn how to locate the turning points of functions of several variables. In particular, for
functions of two variables, you will learn how to distinguish between maxima and minima
points. Finally you will apply your knowledge to the topic of error analysis.
Functions of
Introduction
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.
• understand the Cartesian coordinates (x, y, z)
Prerequisites of three-dimensional space.
Before starting this Section you should . . . • be able to sketch simple 2D curves
'
$
• understand the mathematical description of a
surface
Learning Outcomes • sketch simple surfaces
On completion you should be able to . . .
• use the notation for a function of several
variables
& %
2 HELM (2008):
Workbook 18: Functions of Several Variables
®
Task
Find the values of f (2, 1), f (−1, −3) and f (0, 0) for the following functions.
(a) f (x, y) = x2 + y 2 + 1 (b) f (x, y) = 2x + xy + y 3
Your solution
Answer
(a) f (2, 1) = 22 + 12 + 1 = 6; f (−1, −3) = (−1)2 + (−3)2 + 1 = 11; f (0, 0) = 1
(b) f (2, 1) = 4 + 2 + 1 = 7; f (−1, −3) = −2 + 3 − 27 = −26; f (0, 0) = 0
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 1
Given f (x, y, u) = x2 + yu + 2, find f (0, 1, 0), f (−1, −1, 2).
Solution
f (0, 1, 0) = 02 + 1 × 0 + 2 = 2; f (−1, −1, 2) = 1 − 2 + 2 = 1
Task
(a) Find f (2, −1, 1) for f (x, y, u) = xy + yu + ux.
(b) Evaluate f (x, y, u, t) = x2 − y 2 − u2 − 2t when x = 1, y = −2, u = 3, t = 1.
Your solution
HELM (2008): 3
Section 18.1: Functions of Several Variables
Answer
(a) f (2, −1, 1) = 2 × (−1) + (−1) × 1 + 1 × 2 = −1
(b) f (1, −2, 3, 1) = 12 − (−2)2 − 32 − 2 × 1 = −14 (this is a function of 4 independent variables).
c y
a
x b
Figure 1
Within this 3-dimensional space we can consider simple surfaces. Perhaps the simplest is the plane.
From 9.6 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
D D
, 0, 0 , intersects the y−axis (where x = z = 0) at the point 0, , 0 and the z−axis
A B
D
(where x = y = 0) at the point 0, 0, . See Figure 2 where the dotted lines are hidden from
C
view behind the plane which passes through three points marked on the axes.
D
C
D y
B
D
A
Figure 2
4 HELM (2008):
Workbook 18: Functions of Several Variables
®
• B = C = 0 A 6= 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 3a.
• A = 0, C = 0 B 6= 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 3b.
• A = 0, B = 0 C 6= 0
Here the plane is z = D/C which is parallel to the xy plane a distance D/C units from it.
See Figure 3c.
z z
z
D
C
D
B
y y y
D
A
Figure 3
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 6= 0) we would write, for example,
1
z= (D − Ax − By)
C
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.
HELM (2008): 5
Section 18.1: Functions of Several Variables
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 = x2 + y 2 .
Firstly we confirm that z = x2 +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) = x2 +y 2 . To sketch
the surface we fix one of the variables at a constant value.
• Fix x at value x0 .
From our discussion above we remember that x = x0 is the equation of a plane parallel to the zy
plane. In this case our relation becomes:
z = x20 + y 2
Since z is now a function of a single variable y, with x20 held constant, this relation: z = x20 + y 2
defines a curve which lies in the plane x = x0 .
In Figure 4(a) we have drawn this curve (a parabola). Now by changing the value chosen for x0
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 Figure 4(b) we have drawn some of the curves of this
sequence.
z z
y y
x0
x x
(a) (b)
Figure 4
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.
• Fix y at value y0
Here y = y0 (the equation of a plane parallel to the zx plane.) In this case the surface becomes
z = x2 + y02
Again z is a function of single variable (since y0 is fixed) and describes a curve: again the curve is
a parabola, but this time residing on the plane y = y0 . For each different y0 we choose a different
parabola is obtained: each lying on the surface z = x2 +y 2 . Some of these curves have been sketched
6 HELM (2008):
Workbook 18: Functions of Several Variables
®
in Figure 5(a). These have then combined with the curves of Figure 4(b) to produce Figure 5(b).
z
z
y y
x x
(a) (b)
Figure 5
We now have an idea of what the surface defined by z = x2 + y 2 looks like but to complete the
picture we draw a final sequence of curves.
• Fix z at value z0 .
We have z = z0 (the equation of a plane parallel to the xy plane.) In this case the surface becomes
z0 = x2 + y 2
√
But this is the equation of a circle centred on x = 0, y = 0 of radius z0 . (Clearly we must choose
z0 ≥ 0 because x2 + y 2 cannot be negative.) As we vary z0 we obtain different circles, each lying on
a different plane z = z0 . In Figure 6 we have combined the circles with the curves of Figure 5(b) to
obtain a good visualisation of the surface z = x2 + y 2 .
z z
y y
x x
Figure 6
(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.
HELM (2008): 7
Section 18.1: Functions of Several Variables
Introduction
When a function of more than one independent input variable changes because of changes in one or
more of the input variables, it is important to calculate the change in the function itself. This can
be investigated by holding all but one of the variables constant and finding the rate of change of the
function with respect to the one remaining variable. This process is called partial differentiation. In
this Section we show how to carry out the process.
8 HELM (2008):
Workbook 18: Functions of Several Variables
®
HELM (2008): 9
Section 18.2: Partial Derivatives
Key Point 1
Example 2
∂f
Find for (a) f (x, y) = x3 + x + y 2 + y, (b) f (x, y) = x2 y + xy 3 .
∂x
Solution
∂f ∂f
(a) = 3x2 + 1 + 0 + 0 = 3x2 + 1 (b) = 2x × y + 1 × y 3 = 2xy + y 3
∂x ∂x
Key Point 2
10 HELM (2008):
Workbook 18: Functions of Several Variables
®
Example 3
∂f
Find for (a) f (x, y) = x3 + x + y 2 + y (b) f (x, y) = x2 y + xy 3
∂y
Solution
∂f ∂f
(a) = 0 + 0 + 2y + 1 = 2y + 1 (b) = x2 × 1 + x × 3y 2 = x2 + 3xy 2
∂y ∂y
∂f
We can calculate the partial derivative of f with respect to x and the value of at a specific point
∂x
e.g. x = 1, y = −2.
Example 4
Find fx (1, −2) and fy (−3, 2) for f (x, y) = x2 + y 3 + 2xy.
∂f ∂f
[Remember fx means and fy means .]
∂x ∂y
Solution
fx (x, y) = 2x + 2y, so fx (1, −2) = 2 − 4 = −2; fy (x, y) = 3y 2 + 2x, so fy (−3, 2) = 12 − 6 = 6
Task
Given f (x, y) = 3x2 + 2y 2 + xy 3 find fx (1, −2) and fy (−1, −1).
∂f ∂f
First find expressions for and :
∂x ∂y
Your solution
∂f ∂f
= =
∂x ∂y
Answer
∂f ∂f
= 6x + y 3 , = 4y + 3xy 2
∂x ∂y
HELM (2008): 11
Section 18.2: Partial Derivatives
Now calculate fx (1, −2) and fy (−1, −1):
Your solution
fx (1, −2) = fy (−1, −1) =
Answer
fx (1, −2) = 6 × 1 + (−2)3 = −2; fy (−1, −1) = 4 × (−1) + 3(−1) × 1 = −7
Key Point 3
x, y , u , v , w , . . . )
The Partial Derivatives of f (x
For a function of several variables z = f (x, y, u, v, w, . . . ) the partial derivative of f with respect
∂f
to v (say) is denoted by and is obtained by differentiating f (x, y, u, v, w, . . . ) with respect to
∂v
v in the usual way but treating all the other variables as if they were constants.
∂f ∂z
Alternative notations for when z = f (x, y, u, v, w, . . . ) are fv (x, y, u, v, w . . . ) and fv and .
∂v ∂v
Task
∂f ∂f
Find and for f (x, y, u, v) = x2 + xy 2 + y 2 u3 − 7uv 4
∂x ∂u
Your solution
∂f ∂f
= =
∂x ∂u
Answer
∂f ∂f
= 2x + y 2 + 0 + 0 = 2x + y 2 ; = 0 + 0 + y 2 × 3u2 − 7v 4 = 3y 2 u2 − 7v 4 .
∂x ∂u
12 HELM (2008):
Workbook 18: Functions of Several Variables
®
Task
The pressure, P , for one mole of an ideal gas is related to its absolute temperature,
T , and specific volume, v, by the equation
P v = RT
where R is the gas constant.
Obtain simple expressions for
Your solution
(a)
Answer
RT ∂v R
v= ⇒ =
P ∂T P P
1 ∂v R 1
so α= = =
v ∂T P Pv T
Your solution
(b)
Answer
RT ∂v RT
v= ⇒ =− 2
P ∂P T P
1 ∂v RT 1
so κT = − = 2
=
v ∂P T vP P
HELM (2008): 13
Section 18.2: Partial Derivatives
Exercises
∂f ∂f
1. For the following functions find and
∂x ∂y
(a) f (x, y) = x + 2y + 3
(b) f (x, y) = x2 + y 2
(c) f (x, y) = x3 + xy + y 3
(d) f (x, y) = x4 + xy 3 + 2x3 y 2
(e) f (x, y, z) = xy + yz
2. For the functions of Exercise 1 (a) to (d) find fx (1, 1), fx (−1, −1), fy (1, 2), fy (2, 1).
Answers
∂f ∂f
1. (a) = 1, =2
∂x ∂y
∂f ∂f
(b) = 2x, = 2y
∂x ∂y
∂f ∂f
(c) = 3x2 + y, = x + 3y 2
∂x ∂y
∂f ∂f
(d) = 4x3 + y 3 + 6x2 y 2 , = 3xy 2 + 4x3 y
∂x ∂y
∂f ∂f
(e) = y, =x+z
∂x ∂y
2.
fx (1, 1) fx (−1, −1) fy (1, 2) fy (2, 1)
(a) 1 1 2 2
(b) 2 −2 4 2
(c) 4 2 13 5
(d) 11 1 20 38
14 HELM (2008):
Workbook 18: Functions of Several Variables
®
Example 5
∂2f ∂2f
Find and for f (x, y) = x3 + x2 y 2 + 2y 3 + 2x + y.
∂x2 ∂y 2
Solution
∂f
= 3x2 + 2xy 2 + 0 + 2 + 0 = 3x2 + 2xy 2 + 2
∂x
∂2f
∂ ∂f
≡ = 6x + 2y 2 + 0 = 6x + 2y 2 .
∂x2 ∂x ∂x
∂f
= 0 + x2 × 2y + 6y 2 + 0 + 1 = 2x2 y + 6y 2 + 1
∂y
∂2f
∂ ∂f
= = 2x2 + 12y.
∂y 2 ∂y ∂y
Example 6
Find fxx (−1, 1) and fyy (2, −2) for f (x, y) = x3 + x2 y 2 + 2y 3 + 2x + y.
Solution
fxx (−1, 1) = 6 × (−1) + 2 × (−1)2 = −4.
fyy (2, −2) = 2 × (2)2 + 12 × (−2) = −16
HELM (2008): 15
Section 18.2: Partial Derivatives
Mixed second derivatives
It is possible to carry out a partial differentiation of f (x, y) with respect to x followed by a partial
differentiation with respect to y (or vice-versa). The results are examples of mixed derivatives. We
must be careful with the notation here.
∂2f
We use to mean ‘differentiate first with respect to y and then with respect to x’ and we use
∂x∂y
∂2f
to mean ‘differentiate first with respect to x and then with respect to y’:
∂y∂x
∂2f ∂2f
∂ ∂f ∂ ∂f
i.e. ≡ and ≡ .
∂x∂y ∂x ∂y ∂y∂x ∂y ∂x
(This explains why the order is opposite of what we expect - the derivative ‘operates on the left’.)
Example 7
∂2f
For f (x, y) = x3 + 2x2 y 2 + y 3 find .
∂x∂y
Solution
∂f ∂2f
= 4x2 y + 3y 2 ; = 8xy
∂y ∂x∂y
Theremaining
possibility is to differentiate first with respect to x and then with respect to y i.e.
∂ ∂f
.
∂y ∂x
∂f ∂2f
For the function in Example 7 = 3x2 + 4xy 2 and = 8xy. Notice that for this function
∂x ∂y∂x
∂2f ∂2f
≡ .
∂x∂y ∂y∂x
This equality of mixed derivatives is true for all functions which you are likely to meet in your studies.
∂2f
To evaluate a mixed derivative we can use the alternative notation. To evaluate we write
∂x∂y
∂2f
fyx (x, y) to indicate that the first differentiation is with respect to y. Similarly, is denoted by
∂y∂x
fxy (x, y).
16 HELM (2008):
Workbook 18: Functions of Several Variables
®
Example 8
Find fyx (1, 2) for the function f (x, y) = x3 + 2x2 y 2 + y 3
Solution
Task
Find fxx (1, 2), fyy (−2, −1), fxy (3, 3) for f (x, y) ≡ x3 + 3x2 y 2 + y 2 .
Your solution
Answer
fx = 3x2 + 6xy 2 ; fy = 6x2 y + 2y
fxx = 6x + 6y 2 ; fyy = 6x2 + 2; fxy = fyx = 12xy
fxx (1, 2) = 6 + 24 = 30; fyy (−2, −1) = 26; fxy (3, 3) = 108
HELM (2008): 17
Section 18.2: Partial Derivatives
Engineering Example 1
Introduction
In Chemical Engineering it is often necessary to be able to equate the pressure, volume and temper-
ature of a gas. One relevant equation is the ideal gas law
P V = nR T (1)
where P is pressure, V is volume, n is the number of moles of gas, T is temperature and R is the
ideal gas constant (= 8.314 J mol−1 K−1 , when all quantities are in S.I. units). The ideal gas law
has been in use since 1834, although its special cases at constant temperature (Boyle’s Law, 1662)
and constant pressure (Charles’ Law, 1787) had been in use many decades previously.
While the ideal gas law is adequate in many circumstances, it has been superseded by many other
laws where, in general, simplicity is weighed against accuracy. One such law is the Redlich-Kwong
equation
RT a
P = − √ (2)
V −b T V (V + b)
where, in addition to the variables in the ideal gas law, the extra parameters a and b are dependent
upon the particular gas under consideration.
Clearly, in both equations the temperature, pressure and volume will be positive. Additionally, the
Redlich-Kwong equation is only valid for values of volume greater than the parameter b - in practice
however, this is not a limitation, since the gas would condense to a liquid before this point was
reached.
Problem in words
Show that for both Equations (1) and (2)
(a) for constant temperature, the pressure decreases as the volume increases
(b) for constant volume, the pressure increases as the temperature increases.
18 HELM (2008):
Workbook 18: Functions of Several Variables
®
Mathematical analysis
nR T
P =
V
so that
2. Redlich-Kwong equation
RT a
P = − √
V −b T V (V + b)
= R T (V − b) − a T −1/2 (V 2 + V b)−1
−1
so that
Interpretation
∂P
In practice, the restriction on T is not severe, and regions in which < 0 does not apply are those
∂V
in which the gas is close to liquefying and, therefore, the entire Redlich-Kwong equation no longer
applies.
HELM (2008): 19
Section 18.2: Partial Derivatives
Exercises
∂2f ∂2f ∂2f ∂2f
1. For the following functions find , , , .
∂x2 ∂y 2 ∂x∂y ∂y∂x
(a) f (x, y) = x + 2y + 3
(b) f (x, y) = x2 + y 2
(c) f (x, y) = x3 + xy + y 3
(d) f (x, y) = x4 + xy 3 + 2x3 y 2
(e) f (x, y, z) = xy + yz
2. For the functions of Exercise 1 (a) to (d) find fxx (1, −3), fyy (−2, −2), fxy (−1, 1).
∂f ∂2f
3. For the following functions find and
∂x ∂x∂t
(a) f (x, t) = x sin(tx) + x2 t (b) f (x, t, z) = zxt − ext (c) f (x, t) = 3 cos(t + x2 )
Answers
∂2f ∂2f ∂2f ∂2f
1. (a) = 0 = = =
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(b) = 2 = ; = =0
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(c) = 6x, = 6y; = = 1.
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f 2 2 ∂2f 3 ∂2f ∂2f
(d) = 12x + 12xy , = 6xy + 4x , = = 3y 2 + 12x2 y
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂2f ∂2f ∂2f ∂2f
(e) = = 0; = =1
∂x2 ∂y 2 ∂x∂y ∂y∂x
∂f ∂2f ∂2f
3. (a) = sin(tx) + xt cos(tx) + 2xt = = 2x cos(tx) − x2 t sin(tx) + 2x
∂x ∂t∂x ∂x∂t
∂f ∂2f ∂2f
(b) = zt − text = = z − ext − txext
∂x ∂t∂x ∂x∂t
∂f 2 ∂2f ∂2f
(c) = −6x sin(t + x ) = = −6x cos(t + x2 )
∂x ∂t∂x ∂x∂t
20 HELM (2008):
Workbook 18: Functions of Several Variables
®
Introduction
The calculation of the optimum value of a function of two variables is a common requirement in many
areas of engineering, for example in thermodynamics. Unlike the case of a function of one variable
we have to use more complicated criteria to distinguish between the various types of stationary point.
• understand the idea of a function of two
Prerequisites variables
Before starting this Section you should . . . • be able to work out partial derivatives
'
$
• identify local maximum points, local
minimum points and saddle points on the
surface z = f (x, y)
Learning Outcomes • use first partial derivatives to locate the
On completion you should be able to . . . stationary points of a function f (x, y)
HELM (2008): 21
Section 18.3: Stationary Points
1. The stationary points of a function of two variables
Figure 7 shows a computer generated picture of the surface defined by the function
z = x3 + y 3 − 3x − 3y, where both x and y take values in the interval [−1.8, 1.8].
4
z C
3
D
2
A
1
-1
-2
-3
-4
B
2
1 2
x y 1
0
0
-1
-1
-2 -2
Figure 7
There are four features of particular interest on the surface. At point A there is a local maximum,
at B there is a local minimum, and at C and D there are what are known as saddle points.
At A the surface is at its greatest height in the immediate neighbourhood. If we move on the surface
from A we immediately lose height no matter in which direction we travel. At B the surface is at its
least height in the neighbourhood. If we move on the surface from B we immediately gain height,
no matter in which direction we travel.
The features at C and D are quite different. In some directions as we move away from these points
along the surface we lose height whilst in others we gain height. The similarity in shape to a horse’s
saddle is evident.
At each point P of a smooth surface one can draw a unique plane which touches the surface there.
This plane is called the tangent plane at P . (The tangent plane is a natural generalisation of
the tangent line which can be drawn at each point of a smooth curve.) In Figure 7 at each of
the points A, B, C, D the tangent plane to the surface is horizontal at the point of interest. Such
points are thus known as stationary points of the function. In the next subsections we show how to
locate stationary points and how to determine their nature using partial differentiation of the function
f (x, y),
22 HELM (2008):
Workbook 18: Functions of Several Variables
®
Task
In Figures 8 and 9 what are the features at A and B?
-4
A
-5
-6
-7
-8
-9
-10
-11
-12
5
4.5
4
B 1.5
1
3.5 0.5
3 0
-0.5
2.5 -1
2 -1.5
Figure 8
10 A
8
2
B
0
-2
-4
-6
-8
5
4
2
3
1
2
1 0
0 -1
-1 -2
Figure 9
Your solution
HELM (2008): 23
Section 18.3: Stationary Points
Answer
Figure 8 A is a saddle point, B is a local minimum.
Figure 9 A is a local maximum, B is a saddle point.
Task
Verify that (0, 2) is a stationary point of the function f (x, y) = 8x2 +6y 2 −2y 3 +5
and find the stationary value f (0, 2).
Answer
fx = 16x ; fy = 12y − 6y 2
Now find the values of these partial derivatives at x = 0, y = 2:
Your solution
Answer
fx = 0 , fy = 24 − 24 = 0
Hence (0, 2) is a stationary point.
The stationary value is f (0, 2) = 0 + 24 − 16 + 5 = 13
Example 9
Find a second stationary point of f (x, y) = 8x2 + 6y 2 − 2y 3 + 5.
Solution
fx = 16x and fy ≡ 6y(2 − y). From this we note that fx = 0 when x = 0, and fx = 0 and when
y = 0, so x = 0, y = 0 i.e. (0, 0) is a second stationary point of the function.
It is important when solving the simultaneous equations fx = 0 and fy = 0 to find stationary points
not to miss any solutions. A useful tip is to factorise the left-hand sides and consider systematically
all the possibilities.
24 HELM (2008):
Workbook 18: Functions of Several Variables
®
Example 10
Locate the stationary points of
f (x, y) = x4 + y 4 − 36xy
Solution
First we write down the partial derivatives of f (x, y)
∂f ∂f
= 4x3 − 36y = 4(x3 − 9y) = 4y 3 − 36x = 4(y 3 − 9x)
∂x ∂y
∂f ∂f
Now we solve the equations = 0 and = 0:
∂x ∂y
x3 − 9y = 0 (i)
y 3 − 9x = 0 (ii)
y3
From (ii) we obtain: x = (iii)
9
Now substitute from (iii) into (i)
y9
− 9y = 0
93
⇒ y 9 − 94 y = 0
⇒ y(y 8 − 38 ) = 0 (removing the common factor)
⇒ y(y 4 − 34 )(y 4 + 34 ) = 0 (using the difference of two squares)
We therefore obtain, as the only solutions:
y = 0 or y 4 − 34 = 0 (since y 4 + 34 is never zero)
The last equation implies:
(y 2 − 9)(y 2 + 9) = 0 (using the difference of two squares)
∴ y 2 = 9 and y = ± 3.
Task
Locate the stationary points of
f (x, y) = x3 + y 2 − 3x − 6y − 1.
HELM (2008): 25
Section 18.3: Stationary Points
Answer
∂f ∂f
= 3x2 − 3, = 2y − 6
∂x ∂y
∂f ∂f
Now solve simultaneously the equations = 0 and = 0:
∂x ∂y
Your solution
Answer
3x2 − 3 = 0 and 2y − 6 = 0.
Hence x2 = 1 and y = 3, giving stationary points at (1, 3) and (−1, 3).
Key Point 4
Test to Determine the Nature of Stationary Points
1. At each stationary point work out the three second order partial derivatives.
26 HELM (2008):
Workbook 18: Functions of Several Variables
®
Example 11
The function: f (x, y) = x4 + y 4 − 36xy has stationary points at
(0, 0), (−3, −3), (3, 3). Use Key Point 4 to determine the nature of each sta-
tionary point.
Solution
∂f ∂f
We have = fx = 4x3 − 36y and = fy = 4y 3 − 36x.
∂x ∂y
∂2f 2 ∂ f
2
2 ∂2f
Then = f xx = 12x , = f yy = 12y , = fyx = −36.
∂x2 ∂y 2 ∂x∂y
A tabular presentation is useful for calculating D = fxx fyy − (fxy )2 :
(0, 0) is a saddle point; (−3, −3) and (3, 3) are both local minima.
Task
Determine the nature of the stationary points of f (x, y) = x3 + y 2 − 3x − 6y − 1,
which are (1, 3) and (1, −3).
Answer
fxx = 6x, fyy = 2, fxy = 0.
HELM (2008): 27
Section 18.3: Stationary Points
Now complete the table below and determine the nature of the stationary points:
Your solution
Point Point
Derivatives (1, 3) (−1, 3)
fxx
fyy
fxy
Answer
Point Point
Derivatives (1, 3) (−1, 3)
fxx 6 −6
fyy 2 2
fxy 0 0
D >0 <0
Answer
(1, 3) is a local minimum; (−1, 3) is a saddle point.
28 HELM (2008):
Workbook 18: Functions of Several Variables
®
For most functions the procedures described above enable us to distinguish between the various types
of stationary point. However, note the following example, in which these procedures fail.
Given f (x, y) = x4 + y 4 + 2x2 y 2 .
∂f ∂f
= 4x3 + 4xy 2 , = 4y 3 + 4x2 y,
∂x ∂y
Exercises
Determine the nature of the stationary points of the function in each case:
1. f (x, y) = 8x2 + 6y 2 − 2y 3 + 5
3. f (x, y) = 4 − x2 − xy − y 2
Answers
HELM (2008): 29
Section 18.3: Stationary Points
Errors and
Introduction
When one variable is related to several others by a functional relationship it is possible to estimate
the percentage change in that variable caused by given percentage changes in the other variables.
For example, if the values of the input variables of a function are measured and the measurements
are in error, due to limits on the precision of measurement, then we can use partial differentiation to
estimate the effect that these errors have on the forecast value of the output.
30 HELM (2008):
Workbook 18: Functions of Several Variables
®
Key Point 5
Measures of Error
If δf is the change in f at (x0 , y0 ) resulting from small changes h, k to x0 and y0 respectively, then
δf = f (x0 + h, y0 + k) − f (x0 , y0 ), and
The absolute error in f is δf.
δf
The relative error in f is .
f
δf
The percentage relative error in f is × 100.
f
HELM (2008): 31
Section 18.4: Errors and Percentage Change
Note that to determine the error numerically we need to know not only the actual values of δx and
δy but also the values of x and y at the point of interest.
Example 12
Estimate the absolute error for the function f (x, y) = x2 + x3 y
Solution
fx = 2x + 3x2 y; fy = x3 .
Then δf ' (2x + 3x2 y)δx + x3 δy
Task
Estimate the absolute error for f (x, y) = x2 y 2 + x + y at the point (−1, 2) if
δx = 0.1 and δy = 0.025. Compare the estimate with the exact value of the error.
Answer
fx = 2xy 2 + 1, fy = 2x2 y + 1
Answer
δf ' (2xy 2 + 1)δx + (2x2 y + 1)δy
Now obtain the estimated value of the absolute error at the point of interest:
Your solution
Answer
δf ' (2xy 2 + 1)δx + (2x2 y + 1)δy = (−7)(0.1) + (5)(0.025) = −0.575.
Finally compare the estimate with the exact value:
Your solution
32 HELM (2008):
Workbook 18: Functions of Several Variables
®
Answer
The actual error is calculated from
δf = f (x0 + δx, y0 + δy) − f (x0 , y0 ) = f (−0.9, 2.025) − f (−1, 2) = −0.5534937.
We see that there is a reasonably close correspondence between the two values.
Example 13
Suppose that the area of triangle ABC is to be calculated by measuring two sides
and the included angle. Call the sides b and c and the angle A.
1
Then the area S of the triangle is given by S = bc sin A.
2
Now suppose that the side b is measured as 4.00 m, c as 3.00 m and A as 30o .
Suppose also that the measurements of the sides could be in error by as much
as ± 0.005 m and of the angle by ± 0.01o . Calculate the likely maximum error
induced in S as a result of the errors in the sides and angle.
Solution
1 1
Here S is a function of three variables b, c, A. We calculate S= × 4 × 3 × = 3 m2 .
2 2
∂S 1 ∂S 1 ∂S 1
Now = c sin A, = b sin A and = bc cos A, so
∂b 2 ∂c 2 ∂A 2
∂S ∂S ∂S 1 1 1
δS ' δb + δc + δA = c sin A δb + b sin A δc + bc cos A δA.
∂b ∂c ∂A 2 2 2
π
Here |δb|max = |δc|max = 0.005 and |δA|max = × 0.01 (A must be measured in radians).
180
Substituting these values we see that the maximum error in the calculated value of S is given by
the approximation
√ !
1 1 1 1 1 3 π
|δS|max ' ×3× × 0.005 + ×4× × 0.005 + ×4×3× × 0.01
2 2 2 2 2 2 180
' 0.0097 m2
HELM (2008): 33
Section 18.4: Errors and Percentage Change
Engineering Example 2
The height h of a building is estimated from (i) the known horizontal distance x between the point of
observation M and the foot of the building and (ii) the elevation angle θ between the horizontal and
the line joining the point of observation to the top of the building (see Figure 10). If the measured
horizontal distance is x = 150 m and the elevation angle is θ = 40◦ , estimate the error in measured
building height due to an error of 0.1◦ degree in the measurement of the angle of elevation.
M θ
x
34 HELM (2008):
Workbook 18: Functions of Several Variables
®
Task
Estimate the maximum error in f (x, y) = x2 + y 2 + xy at the point x = 2, y = 3
if maximum errors ± 0.01 and ± 0.02 are made in x and y respectively.
∂f ∂f
First find and :
∂x ∂y
Your solution
∂f ∂f
= =
∂x ∂y
Answer
∂f ∂f
= 2x + y; = 2y + x.
∂x ∂y
Answer
f (2, 3) = 22 + 32 + 2 × 3 = 19.
Now since the error in the measured value of x is ± 0.01 and in y is ± 0.02 we have
|δx|max = 0.01, |δy|max = 0.02. Write down an expression to approximate to |δf |max :
Your solution
Answer
|δf |max ' |(2x + y)| |δx|max + |(2y + x)| |δy|max
Calculate |δf |max at the point x = 2, y = 3 and give bounds for f (2, 3):
Your solution
Answer
Hence we quote f (2, 3) = 19 ± 0.23, which can be expressed as 18.77 ≤ f (2, 3) ≤ 19.23
HELM (2008): 35
Section 18.4: Errors and Percentage Change
2. Relative error and percentage relative error
Two other measures of error can be obtained from a knowledge of the expression for the absolute error.
δf δf
As mentioned earlier, the relative error in f is and the percentage relative error is × 100 %.
f f
Suppose that f (x, y) = x2 + y 2 + xy then
∂f ∂f
δf ' δx + δy
∂x ∂y
The actual value of the relative error can be obtained if the actual errors of the independent variables
are known and the values of x and y at the point of interest. In the special case where the function
is a combination of powers of the input variables then there is a short cut to finding the relative error
x2 y 4
in the value of the function. For example, if f (x, y, u) = 3 then
u
∂f 2xy 4 ∂f 4x2 y 3 ∂f 3x2 y 4
= 3 , = , =− 4
∂x u ∂y u3 ∂u u
Hence
2xy 4 4x2 y 3 3x2 y 4
δf ' δx + δy − δu
u3 u3 u4
Finally,
δf 2xy 4 u3 4x2 y 3 u3 3x2 y 4 u3
' 3 × 2 4 δx + × δy − × δu
f u xy u3 x2 y 4 u4 x2 y 4
Cancelling down the fractions,
δf δx δy δu
'2 +4 −3 (1)
f x y u
so that
rel. error in f ' 2× (rel. error in x) + 4× (rel. error in y) − 3× (rel. error in u).
Note that if we write
f (x, y, u) = x2 y 4 u−3
we see that the coefficients of the relative errors on the right-hand side of (1) are the powers of the
appropriate variable.
To find the percentage relative error we simply multiply the relative error by 100.
36 HELM (2008):
Workbook 18: Functions of Several Variables
®
Task
x3 y
If f = and x, y, u are subject to percentage relative errors of 1%, −1% and
u2
2% respectively find the approximate percentage relative error in f .
∂f ∂f ∂f
First find , and :
∂x ∂y ∂u
Your solution
∂f ∂f ∂f
= = =
∂x ∂y ∂u
Answer
∂f 3x2 y ∂f x3 ∂f 2x3 y
= 2 , = 2, =− 3 .
∂x u ∂y u ∂u u
Answer
3x2 y x3 2x3 y
δf ' 2 δx + 2 δy − 3 δu
u u u
Hence write down an expression for the percentage relative error in f :
Your solution
Answer
δf 3x2 y u2 x3 u2 2x3 y u2
× 100 ' 2 × 3 δx × 100 + 2 × 3 δy × 100 − 3 × 3 δu × 100
f u xy u xy u xy
Your solution
Answer
δf δx δy δu
× 100 ' 3 × 100 + × 100 − 2 × 100
f x y u
HELM (2008): 37
Section 18.4: Errors and Percentage Change
Engineering Example 3
Introduction
The power required by an electrical circuit depends upon its components. However, the specification
of the rating of the individual components is subject to some uncertainity. This Example concerns
the calculation of the error in the power required by a circuit shown in Figure 11 given a formula for
the power, the values of the individual components and the percentage errors in them.
Problem in words
The power delivered to the load resistance RL for the circuit shown in Figure 11 is given by
25RL
P =
(R + RL )2
2000Ω
RL
38 HELM (2008):
Workbook 18: Functions of Several Variables
®
P
= 25(R + RL )−2 − 50RL (R + RL )−3
RL
P −50 50
So (2000, 1000) = −50(1000)(3000)−3 = 2
= − × 10−6
R 1000 × 27 27
P 25 50
(2000, 1000) = 25(3000)−2 − 50(1000)(3000)−3 = − × 10−6
RL 9 27
75 − 50 25
= × 10−6 = × 10−6
27 27
P P
Substituting these values into |δP |max ≈ |δR|max + |δRL |max we get:
R RL
50 25 5000 25 × 50
|δP |max = × 10−6 × 100 + × 10−6 × 50 = + × 10−6 ≈ 2.315 × 10−4
27 27 27 27
Interpretation
At R = 2000 and RL = 1000, P will be 2.77 × 10−3 W and, assuming 5% errors in the values of the
resistors, then the error in P ≈ ±2.315 × 10−4 W. This represents about 8.4% error. So the error in
the power is greater than that in the individual components.
Exercises
1. The sides of a right-angled triangle enclosing the right-angle are measured as 6 m and 8 m. The
maximum errors in each measurement are ± 0.1m. Find the maximum error in the calculated
area.
2. In Exercise 1, the angle opposite the 8 m side is calculated from tan θ = 8/6 as θ = 53◦ 80 .
Calculate the approximate maximum error in that angle.
r
3x
3. If v = find the maximum percentage error in v due to errors of 1% in x and 3% in y.
y
r
1 E
4. If n = and L, E and d can be measured correct to within 1%, how accurate is the
2L d
calculated value of n?
1 2
5. The area of a segment of a circle which subtends an angle θ is given by A = r (θ − sin θ).
2
The radius r is measured with a percentage error of +0.2% and θ is measured as 450 with an
error of = +0.1◦ . Find the percentage error in the calculated area.
HELM (2008): 39
Section 18.4: Errors and Percentage Change
Answers
1 ∂A ∂A y x
1. A = xy δA ≈ δx + δy δA ≈ δx + δy
2 ∂x ∂y 2 2
y ∂θ ∂θ y x
2. θ = tan−1 so δθ = δx + δy = − 2 2
δx + 2 δy
x ∂x ∂y x +y x + y2
−8 6
Maximum error in θ is (0.1) + 2 (0.1) = 0.014 rad. This is 0.80 .
62 +8 2 6 + 82
1 1 1 δv δx δy
3. Take logarithms of both sides: ln v = ln 3 + ln x − ln y so ≈ −
2 2 2 v 2x 2y
δx δy 1 3
Maximum percentage error in v = + − = % + % = 2%.
2x 2y 2 2
4. Take logarithms of both sides:
1 1 δn δL δE δd
ln n = − ln 2 − ln L + ln E − ln d so =− + −
2 2 n L 2E 2d
δL δE δd 1 1
Maximum percentage error in n = − + + − = 1% + % + % = 2%.
L 2E 2d 2 2
1 δA 2δr 1 − cos θ
5. A = r2 (θ − sin θ) so = + δθ
2 A r θ − sin θ
1
1− √
δA 2
π
= 2(0.2)% + × 100% = (0.4 + 0.65)% = 1.05%
A π 1 1800
−√
4 2
40 HELM (2008):
Workbook 18: Functions of Several Variables