1 Approximations using partial derivatives

1.1 Functions of two variables

We saw in HELM booklet  16.5 how to expand a function of a single variable f ( x ) in a Taylor series:

f ( x ) = f ( x 0 ) + ( x x 0 ) f ( x 0 ) + ( x x 0 ) 2 2 ! f ( x 0 ) +

This can be written in the following alternative form (by replacing x x 0 by h so that x = x 0 + h ):

f ( x 0 + h ) = f ( x 0 ) + h f ( x 0 ) + h 2 2 ! f ( x 0 ) +

This expansion can be generalised to functions of two or more variables:

f ( x 0 + h , y 0 + k ) ≃ f ( x 0 , y 0 ) + h f x ( x 0 , y 0 ) + k f y ( x 0 , y 0 )

where, assuming h and k to be small, we have ignored higher-order terms involving powers of h and k . We define δ f to be the change in f ( x , y ) resulting from small changes to x 0 and y 0 , denoted by h and k respectively. Thus:

δ f = f ( x 0 + h , y 0 + k ) f ( x 0 , y 0 )

and so δ f ≃ h f x ( x 0 , y 0 ) + k f y ( x 0 , y 0 ) . Using the notation δ x and δ y instead of h and k for small increments in x and y respectively we may write

δ f ≃ δ x . f x ( x 0 , y 0 ) + δ y . f y ( x 0 , y 0 )

Finally, using the more common notation for partial derivatives, we write

δ f ≃ f x δ x + f y δ y .

Informally, the term δ f is referred to as the absolute error in f ( x , y ) resulting from errors δ x , δ y in the variables x and y respectively. Other measures of error are used. For example, the relative error in a variable f is defined as δ f f and the percentage relative error is δ f f × 100 .

Key Point 5

Measures of Error

If δ f is the change in f at ( x 0 , y 0 ) resulting from small changes h , k to x 0 and y 0 respectively, then δ f = f ( x 0 + h , y 0 + k ) f ( x 0 , y 0 ) , and

The absolute error in f is δ f .

The relative error in f is δ f f .

The percentage relative error in f is δ f f × 100 .

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 ) = x 2 + x 3 y

Solution

f x = 2 x + 3 x 2 y ; f y = x 3 .

Then δ f ≃ ( 2 x + 3 x 2 y ) δ x + x 3 δ y

Task!

Estimate the absolute error for f ( x , y ) = x 2 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.

First find f x and f y :

f x = 2 x y 2 + 1 , f y = 2 x 2 y + 1

Now obtain an expression for the absolute error:

δ f ≃ ( 2 x y 2 + 1 ) δ x + ( 2 x 2 y + 1 ) δ y

Now obtain the estimated value of the absolute error at the point of interest:

δ f ≃ ( 2 x y 2 + 1 ) δ x + ( 2 x 2 y + 1 ) δ y = ( 7 ) ( 0.1 ) + ( 5 ) ( 0.025 ) = 0.575 . Finally compare the estimate with the exact value:

The actual error is calculated from

δ f = f ( x 0 + δ x , y 0 + δ y ) f ( x 0 , y 0 ) = f ( 0.9 , 2.025 ) f ( 1 , 2 ) = 0.5534937 .

We see that there is a reasonably close correspondence between the two values.

1.2 Functions of three or more variables

If f is a function of several variables x , y , u , v , the error induced in f as a result of making small errors δ x , δ y , δ u , δ v in x , y , u , v , is found by a simple generalisation of the expression for two variables given above:

δ f ≃ f x δ x + f y δ y + f u δ u + f v δ v +

Example 13

Suppose that the area of triangle A B C is to be calculated by measuring two sides and the included angle. Call the sides b and c and the angle A .

Then the area S of the triangle is given by S = 1 2 b c sin A .

Now suppose that the side b is measured as 4.00 m, c as 3.00 m and A as 3 0 o . 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.0 1 o . Calculate the likely maximum error induced in S as a result of the errors in the sides and angle.

Solution

Here S is a function of three variables b , c , A . We calculate S = 1 2 × 4 × 3 × 1 2 = 3 m 2 .

Now S b = 1 2 c sin A , S c = 1 2 b sin A and S A = 1 2 b c cos A , so

δ S ≃ S b δ b + S c δ c + S A δ A = 1 2 c sin A δ b + 1 2 b sin A δ c + 1 2 b c cos A δ A .

Here δ b max = δ c max = 0.005 and δ A max = π 180 × 0.01 ( A must be measured in radians). Substituting these values we see that the maximum error in the calculated value of S is given by the approximation

δ S max ≃ 1 2 × 3 × 1 2 × 0.005 + 1 2 × 4 × 1 2 × 0.005 + 1 2 × 4 × 3 × 3 2 π 180 × 0.01 ≃ 0.0097 m 2

Hence the estimated value of S is in error by up to about ± 0.01 m 2 .