y-4=m(x-1) is the point-slope form of the equation of the line.
y=mx-m+4 is the slope-intercept form of the line. y-intercept=4-m.
When y=0, -4=m(x-1), and the x-intercept is 1-4/m.
The sum of the intercepts is 4-m+1-4/m=5-m-4/m.
Differentiate wrt m: -1+4/m2. This is zero (max or min) when 4/m2=1, so m=2 or -2.
x+y=5-2-4/2=1 or 5+2+4/2=9. Therefore m=2.
y-4=2(x-1), y=2x-2+4=2x+2. x-intercept is -1 and y-intercept is 2.