A straight line is defined by two points, or by one point and the slope of the line. There is an ingenious formula that allows you to find the formula for a straight line using one point and the slope of the line:

Formula

The formula that defines the line with slope $a$ through the point $({x}_{1},{y}_{1})$ is

$$y-{y}_{1}=a(x-{x}_{1})$$ |

Solve the equation with respect to $y$ and the expression looks like the function for a straight line $y=ax+b$.

Example 1

**Find the function for the line through $(2,5)$ with a slope of 3 **

Put the numbers into the point-slope equation and solve for $y$:

$$\begin{array}{llll}\hfill y-5& =3(x-2)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =3x-6+5=3x-1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Example 2

**Find the function for the straight line through the points $(-3,9)$ and $(3,-9)$ **

First, you find the slope:

$$a=\frac{-9-9}{3-(-3)}=-\frac{18}{6}=-3$$ |

Then, select one of the points in the exercise and put it together with the slope into the point-slope equation:

$$\begin{array}{llll}\hfill y-(-9)& =-3(x-3)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y+9& =-3x+9\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =-3x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Since $b=0$, you know that the line passes through the origin. The function for the straight line is

$$y=-3x$$ |

If you know the function $f(x)$, you can use the point-slope equation to find the equation of the tangent line at a point on the graph of $f(x)$. This is because the slope of the tangent is equal to the value of the derivative of the function $f(x)$ at the same point.

Formula

$$y-{y}_{1}={f}^{\prime}({x}_{1})(x-{x}_{1}),$$ |

where $({x}_{1},{y}_{1})$ is a point on the tangent (often the point of tangency) and ${f}^{\prime}({x}_{1})$ is the slope of the point. When using the formula, you must always solve for $y$— that is, get $y$ alone on one side.

Example 3

**Given the function $f(x)={x}^{2}+3x-2$, find the equation for the tangent at $x=3$ **

To fill in the equation, you need values for ${y}_{1}$ and ${f}^{\prime}({x}_{1})$. You know that ${x}_{1}=3$, so ${y}_{1}=f(3)$ and ${f}^{\prime}({x}_{1})={f}^{\prime}(3)$. We begin by computing ${f}^{\prime}(x)$:

$$\begin{array}{llll}\hfill {f}^{\prime}(x)& =2x+3\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {f}^{\prime}({x}_{1})& ={f}^{\prime}(3)=2(3)+3=9\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill {y}_{1}& =f({x}_{1})=f(3)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & ={(3)}^{2}+3(3)-2=16\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Now you put this into the equation and get

$$\begin{array}{llll}\hfill y-16& =9(x-3)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =9x-27+16=9x-11\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$Example 4

**Let $g(x)={e}^{\mathrm{sin}x}$. Find the equation for the tangent at $x=0$. **

You need the values of ${f}^{\prime}({x}_{1})$ and ${y}_{1}$. First, differentiate the function:

$${f}^{\prime}(x)=\mathrm{cos}x\cdot {e}^{\mathrm{sin}x}$$ |

Now you can calculate ${f}^{\prime}({x}_{1})$. Since ${x}_{1}=0$, you get

$$\begin{array}{llll}\hfill {f}^{\prime}({x}_{1})& ={f}^{\prime}(0)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\mathrm{cos}0\cdot {e}^{\mathrm{sin}0}=1\cdot {e}^{0}=1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$You find ${y}_{1}$ by putting ${x}_{1}$ into $f(x)$:

$${y}_{1}=f({x}_{1})=f(0)={e}^{\mathrm{sin}0}={e}^{0}=1$$ |

You put all this into the equation and get

$$\begin{array}{llll}\hfill y-1& =1(x-0)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =x+1\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$