# 1.4 Equation of a line
[toc]
## Point-Slope Form: A line that passes through the point $(x_1,y_1)$ with slope $m$ has the equation $$y-y_1=m(x-x_1)$$
### Example 1. Write the point-slope equation of a line through $(1,-4)$ and slope $3$. Solve for slope-intercept form ($y=mx+b$)
::: spoiler
<summary> Solution:</summary>
$(x_1,y_1)=(1,-4)$ and $m=3$. Plugging in:
\begin{align}
y-y_1&=m(x-x_1) \\
y-(-4)&=3(x-1) \qquad \text{ Point-Slope Form}\\
y+4&=3(x)+3(-1) \\
y+4&=3x-3 \\
y&=3x-3-4 \\
y&=3x-7 \qquad \text{ Slope-Intercept Form}
\end{align}
:::
### Example 2. Write the point-slope equation of a line through $(-3,6)$ and slope $-\dfrac{1}{2}$. Solve for slope-intercept form ($y=mx+b$)
::: spoiler
<summary> Solution:</summary>
\begin{align}
y-y_1&=m(x-x_1) \\
y-6&=-\dfrac{1}{2}(x-(-3)) \qquad \text{ Point-Slope Form}\\
y-6&=-\dfrac{1}{2}(x+3) \\
y-6&=-\dfrac{1}{2}(x)-\dfrac{1}{2}(3) \\
y-6&=-\dfrac{1}{2}x-\dfrac{3}{2} \\
y&=-\dfrac{1}{2}x-\dfrac{3}{2}+6 \\
y&=-\dfrac{1}{2}x-\dfrac{3}{2}+\dfrac{12}{2} \\
y&=-\dfrac{1}{2}x+\dfrac{9}{2} \qquad \text{ Slope-Intercept Form}
\end{align}
:::
### Example 3. Write the point-slope equation of a line through $(4,-6)$ and slope $0$. Solve for slope-intercept form ($y=mx+b$)
::: spoiler
<summary> Solution:</summary>
\begin{align}
y-y_1&=m(x-x_1) \\
y-(-6)&=0(x-4) \qquad \text{ Point-Slope Form}\\
y+6&=0 \\
y&=-6 \qquad \text{ Slope-Intercept Form}
\end{align}
:::
### Example 4. Write the point-slope equation of a line through $(-3,6)$ and (2,5). Solve for slope-intercept form ($y=mx+b$)
::: spoiler
<summary> Solution:</summary>
The slope can be found by the slope formula:
\begin{align}
m&=\dfrac{y_2-y_1}{x_2-x_1} \\
&=\dfrac{5-6}{2-(-3)} \\
&=\dfrac{5-6}{2+3} \\
&=\dfrac{-1}{5} \\
&=-\dfrac{1}{5}
\end{align}
\begin{align}
y-y_1&=m(x-x_1) \\
y-5&=-\dfrac{1}{5}(x-2) \qquad \text{ Point-Slope Form}\\
y-5&=-\dfrac{1}{5}(x)-\dfrac{1}{5}(-2) \\
y-5&=-\dfrac{1}{5}x+\dfrac{2}{5} \\
y&=-\dfrac{1}{5}x+\dfrac{2}{5}+5 \\
y&=-\dfrac{1}{5}x+\dfrac{2}{5}+\dfrac{25}{5} \\
y&=-\dfrac{1}{5}x+\dfrac{27}{5} \qquad \text{ Slope-Intercept Form}
\end{align}
:::
### Example 5. Write the point-slope equation of a line through $(-2,-2)$ and $(-3,7)$. Solve for slope-intercept form ($y=mx+b$)
::: spoiler
<summary> Solution:</summary>
Here’s a step-by-step breakdown of the process:
1. **Find the slope (m):**
Using the slope formula:
$$
m = \frac{y_2 - y_1}{x_2 - x_1}
$$
Substituting the points $(-2, -2)$ and $(-3, 7)$:
$$
m = \frac{7 - (-2)}{-3 - (-2)} = \frac{7 + 2}{-3 + 2} = \frac{9}{-1} = -9
$$
So, the slope is $m = -9$.
2. **Write the point-slope equation:**
The point-slope form of a line is:
$$
y - y_1 = m(x - x_1)
$$
Using the point $(-2, -2)$ and the slope $m = -9$:
$$
y - (-2) = -9(x - (-2))
$$
Simplifying:
$$
y + 2 = -9(x + 2)
$$
3. **Convert to slope-intercept form:**
Expand the equation:
$$
y + 2 = -9x - 18
$$
Subtract 2 from both sides:
$$
y = -9x - 20
$$
Thus, the slope-intercept form of the equation is:
$$
y = -9x - 20
$$
:::
### Example 6. Write the equations of the vertical and horizontal lines that pass through the point $(4,-2)$.
::: spoiler
<summary> Solution:</summary>
A vertical line that passes through $(4,-2)$ is $x=4$.
A horizontal line that passes through $(4,-2)$ is $y=-2$.

