There are a couple ways we can get the equation of a line, depending on what we're given.
Most linear equations are organized in slope-intercept form:
[tex]y=mx+b[/tex]
The slope of a line can be calculated algebraically when we know two points that fall on the line:
[tex]m=\dfrac{y_2-y_1}{x_2-x_1}[/tex]
The y-intercept is the value of y when the line crosses the y-axis, or when x = 0. When given a graph, you can sometimes read the y-intercept directly from the graph.
For instance, if the line passes through the point (0,5), then the y-intercept is 5.
You can also find the y-intercept algebraically if you know the slope and one point that falls on the line. You plug in that point as (x,y) and isolate b.
For most cases, you can use the following method to find the equation of a line: