The Gradient Function
Introduction
The gradient of any line is the steepness at which it slopes; on straight lines it can be worked out by drawing a right angled triangle using the line itself as the hypotenuse to find out the ?y, and ?x. The gradient of a line can then be worked out by dividing ?y by ?x. The following graphic shows an example:
However, with a curved graph, the gradient is different at different points. To work out the gradient at a point of a curved graph, a tangent would have to be drawn, and the gradient of it measured. The longer the tangent is, the more accurate the result if done by eye. The following graphic is an example:
Because this method is inherently inaccurate, to improve the accuracy we could either use a computer program to draw an accurate tangent, or use the small increment method. The small increment method is where the gradient of a chord, from the point, to another point of the line a short distance away, is worked out to find the gradient between the two points. So, for example, if it was a curve of y=x2, the gradient at x=3 would be measured using a chord from [3, 9] to [3.0001, 9.00060001] and so the gradient would be 0.00060001 divided by 0.0001 which is 6.0001 or 6 as an integer.
The Small Increment Method
I given a curve, y=x2, and a point, x=2, I can calculate an approximate gradient by using a chord with a second point a small distance away from x=2.
Using this method, when adding on 0.1, the gradient would be like this:
G = 4.41 - 4
2.1 - 2
G = 0.41
0.1
G = 4.1
I am expecting for the gradient given to become more like the gradient of its tangent if I decrease the amount added onto x for the second point.
The most accurate value would be zero as at that point it would be a tangent, but it is impossible as it would involve dividing by zero.
I am going to test this theory by working out the gradient using a smaller number added on:
G = 4.0401 - 4
2.01 - 2
G = 0.0401
0.01
G = 4.01
As it is coming closer to a whole number, I will work in whole numbers from now on when using this method.
Working out a pattern in a graph of y=x2 using
The Small Increment Method
I have decided to use the small increment method to work out the gradient of all the integer points from one to five on the graph y=x2 because it is very accurate and quite precise enough to get an integer value. Using the method I intend to work out a pattern, predict a result for x=6, and test it using the method.
For point x=1:
y1 = 12
y1 = 1
x2 = 1.001
y2 = 1.0012
y2 = 1.002001
G = y1-y2
x1-x2
G = 2.001
G = 2
For point x=2:
y1 = 22
y1 = 4
x2 = 2.001
y2 = 2.0012
y2 = 4.004001
G = y1-y2
x1-x2
G = 4.001
G = 4
For point x=3:
y1 = 32
y1 = 9
x2 = 3.001
y2 = 3.0012
y2 = 9.006001
G = y1-y2
x1-x2
G = 6.001
= 6
For point x=4:
y1 = 42
y1 = 16
x2 = 4.001
y2 = 4.0012
y2 = 16.008001
...
This is a preview of the whole essay
y1 = 4
x2 = 2.001
y2 = 2.0012
y2 = 4.004001
G = y1-y2
x1-x2
G = 4.001
G = 4
For point x=3:
y1 = 32
y1 = 9
x2 = 3.001
y2 = 3.0012
y2 = 9.006001
G = y1-y2
x1-x2
G = 6.001
= 6
For point x=4:
y1 = 42
y1 = 16
x2 = 4.001
y2 = 4.0012
y2 = 16.008001
G = y1-y2
x1-x2
G = 8.001
G = 8
For point x=5:
y1 = 52
y1 = 25
x2 = 5.001
y2 = 5.0012
y2 = 25.010001
G = y1-y2
x1-x2
G = 10.001
G = 10
For point x=6:
y1 = 62
y1 = 36
x2 = 6.001
y2 = 6.0012
y2 = 36.010001
G = y1-y2
x1-x2
G = 12.001
G = 12
To work out the pattern of these numbers, I can look for the difference between each number, and then work out how far off the first number is:
2 4 6 8 10
+2 +2 +2 +2
The difference between the numbers is 2, and the first number is 2, so I now know that the nth term is 2n. Using this I can work out the sixth result would be 2 x 6, 12, and also that the 100th is 2 x 100, 200. This result for point x=6, according to the small increment theory, is correct.
Working out a pattern in a graph of y=x3 using
The Small Increment Method
I have decided to use the small increment method to work out the gradient of all the integer points from one to five on the graph y=x2 because it is very accurate and quite precise enough to get an integer value. Using the method I intend to work out a pattern, predict a result for x=6, and test it using the method.
For point x=1:
y1 = 13
y1 = 1
x2 = 1.001
y2 = 1.0013
y2 = 1.003003001
G = y1-y2
x1-x2
G = 3.003001
G = 3
For point x=2:
y1 = 23
y1 = 8
x2 = 1.001
y2 = 2.0013
y2 = 8.012006001
G = y1-y2
x1-x2
G = 12.006001
G = 12
For point x=3:
y1 = 33
y1 = 27
x2 = 1.001
y2 = 3.0013
y2 = 27.027009001
G = y1-y2
x1-x2
G = 27.009001
= 27
For point x=4:
y1 = 43
y1 = 64
x2 = 4.001
y2 = 4.0013
y2 = 64.048012001
G = y1-y2
x1-x2
G = 48.012001
G = 48
For point x=5:
y1 = 53
y1 = 125
x2 = 5.001
y2 = 5.0013
y2 = 125.075015001
G = y1-y2
x1-x2
G = 75.015001
G = 75
For point x=6:
y1 = 63
y1 = 216
x2 = 6.001
y2 = 6.0013
y2 = 216.108018001
G = y1-y2
x1-x2
G = 108.018001
G = 108
I can now work out a pattern for the gradient in graph y=x3:
3 12 27 48 75
+9 +15 +21 +28
+6 +6 +6
Because the differences only balance out in the 2nd level, the nth term is worked out as an2 ± b, where a is the difference over two. Therefore the nth term is 3n2; b must be 0 as for n=1, it has a value of 3. To test this I could work out point x=6: 3 x 62 = 3 x 36 = 108. This is true.
Comparing different methods
I have worked out the gradients from points x=1 to x=5 in the graph y=x3 by hand, and using the small increment method. I am now going to work them out using a computer program and compare the results.
Point
Hand drawn
Small increment
Computer
X=1
4.5
3.003001
3
X=2
1
2.006001
2
X=3
24
27.009001
27
X=4
54
48.012001
48
X=5
76
75.015001
75
This shows that the hand drawn gradients were inaccurate by up to 6 units and so are quite useless for finding a pattern. The small increment method, on the 0`a chord rather than a tangent. This means that the computer program, being entirely accurate, is what I will use to work out my patterns.
Working out a pattern in a graph of y=x4 using
A Computer Program
Using this program I can work out the gradients of the tangents and therefore work out a pattern more accurately. I will use this data to work out the nth term of the gradient in the graph of y=x4.
4 32 108 256 500
+28 +76 +148 +244
+48 +72 + 96
+24 +24
As the differences are equal at the third level, the pattern for the nth term is an3 + b, if the value of a is the difference divided by 3, then the result for n=1 would be 8 which is twice the real value, so the value must be the difference over 6, this applies for all the values I have. This means that the nth term is 4n3; because it already fits, the value of b must be zero.
To test this pattern, I can use it to predict the gradient at x=6. Using the nth term pattern it should be 4 x 63 which is 864. Using the small increment method, the answer is (6.0014 -64) divided by 0.001 which rounds to 864. Therefore the nth term is correct.
Patterns for graphs of form y=xn
In the graphs of this form I have worked out patterns for, there seems to be a global pattern in the nth term of each sequence:
This means that for graphs of form y=xn the gradient at any point could be worked out using G=nxn-1.
I will test this on the graph y=x5:
PREDICTIONS
X=1
5 x 14 = 5
X=2
5 x 24 = 80
X=3
5 x 34 = 405
X=4
5 x 34 = 1280
X=5
5 x 34 = 3125
Graphs of form y=ax2
I will extend my work to see what effect the value of a has on my results so far, initially I kept a =1. Now I will vary a.
The pattern here is clearly noticeable as every gradient for 2x2 is twice that of the gradient of the same point on the graph x2, and in 3x2 it is triple the gradients of x2. I will test to see if the same applies on the graphs of ax3.
Graphs of form y=ax3
The same rule has applied to this set of graphs in that every gradient is a times larger than if a as 1.
Patterns for graphs of form y=axn
After working out how the "a" affects the gradient, I can now write a more detailed function to work out the gradient of any graph of the form axn where G is the gradient:
G = anxn-1
I am going to test the formula on graph y=2x6:
PREDICTIONS
X=1
2 x 6 x 15 = 12
X=2
2 x 6 x 25 = 384
X=3
2 x 6 x 35 = 2916
The graph I have of y=2x6 proves that this equation is true. However, I have not tested it on negative or fractional powers. I am going to test graphs y=x0.5 and y=x-2 to test if it works with them too.
Graph of y=x0.5
PREDICTIONS for y=x0.5
X=1
0.5 x 1-0.5 = 0.5
X=2
0.5 x 2-0.5 = 0.3536
X=3
0.5 x 3-0.5 = 0.2887
The results I have predicted using my formula matches the results from the computer program. This means my formula is correct in this scenario.
Graph of y=x-2
PREDICTIONS for y=x-2
X=1
-2 x 1-3 = -2
X=2
-2 x 2-3 = -0.25
X=3
-2 x 3-3 = -0.0740740740...
After testing these two different graphs and showing they match what the function predicts, I have now proved that my function can work out the gradient at any point on any graph of form y=axn where n can be positive, negative, or fractional.
If the graph is of form Y= axn where a and n are positive, negative, or fractional, then G = anxn-1.
Graphs of form y=axn + bxm
I can extend my work further by looking at graphs of the form y=axn + bxm for example:
Y = x2 + x3
Using my existing rule of G = anxn-1, for graphs of form axn, then if the graph is of form perhaps y=axn + bxm perhaps it is equivalent to two graphs of the form axn added together, e.g.:
For y= x2 + x3, perhaps
G = 2x + 3x2
I will test this for test this by predicting results using it and then checking them using a computer program.
PREDICTIONS for y=x-2
X=1
2 x 1 + 3 x 12 = 5
X=2
2 x 2 + 3 x 22 = 16
X=3
2 x 3 + 3 x 32 = 33
The prediction agrees with the results and therefore proves that the gradients would be added together if the graphs are.
Using calculus to calculate gradients
I have chosen a general point called x and a small increase in x called f. I intend to work out the gradient of a graph of y=x2 using these two variables.
G = (x+f)2 - x2
(x+f) - x
G = x2 + 2xf + f2 -x2
x + f - x
G = 2xf + f2
f f
G = 2x + f
2x is what I have come up with from my earlier work, so therefore, I can say that as f tends towards zero, the gradient tends towards 2x. This agrees with the results I obtained from earlier methods.
I am going to repeat this with y=x3:
G = (x+f)3 - x3
(x+f) - x
G = (x+f)(x2 + 2xf + f2) - x3
x + f - x
G = x3 + 2x2f + xf2 + x2f + 2xf2 +f3 - x3
f
G = 3x2f + 3xf2 + f3
f
G = 3x2 + 3xf + f2
This comes again to the same result, where as f tends towards zero, the gradient becomes tends to the 3x2 because 3xf = 0 and f2 = 0
Using calculus to calculate gradients
I am going to continue this method on a graph of y=x4:
G = (x+f)4 - x4
(x+f) - x
G = (x+f)(x+f)(x2 + 2xf + f2) - x4
x + f - x
G = (x+f)x3 + 2x2f + xf2 + x2f + 2xf2 +f3 - x4
f
G = x4 + 2x3f + x2f2 + x3f + 2x2f2 + xf3 + x3f +2x2y2 +xf3 +x2f2 +2xf3 +f4 - x4
f
G = x4 + 4x3f + 6x2f2 + 4xf3 +f4 - x4
f
G = 4x3f + 6x2f2 + 4xf3 +f4
f
G = 4x3 + 6x2f + 4xf2 +f3
Like with the other graphs, as f tends towards zero, the gradient tends towards 4x3.
I have noticed a pattern throughout the gradients I have worked out. This pattern in (x+f)n is so that the simplified value can be quickly worked out by starting at xn and working along and dividing by x and multiplying by f each time, and also multiplying by the corresponding number of the nth line of Pascal's triangle. For example, to work out what (x+f)5 is, the pattern would continue as follows:
x5 5x4f +10x3f2 +10x2f3 +5xf4 +1f5
The numbers 1, 5, 10, 10 ,5 and 1 are the fifth line of Pascal's triangle. Along the sequence the amount of x's drops and amount of f's rise.
Using calculus to calculate gradients
If I was to simplify (x+f)n it would be the following:
xn + nxn-1f + ?xn-2f2...
The value of ? is not relevant, but would in fact be a triangular number, because the line in the calculation that relates to this is as follows:
G = (x+f)n - xn
f
This means that if it is simplified it would be:
G = xn + nxn-1f + ?xn-2f2... - xn
f
But as it is subtracted by xn and divided by f it cancels out to:
G = nxn-1 + ?xn-2f ...
Therefore as f was zero (which it should be) the value of the ? makes no difference as all that is left is:
G = nxn-1
Which is in fact the formulae I originally came up with.
I have now demonstrated that calculus can be used to derive the gradient function for all graphs of the type y=axn.
Conclusion
To conclude, I have worked out that a gradient at any point on a graph of form y=axn can be worked out using the following formulae:
G = anxn-1
I have tried four different methods to work this out:
* Drawing tangents by hand
* Using the small increment method
* Using a computer program
* Calculus
From using these, I know:
* That hand drawn tangents are inaccurate and so no use for working out a pattern
* That the small increment method is not entirely accurate
* That computer programs can generate perfectly accurate gradients
* That calculus can work out the formulae in a single equation.
I also know that in graphs of form y=axn + bxm can be treated as two gradients from graphs of form y=axn added together.