First we need to find the equation of the line l passing through the points (2, 4) and (5, 1).
The equation of a line is expressed as y = mx+c
m is the slope
c is the intercept
m = y2-y1/x2-x1
m = 1-4/5-2
m = -3/3
m = -1
Get the intercept
Substitute any point (2, 4) and the slope m = -3 into the expression y = mx + c
4 = -3(2)+c
4 = -6 + c
c = 4+6
c = 10
The equation of line l is y = -3x+10
Next is to find the equation of the line w perpendicular to the line l, through P(1, 1).
Since the line w is perpendicular to lin