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.
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) = x2.
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 x2:
lim ((x + h)22 – x2)/h
h → 0
Step 2: Use algebra to solve the limit formula.
lim (x2 + 2xh + h2 – x2)/h
h → 0
lim (2xh + h2)/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.
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:
- xn is the x-intercept (initially, your best guess),
- fxn is the function you’re working with,
- f’xn 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 x0 (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 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))
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, x2.
0.7503638679 -( cos(0.7503638679 )-0.7503638679 ) / ( – sin(0.7503638679 ) – 1)) =
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 x1(Step 2) with x2 (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.
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.Comments? Need to post a correction? Please post on our Facebook page.