Inscribed square in acute triangle

geometrytriangles

enter image description here

Given acute triangle $ABC$
with the side lengths
$|BC|=a$,
$|AC|=b$,
$|AB|=c$,
$\angle CAB=\alpha$,
$\angle ABC=\beta$,
$\angle BCA=\gamma$.

A square $C_0C_1C_2C_3$,
inscribed in $\triangle ABC$,
is diagonally oriented along the bisector $CC_0$.

Question: Find the side length $q$ of the inscribed square.

Interesting, that even for a simple questions like this,
there are several ways to tackle it
and strangely, this is not the simplest one that first comes to mind.

The first attempt was to apply the cosine rule
for $\triangle AC_0C_1$
(equivalently, $\triangle BC_3C_0$)
to get $q^2$:

\begin{align}
\triangle AC_0C_1:\quad
q^2&=|AC_1|^2+|AC_0|^2-2\cdot|AC_1|\cdot|AC_0|\cos\alpha
\tag{1}\label{1}
.
\end{align}

Indeed, the angle $\alpha$ is given,
using
the
Angle bisector theorem,
we can easily find that

\begin{align}
|AC_0|&=c_1=\frac{bc}{a+b}
\tag{2}\label{2}
,
\end{align}

and
\begin{align}
|AC_1|&=|AC|-|CC_1|
=b-\frac{|C_1C_4|}{\sin\tfrac\gamma2}
=b-\frac{q}{\sqrt2\sin\tfrac\gamma2}
\tag{3}\label{3}
.
\end{align}

Combination of \eqref{1}-\eqref{3}
results in a quadratic equation in $q$,
and of course, provides a solution,
but it's a monstrous expression,
and there are two of them,
which means that one more step is needed
to distinguish the correct one.

This is a self-answered question
and another approach which
happens to be much simpler,
is shown in the answer below,
but if you see
yet another simpler
(or, on the contrary, some other overcomplicated one)
way of solving it,
please add your answer(s).

Best Answer

A known expression for the length of bisector is

\begin{align} |CC_0|&=\frac{2ab\cos\tfrac\gamma2}{a+b} . \end{align}

On the other hand, \begin{align} |CC_0|&=|CC_2|+|C_2C_0|= \frac{q}{\sqrt2}\cot\tfrac\gamma2 +\frac{q}{\sqrt2} = \tfrac{\sqrt2}2 q(1+\cot\tfrac\gamma2) , \end{align}

so we have

\begin{align} q&= \frac{2\sqrt2 ab\cos\tfrac\gamma2}{(a+b)(1+\cot\tfrac\gamma2)} \\ &=\frac{\sqrt2 ab\sin\gamma}{(a+b)(\sin\tfrac\gamma2+\cos\tfrac\gamma2)} \\ &=\frac{\sqrt2 ab\sin\gamma}{(a+b)\sqrt{1+\sin\gamma}} . \end{align}