freeCodeCamp/guide/english/mathematics/equation-of-tangent-line/index.md

1.6 KiB

title
Equation of Tangent Line

Equation of Tangent Line

A tangent line to a function f(x) is a straight line that passes through the point (x0, f(x0)) and has slope f'(x0). The slope of the tangent line represents the instantaneous rate of change of the function at that point.

Finding the equation of a tangent line:

To find the equation of a tangent line,

y = mx + b,

of a function f(x) at point x = x0, we need to do the following:

  1. Find the derivative of the function.
  2. Find the value of the derivative at x = x0, this will be the slope of the tangent (our m above).
  3. Find the value y0 of the function at x0. The tangent will pass through the point (x0, y0).
  4. Find the equation of the tangent using point-slope form. As the tangent passes through (x0, y0) and has slope m, the equation of the tangent line can be written as (y - y0) = m(x - x0) or y = mx + (y0 - mx0).

Example

Find the equation of tangent line to the function f(x) = 4x2 - 4x + 1 at x = 2.

We proceed through the steps above.

Step 1 : f'(x) = 8x - 4.

Step 2 : m = f'(2) = 8 · 2 - 4 = 12.

Step 3 : y0 = f(x0) = f(2) = 4 · 22 - 4 · 2 + 1 = 16 - 8 + 1 = 9.

Step 4 : From steps 2 and 3 we have m = 12 and (x0, y0) = (2,9), so the equation of the tangent line is

(y - 9) = 12(x - 2)

or, rearranging to slope intercept form,

y = 12x - 15.