4 Methods for calculating gradient

Occasionally you may be faced with two different pairs of values or coordinates with which to determine the parameters of a linear function. Put another way, two pairs of values are needed to determine the two (unknown) parameters. Perhaps, unconsciously, you might have used this result already when carrying out the rain barrel task. The gradient, written as 1.5 20 in the answer, may be expressed also as 1.5 0 20 0 since the line connects the (time, level of water) coordinates (20, 1.5) with (0, 0). In general the gradient is given by

the change in the dependent variable the corresponding change in the independent variable

Once the gradient of the line has been calculated, it can be used with one of the known points to determine the intercept. If one of the points is (0, 0) the intercept is zero.

Suppose that a new type of automatic car is being road tested. The measuring team wants to know the maximum acceleration between 0 and 30 m s 1 . It plans to calculate this by assuming that it is constant and measuring the time taken from rest to achieve a speed of 30 m s 1 at maximum acceleration. In their first test the speedometer reading is 30 m s 1 after 12 s from start of timing and motion. We can think of these values in terms of (time, velocity) coordinates. At the start of timing the coordinates are ( 0 , 0 ) . When the speedometer reads 30 m s 1 the coordinates are ( 12 , 30 ) . If the acceleration is constant then its magnitude will be given by the gradient of the line joining these two points. Using the ‘change in variable idea’, the gradient is 30 0 12 0 = 2.5 , and so the magnitude of the acceleration is 2.5 m s 2 . The ’change in variable’ route to calculating the gradient is an abridged version of a more general method. The two pairs of coordinates may be used with the general equation of a line to work out the parameters of the particular line that passes through these two points. The assumption of constant acceleration leads to a linear relationship between the velocity ( v m s 1 ) and time ( t s) of the form v = a t + b where a and b are the parameters corresponding to gradient and intercept respectively. The road test gives v = 0 when t = 12. These may be substituted into the general form to give

0 = 0 + b and 30 = 12 a + b .

You may recognise that these are simultaneous equations. The first gives b = 0 which may be substituted into the second to give a = 2.5, corresponding to an acceleration of 2.5 m s 2 as before.

Suppose that the test team carry out a second test. In this test they note when speeds of 15 m s 1 and 27 m s 1 are reached and assume constant acceleration between these times and speeds. The speedometer reads 15 m s 1 , after 4 seconds from the start of motion and 27 m s 1 after 9 s from the start of motion. We apply the general method to the data from this test. The (time, velocity) coordinates corresponding to the readings are ( 4 , 15 ) and ( 9 , 27 ) . The equations resulting from substitutions in the general form are

15 = 4 a + b

27 = 9 a + b

We use the elimination method of solving these simultaneous equations ( HELM booklet  3). The first of these equations may be subtracted from the second to eliminate b .

27 15 = 9 a + b 4 a b

or

a = 2 . 4 .

The resulting value of a may be substituted into either of the equations expressing the data to calculate b . In the first, 15 = 4 × 2.5 + b , so b = 5. The resulting model is

v = 2.4 t + 5 ( 4 t 9 ) .

This model predicts an acceleration of 2.4 m s 2 , which is fairly close to the previous result of 2.5 m s 2 but if we try to use this model at t = 0, what do we predict? The model predicts that v = 5 when t = 0. This is not consistent with t = 0 being the time at which the vehicle starts to move! So, even if the acceleration is constant between 15 and 27 m s 1 , it does not have the same values between 0 m s 1 and 15 m s 1 as either between 15 m s 1 and 27 m s 1 and 30 m s 1 . A more general principle is illustrated by this example. It may be dangerous to use a model based on certain data at points other than those given by these data! The business of using a model outside the range of data for which is is known to be valid is called extrapolation . Use of the model between the data points on which it is based is called interpolation . So the general principle may also be stated as that it is very risky to extrapolate and it can be risky to interpolate . Nevertheless extrapolation or interpolation may be part of the purpose for a mathematical model in the first place.

