Step 1: Slope of lines
Let the three points be A(x,−1),B(2,1),C(4,5)
We know that slope of a line through the points (x1,y1) and (x2,y2) is m=y2−y1x2−x1
Slope of AB through the points (x,−1) and (2,1)
m=1−(−1)2−x
m=1+12−x
m=22−x
Slope of line BC through the points (2,1) & (4,5)
m=5−14−2
m=42
m=2
Step 2: Solve for value of x
If three points are collinear, then their slopes must be equal.
∴ Slope of AB= Slope of BC
⇒22−x=2
⇒2=2(2−x)
⇒x=1
Therefore, the value of x is 1