Equations of a line
The standard form of an equation of a line is
$Ax+By=C$
There are two other forms: the slope-intercept form and the point-slope form.
Slope-intercept form
An equation of the form:
$y=mx+b$
is the slope-intercept form.
where $m$ is the slope of the line and $(0,b)$ is its $y$-intercept.
Point-slope form
An equation of a line of the form:
$y-y_1=m(x-x_1)$
is the point-slope form.
The above equation is called the point-slope formula. If you know the slope of a line and a point $(x_1,y_1)$ on it, you can use this formula to find the equation of the line.
Equation of a horizontal line
A horizontal line has the same $y$-value at every point. For example, every point on the line below has $y=4$.
So, the equation of a horizontal line is
$y=\text{constant}$
Equation of a vertical line
A vertical line has the same $x$-value at every point. For example, every point on the line below has $x=2$.
So, the equation of a vertical line is
$x=\text{constant}$
Writing the equation of a line
Given enough information about a line, we can write its equation using the slope-intercept form $y=mx+b$ or the point-slope form $y-y_1=m(x-x_1)$.
Example 1: A line passes through the point $(-8,5)$ and has a slope of $-11$. Write the equation of the line in slope-intercept form.
Solution: Use the slope-intercept form $y=mx+b$ with $m=-11$:
$y=-11x+b$
Substitute the point $(-8,5)$ and solve for $b$:
$\begin{align*}5&=-11(-8)+b\\5&=88+b\\5-88&=b\\-83&=b\end{align*}$
So the equation is $y=-11x-83$.
Example 2: Find an equation of the line passing through the points $(5,-1)$ and $(3,0)$. Write the answer in slope-intercept form.
Solution: First find the slope:
$m=\dfrac{y_2-y_1}{x_2-x_1}=\dfrac{0-(-1)}{3-5}=\dfrac{1}{-2}=-\dfrac{1}{2}$
Use $y=mx+b$ with $m=-\dfrac{1}{2}$ and the point $(5,-1)$:
$\begin{align*}-1&=-\dfrac{1}{2}(5)+b\\-1&=-\dfrac{5}{2}+b\end{align*}$
Multiply through by $2$:
$\begin{align*}-2&=-5+2b\\-2+5&=2b\\3&=2b\\b&=\dfrac{3}{2}\end{align*}$
So the equation is $y=-\dfrac{1}{2}x+\dfrac{3}{2}$.
Example 3: Write the standard form of the line passing through the points $(2,4)$ and $(2,8)$.
Solution: Find the slope:
$m=\dfrac{8-4}{2-2}=\dfrac{4}{0}$, which is undefined.
An undefined slope means the line is vertical. Since both points have $x=2$, the equation of the line is
$x=2$
Example 4: The table below gives several points that lie on a line. Write an equation of the line in standard form.
| $x$ | $y$ |
|---|---|
| $-5$ | $10$ |
| $3$ | $6$ |
| $5$ | $5$ |
Solution: Use two of the points, $(-5,10)$ and $(3,6)$, to find the slope:
$m=\dfrac{6-10}{3-(-5)}=\dfrac{-4}{8}=-\dfrac{1}{2}$
Use the point-slope form $y-y_1=m(x-x_1)$ with the point $(-5,10)$:
$y-10=-\dfrac{1}{2}(x+5)$
Multiply through by $2$ and simplify:
$\begin{align*}2y-20&=-(x+5)\\2y-20&=-x-5\\x+2y&=20-5\\x+2y&=15\end{align*}$
So the standard form is $x+2y=15$.
Example 5: Write an equation of the line that passes through $(-3,-2)$ and is parallel to $4x-y=4$. Give the equation in slope-intercept form.
Solution: Find the slope of the given line by writing it in slope-intercept form:
$\begin{align*}4x-y&=4\\-y&=-4x+4\\y&=4x-4\end{align*}$
Its slope is $4$. Parallel lines have equal slopes, so the new line also has slope $4$. Use $y=mx+b$ with $m=4$ and $(-3,-2)$:
$\begin{align*}-2&=4(-3)+b\\-2&=-12+b\\-2+12&=b\\10&=b\end{align*}$
So the equation is $y=4x+10$.
Example 6: Write an equation of the line that passes through $(4,-10)$ and is perpendicular to $7x+3y=-5$. Give the equation in slope-intercept form.
Solution: Find the slope of the given line:
$\begin{align*}7x+3y&=-5\\3y&=-7x-5\\y&=-\dfrac{7}{3}x-\dfrac{5}{3}\end{align*}$
Its slope is $m_2=-\dfrac{7}{3}$. The slope of a perpendicular line is the negative reciprocal:
$m_1=\dfrac{3}{7}$
Use $y=mx+b$ with $m=\dfrac{3}{7}$ and $(4,-10)$:
$\begin{align*}-10&=\dfrac{3}{7}(4)+b\\-10&=\dfrac{12}{7}+b\end{align*}$
Multiply through by $7$:
$\begin{align*}-70&=12+7b\\-70-12&=7b\\-82&=7b\\b&=-\dfrac{82}{7}\end{align*}$
So the equation is $y=\dfrac{3}{7}x-\dfrac{82}{7}$.