First, you must determine the slope of the line. The slope can be found by using the formula: #m = (color(red)(y_2) - color(blue)(y_1))/(color(red)(x_2) - color(blue)(x_1))#
Where #m# is the slope and (#color(blue)(x_1, y_1)#) and (#color(red)(x_2, y_2)#) are the two points on the line.
Substituting the values from the points in the problem gives:
#m = (color(red)(p-q) - color(blue)(-q))/(color(red)(p) - color(blue)(2p)) = (color(red)(p-q) + color(blue)(q))/(color(red)(p) - color(blue)(2p)) = (p - 0)/-p = p/-p = -1#
The point-slope formula states: #(y - color(red)(y_1)) = color(blue)(m)(x - color(red)(x_1))#
Where #color(blue)(m)# is the slope and #color(red)(((x_1, y_1)))# is a point the line passes through.
Now, substitute the slope you calculated and the values for the first point in the problem to give:
#(y - color(red)(-q)) = color(blue)(-1)(x - color(red)(2p))#
#(y + color(red)(q)) = color(blue)(-1)(x - color(red)(2p))#
Or, substitute the slope you calculated and the values for the second point in the problem to give:
#(y - (color(red)(p-q))) = color(blue)(-1)(x - color(red)(p))#