First, we check that the three points are collinear.
Given three points (x1,y1), (x2,y2), and (x3,y3), then the three points are collinear if the following condition is satisfied.
[tex]\frac{y_2-y_1}{x_2-x_1}=\frac{y_3-y_1}{x_3-x_1}[/tex]In our case, we can set
(x1,y1) =(-2,0), (x2,y2) = ( 4, 18)and (x3,y3) = (5, 21)
[tex]\begin{gathered} \text{ Then, we have} \\ \frac{y_2-y_1}{x_2-x_1}=\frac{18-0}{4-(-2)}=\frac{18}{4+2}=\frac{18}{6}=3 \end{gathered}[/tex]And
[tex]\frac{y_3-y_1}{x_3-x_1}=\frac{21-0}{5-(-2)}=\frac{21}{5+2}=\frac{21}{7}=3[/tex]Hence
[tex]\frac{y_2-y_1}{x_2-x_1}=\frac{y_3-y_1}{x_3-x_1}[/tex]Therefore, the points (-2,0), ( 4, 18), and (5, 21) are collinear.
Given two points (x1,y1) and (x2,y2) on the Cartesian plane, then the gradient, m, of the line that passes through them is given by
[tex]m=\frac{y_2-y_1}{x_2-x_1}[/tex]Then, the gradient of the line passing through (-2,0), ( 4, 18) is 3
Given a point (x1,y1) on the Cartesian plane, and a line that passes through the point with gradient, m, then the equation of the line is given by
[tex]y-y_1=m(x-x_1)[/tex]Therefore,
[tex]y-0=3(x-(-2)=3(x+2)[/tex]That is the equation is
[tex]y=3x+6[/tex]