In the figure, calculate x, knowing that $a^2+b^2=36$(S:$3$)

I try
$HF=HG=HB=r$ $AC^2 = AB^2+BC^2 \implies (2R)^2=(BF+a)^2+(BG+b)^2=BF^2+2aBF+a^2+BG^2+b^2+2bBG$
$4R^2=36+BF(2a+BF)+BF^2+BG^2+BG(2b+BG)=36+BF(2a+BF+BF)+BG(BG+2b+BG)$
$4R^2 = 36+BF(2a+2BF)+BG(2b+2BG)$
$4R^2=36+2BF(a+BF)+2BG(b+BG)=36+2(AB.BF+BC.BG)$


Draw parallelograms as in the picture. Then it becomes clear that $x$ is the median of a right triangle with legs $a$ and $b$. Hence $x=\frac 12\sqrt{a^2+b^2}=3$.