The formula for calculating the distance between two points is:

#d = sqrt((color(red)(x_2) - color(blue)(x_1))^2 + (color(red)(y_2) - color(blue)(y_1))^2)#

Substituting the values from the problem gives and solving for #a# gives:

#4 = sqrt((color(red)(a) - color(blue)(1))^2 + (color(red)(1) - color(blue)(1))^2)#

#4 = sqrt((color(red)(a) - color(blue)(1))^2 + 0^2)#

#4 = sqrt((color(red)(a) - color(blue)(1))^2 + 0)#

#4 = sqrt((color(red)(a) - color(blue)(1))^2#

#4 = color(red)(a) - color(blue)(1)# and #4 = -(color(red)(a) - color(blue)(1))# (Note: The square root of a term always produces a negative and positive result)

Solution 1)

#4 = a - 1#

#4 + color(red)(1) = a - 1 + color(red)(1)#

#5 = a - 0#

#5 = a#

#a = 5#

Solution 2)

#4 = -(a - 1)#

#4 = -a + 1#

#4 - color(red)(1) = -a + 1 - color(red)(1)#

#3 = -a + 0#

#3 = -a#

#color(red)(-1) xx 3 = color(red)(-1) xx -a#

#-3 = a#

#a = -3#

Solution: #a# can be either #5# or #-3#