....You can now, apply the formula to find the distance.
Alternatively, try not to think of 'formulas' and take a more practical approach to understanding this problem. Such an approach comes especially in the future, when understanding topics such as locus, coordinate geometry, etc.
How do you find the distance between, say , where you're standing and the nearest door? You could measure it using a ruler, counting feet, palm measures, etc. Now try to imagine yourself and the door positioned on the graph, where positions are relative to the origin
)
. Believe it or not, this makes measuring all that bit easier for you. Your position is
)
. The doors position is
)
and it's exactly 1 unit above you, but some unknown distance to the right or left of you. You can find the vertical distance from yourself and the door since you know yours and it's y-coordinates. To find this vertical distance you simply subtract the doors y-coordinates from your own y- coordinates. That means:

. Thus, the door is exactly two units above you. You can apply the same approach to find the horizontal distance between you and the door. That means:

is the horizontal distance between you and the door. This might scare you at first since you don't know what a is, but all is well still because the question asks to find an expression for the distance "in terms of the given variables". The given variable in this case is

.
Now think about the information that you have gathered. You've got the vertical and horizontal distances between you and the door. You should be able to imagine a right angle triangle, at least in terms of distances between the points. If

being an 'unknown' is preventing you from doing this just imagine it to be any close point along the x-axis. The thing that should ring a bell now is the 'Pythagorean Theorem'. This allows you to find the hypotenuse of a triangle. The hypotenuse, in our case, is the distance between you and the door. So if you substitute the values for horizontal & vertical distances, the hypotenuse should equate to:
^2 + (horizontal distance)^2})
^2 + (2-a)^2})
