That is the actual solution but my solution doing the distance by two points formula I got:
Obviously, they are 2 different answers but I think the logic behind what I did wasn't wrong.
How are you sure that the distance AE is in fact the perpendicular distance from A to line BE?
Gradient of line AE = -5/2 (if I were to construct a line)
Gradient of BE = 5
since -5/2 * 5 =/= -1, that means line AE and line BE cannot be perpendicular. Hence, the distance A to E cannot be perpedicular distance to line BE.
Your answer of sqrt29 is also greater than the given solution, which indicates that it's not the perpendicular distance.
A way for you to use pythagoras theorem is to find equation BE (already done) which allows you to find the gradient of perpendicular line to BE. You can then find equation of perpendicular line to BE passing through A. Solve those two equations together to find point X (poi) and then use pythag for AX (which will be the perpendicular distance.)