Welcome to NRICH.

 
The Gradient Function: beginner calculus


This is one of two threads introducing calculus. The other is here. If you are a beginner at calculus, please let the editor know which you think is most clear.
By James Hicks (P1850) on Saturday, January 8, 2000 - 05:12 pm:

Hi,

I'm in my first year of GCSE maths. I'm doing the higher level, and we are doing our first coursework project. we're doing the Gradient function.

I've worked out a formula: gradient = nxn-1

I wanted to know a little more. Why does the formula work, and how does it work?

Any info on this would be most helpful!

James


By The Editor:

Please note that in GCSE coursework you are required to declare any help you have had from outside sources. This will not necessarily affect your mark.
In this case, what is being explained is beyond GCSE level, and James is likely to gain credit if he can show in his write-up that he understands it. Attaching a printout of the thread would be the best way of showing what help has been given.

If you want to learn more about calculus, the book "Teach Yourself Calculus" has been recommended elsewhere on AskNRICH.


By Alastair Fletcher (Anf23) on Saturday, January 8, 2000 - 06:05 pm:

Hi James,

What you've touched upon here with a gradient function is what's called differentiation. This comes under calculus which, I believe, is A-Level stuff, but nevertheless, I'll try and explain a bit about it.

I think the function you're starting out with is f(x)=xn. (I hope you're OK with the notation - you'll more usually have seen this written as y=xn, but f(x) just means a function in terms of x)

Have a look at the picture which (hopefully) should be below.

graph

You should be able to convince yourself that the gradient of the chord (in red) will be the gradient of the function as h tends to zero (ie. gets smaller).

The gradient of the chord is easy to work out - it is
f(x+h) - f(x)
-------------
(x+h) - x

= ( f(x+h) - f(x) )/h

So the gradient of the function at x should be the limit as h tends to zero of
( f(x+h) - f(x) )/h

In your case, f(x) = xn, so f(x+h) = (x+h)n.

So, the gradient is limit as h tends to zero of

((x+h)n - xn)/h

=(xn(1+(h/x))n - xn)/h by pulling an xn outside of (x+h)n

=xn((1+(h/x))n - 1)/h

=xn(1 + n(h/x) + n(n-1)h2/2x2 + (other terms in h) -1)/h
by the Binomial Theorem, which you may not have done, so you might have to take this step on trust (although I can try and explain it if you would like me to)

So now, by combining all the terms, we get
nxn-1 + n(n-1)h × xn-2/2 + other terms with h in.

So the limit as h tends to zero is just nxn-1

Try the formula
gradient = ( f(x+h) - f(x) )/h
for some simple functions like f(x)=x2 and see what you get.

If anything doesn't make sense or you want to ask any further questions then feel free.

Alastair


By James Hicks (P1850) on Saturday, January 8, 2000 - 06:43 pm:

Hi Alastair,

Thanks for the reply.

I'm a little confused when you got to the point:

"So the gradient of the function at x should be the limit as h tends to zero of..."

What is the "limit"?

Thanks,

James


By Alastair Fletcher (Anf23) on Saturday, January 8, 2000 - 07:28 pm:

Hi James,

Basically what I want to do is put h=0 to get the gradient of f(x) at a point. However, there are problems with reducing the length of the chord to zero too freely.

Using gradient = ( f(x+h) - f(x) )/h, and putting h=0 seems to give 0/0, which is undefined. So, you have to rearrange the expression for the gradient so that when you put h=0, you get a sensible answer that actually means something.

So, all I really mean by "limit as h tends to zero" is "make h as close as possible to zero (to see what happens at h=0)", because I can't just put h=0 in my original expression.

As a quick example, think about f(x)=1/x. As x tends to infinity (ie. gets larger and larger), f(x) tends to zero (ie. gets smaller and smaller), but I can't just say that at x=infinity, f(x)=0, since 1/(infinity) isn't properly defined.

Hope that helps,

Alastair


By James Hicks (P1850) on Saturday, January 8, 2000 - 07:56 pm:

Alastair,

Thanks for the information - thats really helpful!

I' ve got it clear now.

I think I may have used a method like this already, except in more simple terms.

Thanks again!

James


By Pras Pathmanathan (Pp233) on Sunday, January 9, 2000 - 08:56 pm:

A brief discussion on the point of all this..

As Alastair said, what you've touched upon is calculus, which is probably the most important mathematical tool ever found - certainly it is in Applied Maths (ie physics); without it theoretical physics would not exist, and the laws of nature would not have been found. In fact Isaac Newton invented/discovered it when he was formulating his laws.

Anyway, there are two parts to calculus: differentiation, which is what you've done, finding the gradient functions of curves, and integration, which involves finding the area under a curve. These may seem rather unrelated, but they are very closely linked, but I'll leave that 'til later...

Firstly, I'd better bring some notation. Suppose we have a function f(x) (I'll use this notation rather than y=.. - the advantage is it's easier writing "f(3)" rather than "value of y when x=3"), such as f(x)=x5. Then we call the gradient function f'(x), so in this case f'(x)=5x4, using the result you found.

The gradient function is usually called the (first) derivative of f(x). If we differentiate the gradient function again - ie draw out the gradient function and find it's gradient, the we have the second derivative, f''(x). An example:

if f(x)=x5, then f'(x)=5x4, and
f''(x)=gradient of 5x4=5*(gradient of x4)=5*(4x3)=20x3.

(Notice I've used a result that if a function was multiplied by some number, the the gradient function is multiplied by that number - so if the function is 19.703xn, then the gradient is 19.703nxn-1. Another invaluable rule is that derivatives add - ie the gradient of f(x)=x4+x7 is f'(x)=4x3+7x6 ).

Now, to the point: Have you come across Newton's Second Law yet in physics? F=ma. Force (in Newtons) = mass (kg) times acceleration (metres per sec, per sec). Not very difficult to understand - if you have the total force on an object, divide by it's mass to get it's acceleration. Now suppose the force changes with time. We know what the acceleration is, in terms of time, but how do we find the position? Well, what is the acceleration of an object? Suppose the position is given by r(t) where t is time. (This is like f(x), but with x replaced by time). The speed of the object is the rate of change of position - ie r'(t). And the acceleration is the rate of change of speed, ie r''(t). So we know what r''(t) is and want to know what r(t) is. We want to somehow find the "anti-derivative", ie go backwards..

I'll stop there.. in case there's any questions. If anyone's listening and wants to know more, I'll go on.

Pras