Tutor GradeResources Math Resources

# First Calculus - The Gradient Function

*The infinitesimal approach - not as scary as it sounds!*

**Date **: 2016-10-09

The text is designed to be quite clear, and if it is not at any point, do make enquires, and also, if you find yourself better than this, we can do much harder stuff, with which we can have so much fun...

There is a long pre-amble to try to make this accessible to a wider audience this should be useful in demonstrating how mathematics builds upon itself. (My apologies for not being able to make this more visually readable, I was given this programme to write in and it does not have everything...)

Firstly, the basics of functions (you do something to a value, and get a new value) before moving onto a more palpable derivation.

Consider a line graph:

This graph is of the form ` y = mx + c `

When x = 0, m*0 = 0,

and so y = m*0 +c = c

c is referred to as the y-intercept, as y takes this value when x = 0.

Likewise, we can find where the x-intercept lies by setting y equal to zero.

0 = mx + c

0 - c = mx + c - c

-c = mx

-c/m = mx/m

-c/m = x

This is hopefully just a demonstration of your understanding of algebra.

To find the `m` value - the gradient, or slope of the line, we can do this by taking two points.

In space, the shortest distance between two points is just by taking a straight line (want to know something scary? That is not always true. Try not to have too many restless nights about that).

If we know two points which are on the line, we take their co-ordinates (x_{1}, y_{1}) and (x_{2}, y_{2})

From here, taking the points (1,0) and (2,3)

we can construct a proportion: the proportion of change of the y and change in x co-ordinates. As the x (as the values for x are changed, because y is given by x and therefore depends on x, and not the other way around) co-ordinate or abscissa (just another term, a nicer word perhaps) changes, y does *at the same rate - *the effect this has is to give a constant proportion of change.

To demonstrate this, we can just use a table of values: Let y = 4x + 1

x 0 1 2 3 4 5

y 1 5 9 13 17 21

Now take the changes

(x_{2 }- x_{1}) (1-0) | (2-1) | (3-2) | (4-3) | (5-4) | (5-1)

(y_{2 }- y_{1}) (5-1) | (9-5) | (13-9) | (17-13) | (21-17) | (21-5)

(y_{2 }-y_{1}) / 4 4 4 4 4 4

(x_{2 }- x_{1})_{ }

The gradient is constant, and is equal to the `m` value for 4 from the given equation y = 4x + 1

This should hopefully convince you that you can find the gradient quite easily from but two co-ordinates - these we generated using the equation for the table, but if one has a graph, one can read off two points to find the gradient.

The y-intercept, c, has no influence on the gradient.

__Calculus__

Now, let us treat the function in a different way.

The change in y divided by the change in x is indeed a proportion, that is constant for a straight line graph - when it can be described by ` y = mx + c `

The proportion is given by the change in y, divided by the change in x. Look at the graph above, and the change in y is 3, and the change in x is one, giving a gradient of 3 the gradient is the number of y units risen by unit x.

This should all be familiar from G.C.S.E. Mathematics or equivalent, and the rules of calculus can be learnt in G.C.S.E. Further Mathematics and A-level.

We can start by considering the graph y = x^{2}, here, there is nothing to indicate the gradient.

Here, the graph is symmetrical about the line x = 0 (i.e. alone the line of points for y where x = 0, which is just the y - axis).

This is due to the fact that when one squares any number (forget about imaginary numbers for now - look up `i` if you are interested - or ask me to tell you more - it is very useful in lots of formulations) the result is positive - take a negative number, let it be `-a`.

When we square -a

(-a)(-a) = (-1)(a)(-1)(a) = (1)(a)(a) = a^{2}, which gives the same value for when a is just its positive value - therefore, there is a symmetry.

This is just the property of a quadratic function.

Now, to find the gradient, we mean to find the gradient *at a point *- this is for the reason that the gradient is evidently not a constant as with linear functions - the gradient is constantly changing as the value of x varies.

How it is we find the gradient, to draw a tangent. How do we draw tangents? Well, tangents are straight lines - these we have studied. If you are unsure of what a tangent is, it is just the local slope about a point. Draw a line along the slope at a point, to make it look like the gradient of the slope at that point, and you can call that the tangent.

