The equation is perpendicular to the line y = x. The line y = x has a slope 1. As perpendicular lines have slopes which are negative reciprocals the slope of the required line is -1. The equation of the line is x + y + k = 0
The required line passes through a point which is at a distance 3*sqrt 2 from (4,1).
We use the relation for determining the distance d of a point (x1, y1) from the line ax+by +c = 0, which is:
d = |ax1+by1+c|/ sqrt (a^2+b^2)
=> 3*sqrt 2 = | 4 + 1 + k|/sqrt 2
=> 5 + k = 3*2 = 6
=> k = 1
Therefore the equation of the required line is x + y + 1 = 0.