My Physics teacher gave me a problem and its solution, what I have todo is to expand the solution, but when I do it I do not get to the same solution he says is the right one, here is the problem:
We cut off a rectangle ABCD along the line DE through the corner D, so when we suspend the plate ABED from the point E the line DA, is on horizontal position. Calculate the magnitude EB

The image below is the solution, What I am not able to figure out is how the teacher solved the polynomial division and get to that result.

Any help is appreciated
You do not need to do polynomial division