# Tangent line to graph

## Summary and examples

We want to find an equation for the tangent line at a point $(x_0, y_0)$ of the graph of a function $f (x)$.
Before we go into this in more detail, we will first discuss the following general case: what is the equation of the line through a point $P$ with coordinates $(x_p, y_p)$ with slope $m$.
The general equation of a line is:

$y=ax+b$

Because the slope is equal to $m$ is, we have:

$y=mx+b$

This line has to go through the point $(x_p,y_p)$, thus we write:

$y_p=mx_p+b$

from which it follows:

$b=y_p-mx_p$

Now the formula for the line is:

$y=mx+(y_p-mx_p)$

or:

$y-y_p=m(x-x_p)$

It is most convenient to just remember this formula and this is not difficult given the simple, symmetric shape.

Now we return to the equation of a tangent line at a point of the graph of the function $f(x)$. When we want to determine the tangent line at the point $(x_0,y_0)$ of the graph of the function $f(x)$, the slope can be found by:

$m=f'(x)$

and thus de formula for the tangent line is:

$y-y_0=f'(x_0)(x-x_0)$

##### Example 1

Determine the tangent line at the point $(0,-5)$ of the graph of the function:

$y=x^2+2x-5$

First we calculate the derivative $y'$ of the function:

$y'=2x+2$

In the point $(0,-5)$ we have $y'=2$ and this is the slope of the tangent line at $(0,-5)$.

According to the formula given above the equation of the tangent line is:

$y-(-5)=2(x-0)$

or:

$y=2x-5$

##### Example 2

Where does the tangent line at the point $(0,1)$ of the graph of the function:

$y=e^x$

intersect the $X$-axis.

First we determine the equation of the tangent line in the point $(0,1)$.

The derivative of the function is:

$y'=e^x$

In the point $(0,1)$ the derivative has the value $1$, so the slope of the tangent line is $1$. The tangent line goes through the point $(0,1)$ and thus the equation of the tangent line is:

$y-1=1(x-0)$

$y=x+1$

The tangent line intersects the $X$-axis in the point $(-1,0)$.

##### Example 3

Given the function:

$y=\displaystyle\frac{1}{3}x^3-4x+1$

Determine the equation of the tangent line to the graph of this function, parallel to the line:

$y=5x+1$

The slope of the tangent line to the graph of the given function is found by differentiation:

$y'=x^2-4$

In a point  with $x=a$ the slope of the tangent line is:

$y'=a^2-4$

The line is parallel to the given line, so:

$a^2-4=5$

or:

$a^2=9$

From this we may conclude:

$a=3$ or $a=-3$

The corresponding tangent points are:

$(3,-2)$ or $(-3,4)$

The tangent lines through these points are, respectively:

$y+2=5(x-3)$ or $y=5x-17$

or:

$y-4=5(x--3)$ or $y=5x+19$

0