how do I write the slope of a line containing points (-2,0) (-2,8)

2 answers

slope = (y2-y1)/(x2-x1)=(8-0)/(-2+2) =8/0= infinity
The slope is indeed infinity, or more correctly, undefined. The line is parallel to the y-axis.

However, the equation of a line containing ANY two defined non-coincident points in the real domain can be found using the following formula that does not require division:

(y-y1)(x2-x1)=(x-x1)(y2-y1)

Applying the formula to P1(-2,0) P2(-2,8), we get
(y-0)(-2-(-2))=(x-(-2))(8-0)
0y=8(x+2)
Eliminating 0y and factoring out the 8, we get
x+2=0
as the equation of the line which has a slope of "infinity" or undefined.

The only trouble with the equation is it is not very easy to memorize.