The method of finding gradient and intercept just exemplified may be generalised. Suppose that we are specifying a linear function y = a x + b where the dependent variable is y and the independent variable is x . We represent two known points by ( p , q ) and ( r , s ) . The gradient, a , for the straight line, may be calculated either from p r q s or by substituting y = q when x = r in y = a x + b to obtain two simultaneous equations. Subtraction of these eliminates b and allows a to be calculated. The intercept of the line on the y-axis, b , may be found by substitution in y = a x + b , of either p , q and a or r , s and a .

Task!

Use the general method to deduce the different accelerations (assuming that they are constant) between the start of motion and 15 m s 1 and between velocities of 27 m s 1 and 30 m s 1 .

For the (time, velocity) coordinates ( 0 , 0 ) and ( 4 , 15 ) ,

0 = 0 a + b

15 = 4 a + b

From the first of these b = 0 and hence, in the second, a = 15 4 = 3 . 75 . So the acceleration up to 15 m s 1 is 3.756 m s 2 . For the (time, velocity) coordinates ( 9 , 27 ) and ( 12 , 30 ) ,

27 = 9 a + b

30 = 12 a + b

Subtracting the first from the second gives

3 = 3 a so  a = 1 ,

so the acceleration between 27 m s 1 and 30 m s 1 is 1 m s 2

Linear functions may be useful in economics. A lot of attention is paid to the way in which demand for a product varies with its price. A measure of demand is the number of items sold, if available, in a given period. For example, the purpose might be to determine the best price for a product given certain details about costs and with certain assumptions about the way the number of items sold per month varies with price. The price affects the profit and hence, in turn, the number manufactured in response to the demand. The number of items manufactured in a given period is known as the supply . Information about the variation of demand or supply with price may be obtained from market surveys. Constant functions are not appropriate in this context since both demand and supply vary with price. In the absence of other information the simplest way to model the variation of either demand or supply with price is to use a linear function.

Task!

When the price of a luxury consumer item is £ 1000 , a market survey reveals that the demand is 100,000 items per year. However another survey has shown that at a price of £ 600 , the demand for the item is 200,000 items per year. Assuming that both surveys are valid, find a linear function that relates demand Q to price P . What demand would be predicted by the linear function at a price of £ 750 ? Comment on the validity of both predictions.

The linear function will be of the form

Q = a P + b ( 600 P 1000 )

The limits on P represent the given range of data on price. Substituting the first pair of values of Q and P :

100000 = 100 a + b

Substituting the second pair of values:

200000 = 600 a + b

Subtracting the first expression from the second:

100000 = 400 a so a = 250

Note that the negative gradient is consistent with the fact that demand falls as price increases. Check that the ‘Change in variable’ definition for finding a works.

Change in dependent variable ( Q ) = 200000 100000 = 100000.

Corresponding change in independent variable ( P ) = 600 1000 = 400. The ratio of these changes is 100000 250 = 250

This value of a may be used with the first pair of values,

100000 = 250000 + b

so

b = 350000

and the linear function relating demand and price is

Q = 350000 250 P .

[A precautionary check is to make sure that this result is consistent with the other pairs of values. When P = 600 , Q = 350000 250 × 600 = 350000 150000 = 200000 , as required.] When P = 750:

Q = 350000 250 × 750 = 350000 187500 = 162500.

So a linear relationship between demand and the price for this luxury suggests a demand of 162500 items per year when the price per item is £ 750 . At a price of £ 500 , P = 500, and the model predicts that

Q = 250 × 500 + 350000 = 225000.

So the linear model suggests a demand of 225,000 items per year when the price per item is £ 500 . Such a price however is outside the range of given data. Consequently the corresponding demand prediction represents an extrapolation and this might not be reliable. On the other hand, the price of £ 750 lies within the given range of data and the corresponding demand prediction is an interpolation. If the given data points are close to each other then interpolation between these points is more reliable than extrapolation to points further away.