From the drawn tangent, we can take two points from it, and find its gradient - we will call this the gradient of our, in this case, y = x ^{2 }at that point.

We can construct a tangent by taking two points very close together on the line of the graph, and if they are very close together, they will look like the tangent about one of the points taken.

Observe this: the straight green line, taking two points on the the function - the blue line, to approximate the gradient at the point x.

You can see from above, that the second point was taken as (x + h), that is, from the point x, the next point taken along was a distance `h` away. Here, x is not a point in particular, but an arbitrary point - it can be any point. The output from an `x` input is f(x), therefore, an output from an (x+h) input is f(x+h), where f(x) could be x^{2 }and therefore f(x+h) = (x + h)^{2 }.

Recall: (y_{2 }- y_{1}) / (x_{2} - x_{1}) = gradient of a straight line.

Where we are using the f(x) notation to be equivalent to y - it doesn`t much matter here.

To find the gradient at the point, say, 2 of the graph y = x^{2}, what we would want to do is the above, but make h as small a value as possible - because, when h is very close to the point 2, that means the gradient we calculate from the two points, looks very much like the gradient we get at 2. Look above, and see that as h gets closer to zero, the gradient at the *point *2.

So, we will proceed as before, with two x co-ordinates, 2, and 2 + h.

[ (2+h)^{2} - (2)^{2 }] = y_{2 }- y_{1} = (4 +4h +h^{2}) - (4) = 4h + h^{2}

[ (2+h) - (2) ] = x_{2 }- x_{1 }= h

(y_{2 }- y_{1})/(x_{2 }- x_{1}) = (4h + h^{2}) / h = 4 + h

Here, we have found a gradient at 2, but we do not know what `h` is - but the good thing is, we can let `h` become 0, because we get a much better gradient estimate when the two points we are taking are close together.

Therefore, the gradient of the graph y = x^{2} at the point 2, is 4.

If we repeat the same thing, but we substitute x for 2 - so that we can substitute a value in at any point: the result is 2x + h __> 2x

We can do the same thing for a function of any power of x and find its gradient: let y = x^{n}

Now, we can do the same thing to find the gradient:

(y_{2 }- y_{1})/(x_{2 }- x_{1}) = [ (x+h)^{n} - (x)^{n }] / [ (x^{n }+ h ) - (x^{n}) ]

Here, a binomial expansion will be used and will not be explained, but I can assure you of its truth if you have yet to see it - it can be derived without much difficulty.

The ellipsis means that there are more terms (different powers of x that exist) but will not be written explicitly (some series are infinite!).

= [ x^{n} + (h)(n)x^{n-1} + (n)(n-1)(h^{2})x^{n-1} + ... h^{n} - x^{n }] / h

= [ (h)(n)x^{n-1} + (n)(n-1)(h^{2})x^{n-1} + ... h^{n }] / h

= nx^{n-1 }+ n(n-1)(h)x^{n-1}+ ...

As h becomes zero, the other terms besides from the first, become zero. Therefore, the gradient at a point `x` on a function of x^{n} - where n is any number - is: nx^{n-1}

This itself is a function, and therefore, we have found a general gradient function for powers of a variable (something into which you can input a value - in this case, `x`). Quite useful indeed...

This is just the first step into differential calculus, and if you know the angle formulae for sine and cosine functions, you can derive their gradients - which we will can their (first) derivative, using the same method - finding the gradient between x and x+h, also, you will need to know the fact that when sine of a value is very small, it is approximately that value, and when cosine of a function is small, it is approximately 1.

Thank you for taking the time to read this far, and this is only a very brief (!) introduction, but there is plenty of fun to be had once you learn calculus - it has so very many applications and you can play with it yourself: I like setting up physics equations and solving them using it, and naturally, the great thing is you can test your equation by doing experiments! Safe, experiments, of course - ones with the fewest fatalities possible (although, some may be inevitable).

Do speak to me if you have any issues with what was discussed I hope you enjoyed it!

This resource was uploaded by: Japinder