:::
### Example 7. Write the equations of the vertical and horizontal lines that pass through the point $(-1,-5)$.
::: spoiler
<summary> Solution:</summary>
A vertical line that passes through $(-1,-5)$ is $x=-1$.
A horizontal line that passes through $(-1,-5)$ is $y=-5$.

:::
### Example 8. Find a linear function $h(x)$ such that $h(1)=-3$ and $h(-2)=5$
::: spoiler
<summary> Solution:</summary>
$h(1)=-3$ means it passes through the point $(1,-3)$.
$h(-2)=5$ means it passes through the point $(-2,5)$.
Then we can find the slope by the slope formula
\begin{align}
m&=\dfrac{y_2-y_1}{x_2-x_1} \\
&=\dfrac{5-(-3)}{-2-1} \\
&=\dfrac{5+3}{-2-1} \\
&=\dfrac{8}{-3} \\
&=-\dfrac{8}{3}
\end{align}
Then the equation of the line with slope $-\dfrac{8}{3}$ and passing through the point $(1,-3)$ in point-slope form:
\begin{align}
y-y_1&=m(x-x_1) \\
y-(-3)&=-\dfrac{8}{3}(x-1) \\
y+3&=-\dfrac{8}{3}(x-1) \\
y+3&=-\dfrac{8}{3}(x) -\dfrac{8}{3}(-1) \\
y+3&=-\dfrac{8}{3}x +\dfrac{8}{3} \\
y&=-\dfrac{8}{3}x +\dfrac{8}{3}-3 \\
y&=-\dfrac{8}{3}x +\dfrac{8}{3}-\dfrac{9}{3} \\
y&=-\dfrac{8}{3}x +\dfrac{8-9}{3} \\
y&=-\dfrac{8}{3}x +\dfrac{-1}{3} \\
y&=-\dfrac{8}{3}x -\dfrac{1}{3}
\end{align}
:::
## Parallel and Perpendicular Lines
### Parallel Lines
Parallel lines have the same slope.
$m_1=m_2$

---
### Perpendicular Lines
Perpendicular lines have slopes that multiply to $-1$.
$m_1 \cdot m_2=-1$

$m_1 \cdot m_2=\dfrac{2}{5} \cdot \left(-\dfrac{5}{2}\right)=\dfrac{-10}{10}=-1$
Also, vertical and horizontal lines are perpendicular.

### Example 9. Determine whether the pairs of lines are parallel, perpendicular, or neither.
### Example 9a. $y=-\dfrac{2}{3}x-5$ and $y=\dfrac{3}{2}x-15$
::: spoiler
<summary> Solution:</summary>
$m_1=-\dfrac{2}{3}$ and $m_2=\dfrac{3}{2}$.
$m_1 \cdot m_2=\left(-\dfrac{2}{3}\right) \cdot \dfrac{3}{2} = \dfrac{-6}{6}=-1$.
Since the slopes multiply to zero, the lines are perpendicular.

:::
### Example 9b. $y=\dfrac{2}{3}x-5$ and $y=\dfrac{2}{3}x-15$
::: spoiler
<summary> Solution:</summary>
$m_1=\dfrac{2}{3}$ and $m_2=\dfrac{2}{3}$.
Note that the slopes are equal.
Thus the lines are parallel.

:::
### Example 9c. $y=-\dfrac{2}{3}x-5$ and $y=-\dfrac{3}{2}x-15$
::: spoiler
<summary> Solution:</summary>
$m_1=-\dfrac{2}{3}$ and $m_2=-\dfrac{3}{2}$.
Note that the slopes are not equal, so they are not parallel.
$m_1 \cdot m_2=\left(-\dfrac{2}{3}\right) \cdot \left(- \dfrac{3}{2}\right)=\dfrac{6}{6}=1$
Since the slopes don't multiply to -1, the lines aren't perpendicular.
The lines are neither parallel nor perpendicular.

