# Finding Equations of Tangent Line

Consider a curve $y=f(x)$.

A tangent to a curve is a straight line which touches the curve at a given point and represents the gradient of the curve at that point.
If $A$ is the point with $x$-coordinate $a$, then the gradient of the tangent line to the curve at this point is $f'(a)$. The equation of the tangent is;
$$y-f(a) = f'(a)(x-a)$$

## Example 1

Find the equation of the tangent line to $f(x)=x^2$ at the point where $x=3$.

\begin{align} \displaystyle \require{color} f(3) &= 3^2 \\ &= 9 \\ f^{\prime}(x) &= 2x \\ f^{\prime}(3) &= 2 \times 3 \\ &= 6 \\ y-9 &= 6(x-3) &\color{red} y-f(3) = f^{\prime}(3)(x-3)\\ &= 6x-18 \\ \therefore y &= 6x-9 \\ \end{align}

## Example 2

Find the equations of tangent lines to $f(x)=2x^2-8x$ at the point where the gradient is $4$?

\begin{align} \displaystyle \require{color} f^{\prime}(x) &= 4 \\ 4x-8 &= 4 \\ 4x &= 12 \\ x &= 3 \\ f(3) &= 2 \times 3^2 – 8 \times 3 \\ &= -6 \\ y-(-6) &= 4(x-3) &\color{red} y-f(3) = 4(x-3) \\ \therefore y &= 4x-18 \\ \end{align}

## Example 3

Find the equations of the tangents to the curve $f(x)=x^2+3x-10$ at the points where the curve cuts the $x$-axis.

\begin{align} \displaystyle \require{color} f^{\prime}(x) &= 2x+3 \\ x^2+3x-10 &= 0 &\color{red} \text{the curve cuts the xaxis} \\ (x+5)(x-2) &= 0 \\ x &= -5 \text{ or } x=2 \\ f^{\prime}(-5) &= 2 \times (-5)+3 &\color{red} \text{gradient at }x=-5\\ &= -7 \\ y – 0 &= -7(x–5) &\color{red} y-f(-5) = f^{\prime}(-5)(x–5)\\ y &= -7x-35 \\ f^{\prime}(-5) &= 2 \times 2+3 &\color{red}\text{gradient at }x=2\\ &= 7 \\ y – 0 &= 7(x-2) &\color{red} y-f(2) = f^{\prime}(2)(x-2)\\ y &= 7x-14 \\ \therefore y &= -7x-35 \text{ and } y = 7x-14 \\ \end{align}

## Example 4

Find the equations of any horizontal tangent lines to $f(x)=2x^3-3x^2-12x+1$.

$f^{\prime}(x) = 6x^2-6x-12$
Horizontal tangents have gradient $0$.
\begin{align} \displaystyle \require{color} 6x^2-6x-12 &= 0 \\ x^2-x-2 &= 0 \\ (x+1)(x-2) &= 0 \\ x &= -1 \text{ or } x=2 \\ f(-1) &= 2(-1)^3-3(-1)^2-12(-1)+1 \\ &= 8 \\ f(2) &= 2(2)^3-3(2)^2-12(2)+1 \\ &= -19 \\ \end{align}
The points of contact are $(-1,8)$ and $(2,-19)$.
Therefore the horizontal tangent lines are $y=8$ and $y=-19$.