## Gradient at a Point

**Average Gradient**

In an earlier tutorial, we learnt that the average gradient between any two points on a curve is given by the gradient of the straight line that passes through both points. We also looked at the gradient at a single point on a curve and saw that it was the gradient of the tangent to the curve at the given point. In this section we learn how to determine the gradient of the tangent.

Let us consider finding the gradient of a tangent \(t\) to a curve with equation \(y=f(x)\) at a given point \(P\).

We know how to calculate the average gradient between two points on a curve, but we need two points. The problem now is that we only have one point, namely \(P\). To get around the problem we first consider a secant (a straight line that intersects a curve at two or more points) to the curve that passes through point \(P ( x_{P}; y_{P})\) and another point on the curve \(Q ( x_{Q}; y_{Q} )\), where \(Q\) is an arbitrary distance from \(P\).

We can determine the average gradient of the curve between the two points:

\[m = \cfrac{y_{Q} – y_{P}}{x_{Q} – x_{P}}\]

If we let the \(x\)-coordinate of \(P\) be \(a\), then the \(y\)-coordinate is \(f(a)\). Similarly, if the \(x\)-coordinate of \(Q\) is (\(a + h\)), then the \(y\)-coordinate is \(f(a + h)\).

We can now calculate the average gradient as:

\begin{align*} \cfrac{y_{Q} – y_{P}}{x_{Q} – x_{P}} & = \cfrac{f(a+h)-f(a)}{(a+h)-a} \\ & = \cfrac{f(a+h)-f(a)}{h} \end{align*}

**Gradient at a Point**

Imagine that \(Q\) moves along the curve, getting closer and closer to \(P\). The secant line approaches the tangent line as its limiting position. This means that the average gradient of the secant approaches the gradient of the tangent to the curve at \(P\).

We see that as point \(Q\) approaches point \(P\), \(h\) gets closer to \(\text{0}\). If point \(Q\) lies on point \(P\), then \(h = 0\) and the formula for average gradient is undefined. We use our knowledge of limits to let \(h\) tend towards \(\text{0}\) to determine the gradient of the tangent to the curve at point \(P\):

\[\text{Gradient at point } P = \lim_{h\to 0}\cfrac{f(a+h)-f(a)}{h}\]

## Example

### Question

Given \(g(x)=3{x}^{2}\), determine the gradient of the curve at the point \(x=-1\).

### Write down the formula for the gradient at a point

\[\text{Gradient at a point } = \lim_{h\to 0}\cfrac{g(a+h)-g(a)}{h}\]

### Determine \(g(a+h)\) and \(g(a)\)

We need to find the gradient of the curve at \(x=-1\), therefore we let \(a = -1\):

\begin{align*} g(x) &= 3x^{2} \\ & \\ g(a) &= g(-1) \\ &= 3(-1)^{2} \\ &= 3 \\ & \\ g(a+h) &= g ( -1+h ) \\ & = 3{( -1+h )}^{2} \\ & = 3( 1-2h+{h}^{2} ) \\ & = 3 – 6h + 3h^{2} \end{align*}

### Substitute into the formula and simplify

\begin{align*} \lim_{h\to 0}\cfrac{g(a+h)-g(a)}{h} &= \lim_{h\to 0}\cfrac{g(-1+h)-g(-1)}{h} \\ & = \lim_{h\to 0}\cfrac{( 3 – 6h + 3h^{2} ) – 3}{h} \\ & = \lim_{h\to 0}\cfrac{ – 6h + 3h^{2} }{h} \\ & = \lim_{h\to 0}\cfrac{h(-6 + 3h )}{h} \\ & = \lim_{h\to 0} ( -6 + 3h ) \\ & = -6 \end{align*}

Notice that we only take the limit once we have removed \(h\) from the denominator.

### Write the final answer

The gradient of the curve \(g(x)=3{x}^{2}\) at \(x=-1\) is \(-\text{6}\).

## Example

### Question

Given the function \(f(x)=2{x}^{2}-5x\), determine the gradient of the tangent to the curve at the point \(x=2\).

### Write down the formula for the gradient at a point

\[\text{Gradient at a point } = \lim_{h\to 0}\cfrac{f(a+h)-f(a)}{h}\]

### Determine \(f(a+h)\) and \(f(a)\)

We need to find the gradient of the tangent to the curve at \(x=2\), therefore we let \(a = 2\):

\begin{align*} f(x) &= 2x^{2} – 5x \\ & \\ f(a) &= f(2) \\ &= 2(2)^{2} – 5(2)\\ &= 8- 10 \\ &= -2 \\ & \\ f(a+h) &= f(2+h) \\ & = 2{(2+h)}^{2}-5(2+h) \\ & = 2({2}^{2}+4h+{h}^{2})-10-5h \\ & = 8 + 8h + 2h^{2} -10 -5h \\ &= -2 + 3h + 2h^{2} \end{align*}

### Substitute into the formula and simplify

\begin{align*} \lim_{h\to 0}\cfrac{f(a+h)-f(a)}{h} &= \lim_{h\to 0}\cfrac{f(2+h)-f(2)}{h} \\ & = \lim_{h\to 0}\cfrac{( -2 + 3h + 2h^{2} ) – (-2)}{h} \\ & = \lim_{h\to 0}\cfrac{ -2 + 3h + 2h^{2} + 2 }{h} \\ & = \lim_{h\to 0}\cfrac{ 3h + 2h^{2} }{h} \\ & = \lim_{h\to 0}\cfrac{h(3 + 2h )}{h} \\ & = \lim_{h\to 0} ( 3 + 2h ) \\ & = 3 \end{align*}

### Write the final answer

The gradient of the tangent to the curve \(f(x)=2{x}^{2}-5x\) at \(x=2\) is \(\text{3}\).

## Example

### Question

Determine the gradient of \(k(x) = -x^{3} + 2x + 1\) at the point \(x=1\).

### Write down the formula for the gradient at a point

\[\text{Gradient at a point } = \lim_{h\to 0}\cfrac{k(a+h)-k(a)}{h}\]

### Determine \(k(a+h)\) and \(k(a)\)

Let \(a = 1\):

\begin{align*} k(x) &= – x^{3} + 2x + 1 \\ & \\ k(a) &= k(1) \\ &= – (1)^{3} + 2(1) + 1\\ &= – 1 + 2 + 1 \\ &= 2 \\ & \\ k(a+h) &= k(1+h) \\ & = – {(1+h)}^{3}+2(1+h) + 1 \\ & = – ( 1 + 3h + 3h^{2} + h^{3} ) + 2 + 2h + 1 \\ & = – 1 – 3h – 3h^{2} – h^{3} + 2 + 2h + 1 \\ & = 2 – h – 3h^{2} – h^{3} \end{align*}

### Substitute into the formula and simplify

\begin{align*} \lim_{h\to 0}\cfrac{k(a+h)-k(a)}{h} &= \lim_{h\to 0}\cfrac{k(1+h)-k(1)}{h} \\ & = \lim_{h\to 0}\cfrac{( 2 – h – 3h^{2} – h^{3} ) – 2}{h} \\ & = \lim_{h\to 0}\cfrac{ – h – 3h^{2} – h^{3}}{h} \\ & = \lim_{h\to 0}\cfrac{h( – 1 – 3h – h^{2} )}{h} \\ & = \lim_{h\to 0} ( – 1 – 3h – h^{2} ) \\ & = -1 \end{align*}

### Write the final answer

The gradient of \(k(x) = -x^{3} + 2x + 1\) at \(x=1\) is \(-\text{1}\).