Given the segments $a$ and $b$, how to construct the segment $p=\sqrt{ab}$
This question is from geometry textbook. At the back of the book, there is a hint to solve the problem but anyways the hint didn't help me. I couldn't understand the hint itself. Here is the hint they gave:
First construct the segment $c=\frac{a+b}{2}$ and the segment $d=\frac{|a-b|}{2}$. Then the segment that you are trying to find will be equal to $x=\sqrt{c^2-d^2}$.
As this question is from the Pythagorean theorem topic, I thought it is somehow related to $c^2=a^2+b^2$, but I couldn't make any connections.
Can you please help me understand the hint they gave and the problem itself?
