We have the line y = 9 - 4*x and the point (-4, 2). The distance from the point (-4, 2) to an arbitrary point (x, y) is:
d = sqrt[ (-4 - x)^2 + (2 - y)^2 ].
A point on the line will have y = 9 - 4*x so we can substitute for y:
d = sqrt[ (-4 - x)^2 + (2 - 9 + 4*x)^2 ] = sqrt[ (16 + 8x + x^2) + (49 - 56x + 16*x^2) ]
= sqrt[ 17*x^2 - 48*x + 65 ]
Taking the derivative we get:
d(d)/dx = (1/2)*(34*x - 48)
To find the minimum set the derivative to zero
34*x - 48 = 0 => x = 48/34 = 1.412
The corresponding y value is y = 9 - 4*x = 3.353 so the closest point on the line is:
(1.412, 3.353)