:::
### Example 9d. $y=3$ and $y=-7$
::: spoiler
<summary> Solution:</summary>
To help remind you, you can rewrite the equations as $y=0x+3$ and $y=0x-7$, so they both have zero slope.
Note both of the lines are horizontal lines, so they both have zero slope.
$m_1=0$ and $m_2=0$.
Since the slopes are equal, the lines are parallel.

:::
### Example 9e. $x=2$ and $x=-5$
::: spoiler
<summary> Solution:</summary>
Note both of the lines are vertical lines, so they both have undefined slope.
Vertical lines are parallel to each other.

:::
### Example 9f. $x=2$ and $y=-5$
::: spoiler
<summary> Solution:</summary>
$x=2$ is a vertical line and $y=-5$ is a horizontal line. The lines are perpendicular to each other.

:::
### Example 9g. $2x+4y=5$ and $2x-y=7$
::: spoiler
<summary> Solution:</summary>
Convert each equation into $y=mx+b$ form to find the slopes, then compare.
\begin{align}
2x+4y&=5 \\
4y&=-2x+5 \\
\dfrac{4y}{4}&=\dfrac{-2x+5}{4} \\
y&=\dfrac{-2}{4}x+\dfrac{5}{4} \\
y&=-\dfrac{1}{2}x+\dfrac{5}{4} \\
\end{align}
The slope of the first line is $-\dfrac{1}{2}$.
\begin{align}
2x-y&=7 \\
-y&=-2x+7 \\
\dfrac{-y}{-1}&=\dfrac{-2x+7}{-1} \\
y&=\dfrac{-2}{-1}x+\dfrac{7}{-1} \\
y&=2x-7
\end{align}
The slope of the second line is $2$.
When multiplying the slopes together:
$m_1 \cdot m_2 = \left(-\dfrac{1}{2}\right)(2)=\dfrac{-2}{2}=-1$
The lines are perpendicular.

:::
---
### Example 10 Write a slope-intercept form for the equation of the line $(1,-5)$ parallel to $y=7x-3$. Then write the equation of the line through $(1,-5)$ perpendicular to $y=7x-3$.
::: spoiler
<summary> Solution:</summary>
**Step 1**: Identify the slope of the given line.
The equation $y = 7x - 3$ is already in slope-intercept form $y = mx + b$, where $m$ is the slope.
So, the slope of the given line is $m = 7$.
---
**Step 2**: Find the equation of the line parallel to $y = 7x - 3$.
- Parallel lines have the same slope.
- Therefore, the slope of the parallel line is also $m = 7$.
- Now use the point-slope form $y - y_1 = m(x - x_1)$, where $(x_1, y_1)$ is the point $(1, -5)$.
$$
y - (-5) = 7(x - 1)
$$
- Simplify the equation:
$$
y + 5 = 7x - 7
$$
$$
y = 7x - 7 - 5
$$
$$
y = 7x - 12
$$
So, the equation of the line parallel to $y = 7x - 3$ passing through $(1, -5)$ is:
$$
y = 7x - 12
$$
---
**Step 3**: Find the equation of the line perpendicular to $y = 7x - 3$.
- Perpendicular lines have slopes that are negative reciprocals of each other.
- The slope of the given line is $m = 7$, so the slope of the perpendicular line is:
$$
m_{\perp} = -\frac{1}{7}
$$
- Again, use the point-slope form $y - y_1 = m(x - x_1)$ with the point $(1, -5)$.
$$
y - (-5) = -\frac{1}{7}(x - 1)
$$
- Simplify the equation:
$$
y + 5 = -\frac{1}{7}(x - 1)
$$
$$
y + 5 = -\frac{1}{7}x + \frac{1}{7}
$$
$$
y = -\frac{1}{7}x + \frac{1}{7} - 5
$$
$$
y = -\frac{1}{7}x + \frac{1}{7} - \dfrac{35}{7}
$$
$$
y = -\frac{1}{7}x - \frac{34}{7}
$$
So, the equation of the line perpendicular to $y = 7x - 3$ passing through $(1, -5)$ is:
$$
y = -\frac{1}{7}x - \frac{34}{7}
$$
---
**Final Answer**:
- The equation of the parallel line is:
$y = 7x - 12$
- The equation of the perpendicular line is:
$y = -\frac{1}{7}x - \frac{34}{7}$
Graph:

