The slope of the line defined as the ratio of the change in y to the change in x between any two points on the line i.e.,
Slope = Change in y / Change in x
= (0 – 2) / (-2/3 – 0)
= 3
Therefore, the slope of the line is 3 which is making an intercept of 2 on y-axis. So, m is 3 and c is 2 and the equation of line from the graph is:
y = 3x + 2.
Example 2: Find the equation of the line having slope equal to 2 whose graph is shown below:

Solution:
From the given graph,
The slope(m) of the line is 2, and it is having y-intercept at (0,3).
So, the value of c = 3.
Putting the values of m and c, in the equation of line as:
y = mx +c
= (2)x + (3)
= 2x + 3
Hence, the equation of the line is: y = 2x + 3.
2. Slope-intercept equation from slope and a point
If the slope of the line is given which is passing through a point (x1, y1), then equation of line can be given as:
y – y1 = m(x – x1)
This form of the equation of a straight line is also known as “point-slope” form.
Example 1: Find the equation of a straight line passing through the point (3,2) having slope equal to 3.
Solution:
The graph for the straight line passing through the point (3,2) having slope equal to 3 is:

Given that,
Slope (m) = 3, and (x1, y1) = (3, 2)
The point-slope form is:
y – y1 = m(x – x1)
Now putting the values in the equation:
y – 2 = 3(x – 3)
= 3x – 9
y = 3x – 9 + 2
= 3x – 7
Hence, the equation of the line is: y = 3x – 7.
How can point-slope form be written as slope-intercept form?
Since, the slope-intercept form (i.e. y = mx + c) and point-slope form both are same equation but in different form.
The value of c (called the y-intercept) is where the line crosses the y-axis.
So point (x1, y1) is actually at (0, c) and the equation becomes:
y − y1 = m(x − x1)
(x1, y1) is actually (0, c): y − c = m(x − 0)
y − c = mx
y = mx + c
So, if one point on the line and the slope of the line is known, then the slope-intercept form as point-slope form can also be written.
Example 2: A line having slope, 4 and making its x-intercept at (5,0). Find its equation.
Solution:
Given that,
The slope (m) = 4, and (x1, y1) = (5, 0)
The point-slope form is:
y – y1 = m(x – x1)
Now putting the values in the equation:
y – 0 = 4(x – 5)
= 4x – 5
y = 4x – 5
Hence, the equation of the line is: y = 4x – 5.
3. Slope-intercept equation from two points
Example 1: Let’s consider a line passing through points (1, 3) and (3,7) as shown in the graph.

Determine the slope-intercept form of the line.
Solution:
According to two-point form of a straight line, slope of the line can be given as:
m = (y2 – y1) / (x2 – x1)
Substitute the given values in the above expression:
m = (7 – 3) / (3 – 1)
= 4/2
= 2
Now, substitute the value of m in slope-intercept form:
y = 2x + c
Now, y = 2x + c line passes through the points (1,3) and (3,7).
Substitute one of the coordinates in the equation:
y = 2x + c
3 = 2(1) + c
3 – 2 = c
c = 1
Thus, the equation of line is y = 2x + 1.
Example 2: Write the equation of the line passing through (4,7) and (6,13).
Solution:
Use the formula to find the slope between the two points.
Slope, (m) = (13 – 7) / (6 – 4)
= 6/2
= 3
Substitute 3 for m in the equation y = mx + c.
⇒ y = 3x + c
Substitute one of the coordinates in the above equation:
7 = 3(4) + c
c = -12 + 7
= -5
Therefore, the slope-intercept form is given as: y = 3x – 5
4. Constructing linear equations from the context
Now let’s learn how to construct linear equations from the word problems.
Example 1: The local water supply has a leak, it is losing 4 gallons of water every second. After 15 seconds, the water level is at 1024 gallons. Write an equation representing this situation.
Solution:
The above problem can be represented in slope-intercept form i.e. y = mx + c, where the y-axis denotes the level of water and x-axis denotes the time in seconds.
Now, the water level is changing at 4 gallons per sec.
And since,
Slope = Change in y / Change in x
Therefore,
Slope = 4 gallons / 1 sec
= 4
But here water supply has a leak, and it is losing 4 gallons per second, which means slope is decreasing, therefore slope of the line will be ‘-4’
Now, After 15 seconds, the water level was found to be at 1024 gallons.
So, by putting these values in y = mx + c, we get:
1024 gallons = (-4 gallons/ secs) × (15 secs) + c
1024 = -60 + c
c = 1084 gallons.
Now, putting the values of m and c to get the generalized equation of the line:
y = (-4) x + 1084
y = -4x + 1084
Hence, the above problem can be represented in a linear equation as: y = -4x + 1084
Example 2: Ram was hiking up a mountain. She started her hike at an elevation of 800 meters and ascended at a constant rate. After 5 hours, she reached an elevation of 1300 meters.
Solution:
Let y represent Ram’s elevation (in m) after x hours. Construct a linear equation for the relationship between elevation and number of hours.
Ram started her hike at 800 m, that means (0, 800) was her starting point. Looking closely at this point, the y-intercept of the graph between elevation (y-axis) and a number of hours (x-axis).
So, the value of c will be 800. Now, he is ascending at a constant rate and reaches 1300 m after 5 hours, i.e. he is at (1200, 5).
Now, using the two-point formula to find the slope of the line:
m = y2 – y1 / x2 – x1
= (1300 – 800) / (5 – 0)
= 500 / 5
= 100
Substitute 100 for m and 800 for c in the equation of slope-intercept form:
y = 100x + 800.
Conclusion
To find the slope-intercept form of the line, one is needed to find:
- The slope of the line and
- The y-intercept of the line
- Now, if a graph of a line whose slope is ‘1’ and y-intercept at (0,5) is given, simply substitute m = 1 and c = 5 into the slope-intercept form.
⇒ y = x + 5
- Suppose, it is required to find the equation of a line passing through (3, 2) and having slope = 3, use point-slope form [i.e. y – y1 = m(x – x1) ] to find the equation of the line. Substitute the given values: y – 2 = 3 (x – 3)
⇒ y = 3x – 7
- If a line is passing through two points, use two point form to find the equation of the line.
e.g.: if a line is passing through points (1,3) and (2,5) slope of the line can be given by:
⇒ m = (5-3) / (2-1)
= 2
Putting the value of m and one of the coordinate in y = mx + c we get:
y = mx + c
3 = (2)1 + c
c = 1
So, the equation of the line will be y = 2x + 1.