We draw CL perpendicular to AB. In triangle CLB, write the Pythagorean theorem and find r.
[math]\left(2r\right)^2+\left(a-b\right)^2=\left(a+b-2r\right)^2\Rightarrow[/math][br][math]4r^2+a^2-2ab+b^2=a^2+b^2+4r^2+2ab-4ar-4br\Rightarrow[/math][br][math]4ar+4br=4ab\Rightarrow r\left(a+b\right)=ab[/math][br][math]r=\frac{ab}{a+b}[/math]