:::
### Example 11 Write a slope-intercept form for the equation of the line $(-2,4)$ parallel to $y=\dfrac{1}{3}x-3$. Then write the equation of the line through $(-2,4)$ perpendicular to $y=\dfrac{1}{3}x-3$.
::: spoiler
<summary> Solution:</summary>
**Step 1**: Identify the slope of the given line.
The equation $y = \dfrac{1}{3}x - 3$ is already in slope-intercept form $y = mx + b$, where $m$ is the slope.
So, the slope of the given line is $m = \dfrac{1}{3}$.
---
**Step 2**: Find the equation of the line parallel to $y = \dfrac{1}{3}x - 3$.
- Parallel lines have the same slope.
- Therefore, the slope of the parallel line is also $m = \dfrac{1}{3}$.
- Now use the point-slope form $y - y_1 = m(x - x_1)$, where $(x_1, y_1)$ is the point $(-2, 4)$.
$$
y - 4 = \dfrac{1}{3}(x - (-2)) = \dfrac{1}{3}(x + 2)
$$
- Simplify the equation:
$$
y - 4 = \dfrac{1}{3}x + \dfrac{2}{3}
$$
$$
y = \dfrac{1}{3}x + \dfrac{2}{3} + 4
$$
$$
y = \dfrac{1}{3}x + \dfrac{2}{3}+\dfrac{12}{3}
$$
$$
y = \dfrac{1}{3}x + \dfrac{14}{3}
$$
So, the equation of the line parallel to $y = \dfrac{1}{3}x - 3$ passing through $(-2, 4)$ is:
$$
y = \dfrac{1}{3}x + \dfrac{14}{3}
$$
---
**Step 3**: Find the equation of the line perpendicular to $y = \dfrac{1}{3}x - 3$.
- Perpendicular lines have slopes that are negative reciprocals of each other.
- The slope of the given line is $m = \dfrac{1}{3}$, so the slope of the perpendicular line is:
$$
m_{\perp} = -3
$$
- Again, use the point-slope form $y - y_1 = m(x - x_1)$ with the point $(-2, 4)$.
$$
y - 4 = -3(x - (-2)) = -3(x + 2)
$$
- Simplify the equation:
$$
y - 4 = -3x - 6
$$
$$
y = -3x - 6 + 4
$$
$$
y = -3x - 2
$$
So, the equation of the line perpendicular to $y = \dfrac{1}{3}x - 3$ passing through $(-2, 4)$ is:
$$
y = -3x - 2
$$
---
**Final Answer**:
- The equation of the parallel line is:
$y = \dfrac{1}{3}x + \dfrac{14}{3}$
- The equation of the perpendicular line is:
$y = -3x - 2$
Graph:

:::
### Example 12 Write the equation of the line through $(1,4)$ parallel to $y=3$. Then write the equation of the line through $(1,4)$ perpendicular to $y=3$. Graph.
::: spoiler
<summary> Solution:</summary>
**Step 1**: Identify the nature of the given line $y = 3$.
- The equation $y = 3$ is a horizontal line passing through $y = 3$ on the y-axis, with a slope of $m = 0$.
---
**Step 2**: Find the equation of the line parallel to $y = 3$.
- Parallel lines to a horizontal line must also be horizontal, meaning they will have the same slope $m = 0$.
- Since the line passes through the point $(1, 4)$, the equation of the parallel line is simply $y = 4$ because a horizontal line through $(1, 4)$ will always have a constant $y$-value of $4$.
Thus, the equation of the parallel line is:
$$
y = 4
$$
---
**Step 3**: Find the equation of the line perpendicular to $y = 3$.
- Perpendicular lines to horizontal lines are vertical.
- A vertical line passing through $(1, 4)$ will have a constant $x$-value of $x = 1$, as vertical lines don't change their $x$-value.
Thus, the equation of the perpendicular line is:
$$
x = 1
$$
---
**Final Answer**:
- The equation of the parallel line is:
$y = 4$
- The equation of the perpendicular line is:
$x = 1$
---
**Graph**:
- The line $y = 4$ is a horizontal line that crosses the $y$-axis at $y = 4$.
- The line $x = 1$ is a vertical line that crosses the $x$-axis at $x = 1$.

:::