# The length of the segment which joins $C$ to the hypotenuse of the triangle and which bisects the angle at $C$ is

GIven a right triangle $ABC$ with right angle at the point $C$ and legs of length $a$ and $b$,the length of the segment which joins $C$ to the hypotenuse of the triangle and which bisects the angle at $C$ is given by the formula
$(A)\frac{ab}{\sqrt{a^2+b^2}}\hspace{1cm}(B)\frac{a+b}{2\sqrt{2}}\hspace{1cm}(C)\frac{\sqrt2ab}{\sqrt{a^2+b^2}}\hspace{1cm}(D)\frac{ab\sqrt2}{a+b}$

My method:
Let $BC=a,AC=b$,
Let$CD$ is the segment whose length we need to find out.
As $CD$ is an angle bisector,so $BD=\frac{a}{a+b}\sqrt{a^2+b^2},AD=\frac{b}{a+b}\sqrt{a^2+b^2}$,
Now applying cosine rule in the triangle $BCD$,
$\cos45=\frac{a^2+CD^2-BD^2}{2a\times CD}$
Simplifying this will give us a quadratic equation in $CD$
$CD^2-\sqrt2aCD+\frac{2a^3b}{(a+b)^2}=0$
Solving this we get $CD=\frac{\sqrt2a^2}{(a+b)^2},\frac{\sqrt2ab}{(a+b)^2}$

I want to ask,Is there any other better method possible which has less lengthy calculations.In my method calculations were lengthy.Thanks.

Since $\triangle CBA = \triangle CDB + \triangle CAD$, we have $$\frac{1}{2} a \cdot CD \cdot \sin 45 + \frac{1}{2} b \cdot CD \cdot \sin 45 = \frac{1}{2} ab$$
This gives $$CD=\frac{\sqrt{2}ab}{a+b}$$