how do you do an equation on the straight line graph?how to show it the graph also.....sumtimes question cums like to do it using the graph

Expert Answers
lfryerda eNotes educator| Certified Educator

To find the equation of a staright line using a graph, we need any two points on the graph.  Then we can find the slope of the line.  Finally, using one of the points from the graph and the slope, you find the equation of the line.

For example, consider the graph

We can find any two points from this graph.  Let's pick the points `(-1,-3)` and `(2,3)`. It doesn't matter which two points we pick, since it will always get the same equation as long as your calculations are correct.

To find the slope of the line, use the formula `m={y_2-y_1}/{x_2-x_1}`.  In this case, that gives





Now we substitute one of the points (it doesn't matter which one) into the equation of a line `y=mx+b` and solve for b.

In this case we have `3=2(2)+b` which we can solve


Which means the equation of the line is `y=2x-1`.