We have learnt how to write a linear equation in the form \(y=mx+b\) where \(m\) is the slope and \(b\) is the y-int. Essentially, we need to determine both the slope and y-int to write the equation.

To find the slope of the line we can use the following strategies:

- The slope is given in the question.
- We can calculate the slope using two points on the line using \( m = \cfrac{y_2 - y_1}{x_2 - x_1}\)
- The slope is parallel to another line so the slopes are equal.
- The slope is perpendicular to another line so we use the negative reciprocal: \( \cfrac{-1}{m} \)

To find the y-int, we can use the following strategies:

- The y-int is given in the question.
- Solve for the slope first and then plug in a point \( (x,y) \) to solve for the y-int.

Let's practice a couple scenarios:

## Given slope, y-intercept

We can write the equation directly using the slope-intercept form:

Find the equation of the line knowing its slope is -3 and y intercept is 5.

Show Answer
We are given both the slope and y-int. Simply plug them into the equation of a line:

\(y = -3(x) + 5\)

Find the equation of the line knowing its slope is 5 and y intercept is -2.

Show Answer
We are given both the slope and y-int. Simply plug them into the equation of a line:

\(y = 5(x) - 2\)

## Slope and 1 point

Plug in the slope and point to solve for the y-int.

Find the equation of the line given its slope as 3 and pass through the point (2,4).

Show Answer
\(y = 3(x) + b\)

\(4 = 3(2) + b\)

\(4 = 6 + b\)

\(4 - 6 = b\)

\(-2 = b\)

\(y = 3(x) - 2\)

Find the equation of the line given its slope as 5 and pass through the point (1,3).

Show Answer
\(y = 5(x) + b\)

\(3 = 5(1) + b\)

\(3 = 5 + b\)

\(3 - 5 = b\)

\(-2 = b\)

\(y = 5(x) - 2\)

## Parallel/Perpendicular Lines

Remember that when dealing with parallel and perpendicular lines, **parallel** lines have **same** slope while **perpendicular** lines have **negative reciprocal** slope.

Write the equation of the lines that are parallel and perpendicular to the equation \(y = 2(x) + 1\) and pass through the point (1, 5).

Show Answer
For parallel lines, the slope is the same: \( m = 2\). Plug in the point and solve for \(b\):

\(5 = 2(1) + b\)

\(b = 3\)

\(y = 2(x) + 3\)

For perpendicular lines, the slope is the negative reciprocal: \( m = \cfrac{-1}{2}\). Plug in the point and solve for \(b\):

\(5 = \cfrac{-1}{2}(1) + b\)

\(b = (5) + \cfrac{1}{2}\)

\(y = \cfrac{-1}{2}(x) + (5)\cfrac{1}{2}\)

Write the equation of the lines that are parallel and perpendicular to the equation \(y = 5(x) - 3\) and pass through the point (2, -1).

Show Answer
For parallel lines, the slope is the same: \( m = 5\). Plug in the point and solve for \(b\):

\(-1 = 5(2) + b\)

\(b = -11\)

\(y = 5(x) - 11\)

For perpendicular lines, the slope is the negative reciprocal: \( m = \cfrac{-1}{5}\). Plug in the point and solve for \(b\):

\(-1 = \cfrac{-1}{5}(2) + b\)

\(b = -1 + \cfrac{2}{5}\)

\(b = \cfrac{-3}{5}\)

\(y = \cfrac{-1}{5}(x) - \cfrac{3}{5}\)

## Two points

When given two points, calculate the slope using the slope formula:

\( m = \cfrac{y_2 - y_1}{x_2 - x_1}\)

Find the equation of the line given the points (3, -5) and (6, 2).

Show Answer
First find the slope using the two points:

\(m = \cfrac{2-(-5)}{6-3}\)

\(m = \cfrac{7}{3}\)

Now to find the y-intercept, we can just plug in one point.

\(-5 = \cfrac{7}{3}(3) + b\)

\(-5 = -7 + b\)

\(b = -12\)

Now we have the equation: \(y = \cfrac{7}{3}(x) - 12\)

Find the equation of the line given the points (1, 3) and (2, -2).

Show Answer
First find the slope using the two points:

\(m = \cfrac{-2 - 3}{2 - 1}\)

\(m = \cfrac{-5}{1}\)

Now to find the y-intercept, we can just plug in one point.

\(3 = -5(1) + b\)

\(b = 8\)

Now we have the equation: \(y = -5(x) + 8\)