# How To Find The Equation Of A Line?

The equation of a line is an essential requirement for the students while doing a geometric or trigonometric problem. There are two ways to find the equation for a line. Either you are given the two points on the line, or you are given one point along with the slope for the line. In either way, you have to use some basic formulas to get the equation for the line. Finding the equation might be a little tricky but not that hard if you follow the right path. Let’s explore the methods to find the equation of a line on given different conditions.

Situation 1 (While the two points of a line are given):

This is the situation where you have the two points of the straight line and nothing else. To find the equation of the line, first, you have to find the slope the line using the two points given. The formula to find the slope is, m = (y2-y1)/(x2-x1).

Suppose we have coordinates (5, 6) and (7, 12). If we assign each coordinates with x2, x1, y2, y1, then we have,

m = (y2-y1)/(x2-x1)

= (12-6)/(7-5)

= 6 / 2

= 3

Hence, the slope of the line is 3. Now that we have the slope of the line we can proceed with the steps to find the equation. In this step, we will use the slope-intercept formula. Which is, y = mx + b

Here, m = The slope of the line

b = The y-intercept of the line

As we have already got the value for m, replace the value of m in the equation. Now the equation will be,

y = mx + b

= 3 X  x + b

= 3x + b

=> y = 3x + b

As we have an equation now, let’s proceed with the steps. Take any of the two points and replace the x & y with respect values. We have two points, i.e. (5, 6) and (7, 12). If we take the first point and replace the values of x & y, then the equation will be,

y = x + b

=> 6 = 5 + b

Now solving the equation we will try to find the value of b.

5 + b = 6

=> b = 6 – 5 = 1

Hence the value of b is 1. Now, that we have the y-intercept & the slope of the line let’s plug in the values in the slope-intercept formula to finish the equation. After replacing the values, the equation will be,

y = mx + b where, m = 3 & b = 1

=> y = x X 3 + 1

=> y = 3x + 1

The final equation is y = 3x + 1.

Situation 2 (While one point & the slope of a line are given):

As we have one point and the slope of the given line in this situation, we’ll be using the point-slope formula to find the equation of the line. The point-slope formula is, (y – y1) = m(x – x1).

Where (x, y) & (x1, y1) are the two points and m is the slope of the line. As we have already the value of the slope and the value of one point, replace them from the equation with its value.

Let’s say, the value of the slope is 2 and the value of one point is (6, 5). After replacing the value we have,

(y – y1) = m(x – x1)

=> (y – 5) = 2 (x – 6)

=> y -5 = 2x – 12

=> y = 2x – 12 + 5

=> y = 2x – 7

=> 2x – y – 7 = 0

Hence the final equation for the line is 2x – y – 7 = 0.