Explanation:
I assume the square root always goes across the whole expression, right ?
the calculation you provided is correct. there was nothing done wrong here.
so, I guess the mistake must have been made with the coordinate numbers in the first place.
since I don't see any graphic or the coordinates of the points, where clearly the distance has to be calculated, I cannot give you the details.
based on the calculation, the points would have been
A (2, -4)
B (6, 1)
and I guess the original coordinates must be different somehow.
otherwise it would all be correct.