**Contents:**

## 1. What is a Tangent Line?

A **tangent line** is a line that goes through a graph at only one point and is practically parallel to the graph at that point. It is the same as the instantaneous rate of change or the derivative at that point.

*not*a tangent line. This image on the left shows a single tangent line (top left, marked by a red point). Although the line crosses the graph at the bottom right, it is not parallel to the graph at that point and therefore it is not a tangent line.

## Finding Tangent Lines

Finding tangent lines for straight graphs is a simple process, but with curved graphs it requires calculus in order to find the derivative of the function, which is the *exact same thing* as the slope of the tangent line. Once you have the slope of the tangent line, which will be a function of x, you can find the **exact slope** at specific points along the graph.

Keep in mind that f(x) is also equal to y, and that the slope-intercept formula for a line is y = mx + b where m is equal to the slope, and b is equal to the y intercept of the line. In order to find the tangent line at a point, you need to solve for the slope function of a secant line. You can find any secant line with the following formula:

(f(x + Δx) – f(x))/Δx or **lim (f(x + h) – f(x))/h**.

**Sample problem:** Find the tangent line at a point for f(x) = x^{2}.

*Note: If you have gone further into calculus, you will recognize the method used here as taking the derivative of the graph. If you know how to take derivatives of a function, you can skip ahead to the asterisked point (*) of step 2.*

Step 1: **Set up the limit formula.** Substituting in the formula x^{2}:

lim ((x + h)^{2}2 – x^{2})/h

h → 0

Step 2: **Use algebra to solve the limit formula.**

lim (x^{2} + 2xh + h^{2} – x^{2})/h

h → 0

lim (2xh + h^{2})/h

h → 0

lim h(2x + h)/h

h → 0

*lim 2x + h = 2x

h → 0

This gives the slope of any tangent line on the graph.

Step 3: **Substitute in an x value **to solve for the tangent line at the specific point.

At x = 2,

2(2) = 4.

*That’s it!*

## What is Newton’s Method?

**Newton’s method (also called the Newton–Raphson method) is a way to find x-intercepts (roots) of functions.** In other words, you want to know where the function crosses the x-axis. The method works well when you can’t use other methods to find zeros of functions, usually because you just don’t have all the information you need to use easier methods. While Newton’s method might look complex, all you’re actually doing is finding a tangent line…then another tangent line…and repeat, until you think you’re close enough to the actual solution.

The general form of Newton’s Method is:

If x

_{n}is an approximate solution of f(x) = 0,f'(x)_{n}≠ 0, then the next approximate solution is given by:

Where:

- x
_{n}is the x-intercept (initially, your best guess),- fx
_{n}is the function you’re working with,- f’x
_{n}is the derivative of the function you’re working with.

What’s basically happening with this equation is each iteration (subsequent calculation) takes you closer and closer to the true solution, as the following image shows. The true solution is marked in red. The blue line is the tangent line for x_{0} (Guess 1) and the green line is the tangent line for the second iteration. Eventually, your answers will get closer and closer (converge) to the red x-value.

## Newton’s Method: Step by Step Example

**Example:** Find the x-intercept for f(x) = cos x – x on the interval [0,2]

Step 1: **Insert your function into the general form of the equation.** The bottom half of the equation is the derivative. The derivative of cos x – x is -sin x – 1, so:

Step 2: **Take a guess for the actual x-intercept** and insert that guess into your function from Step 1. We’re given the interval [0,2] in the question, so a good guess to start with is 1 (because it’s in the middle of the interval).

Step 3: **Evaluate the function from Step 2** using any calculator (I just used the Google calculator):

= 1 -( cos(1)-1) / ( – sin(1) – 1))

= 0.7503638679

Step 4: **Repeat Steps 2 and 3,** using the new guess for the x-intercept that you obtained from Step 3. This is the second iteration, x_{2}.

0.7503638679 -( cos(0.7503638679 )-0.7503638679 ) / ( – sin(0.7503638679 ) – 1)) =

**0.73911289091**

Step 5: Repeat Steps 2 and 3 with your new estimate for as many times as you need. Eventually your answer will converge to a single number. If you compare x_{1}(Step 2) with x_{2} (Step 3), you’ll notice that the first digit is “7” in both cases. That means we’ve got an accuracy of one decimal place. If you perform a third iteration, you’ll have an accuracy to three decimal places (0.739xxxxxxx). Repeat Steps for as many decimal places as you need.

**Warning:** A downside to Newton’s method; it will not work if you pick a point where the tangent line is horizontal.

## Related Articles

If you prefer an online interactive environment to learn R and statistics, this *free R Tutorial by Datacamp* is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try *this Statistics with R track*.

*Facebook page*and I'll do my best to help!