Two circles inscribed in isosceles triangle $$\triangle ABC :AC =BC$$
$$P \in AB$$
$k(O;r)$ is inscribed in $\triangle APC$; $k_2(O_2; r_2)$ is inscribed    in $\triangle BPC$; 
$D, G$ are points of contact of the circles with $CP$.

Show that $DG=\frac {|AP - BP|}{2}$.

I think that it will be helpful if we find point $A_1$, such that $BA_1 = AP$. Now we have to prove $2DG=PA_1$.

 A: 
Let $|AC|=|BC|=a$, $|AB|=c$,
$|AP|=m$, $|CP|=d$.
\begin{align} 
|CD|&=|CE|=a-|AE|
,\quad |CG|=|CF|=a-|BF|
,\\
|DG|&=\Big||CD|-|CG|\Big|
=
\Big|a-r\cot\tfrac\alpha2-(a-r_1\cot\tfrac\alpha2)\Big|
=
\left|r\cot\tfrac\alpha2-r_1\cot\tfrac\alpha2\right|
\\
&=
\Big|r\cdot\frac{a+m-d}{2r}-r_1\cdot\frac{a+c-m-d}{2r_1}\Big|
=\Big|m-\tfrac12 c\Big|
=\tfrac12\Big||AP|- |BP|\Big|
.
\end{align} 
A: Hint: 
Use the following fact/theorem. 
If $ZX$ and $ZY$ are tangents from $Z$ to a circle so that $X,Y$ are touching points, then $ZX = ZY$.
Now it sholud be easy.
Another hint: Try to prove $$PG= PK = {PB+PC-BC\over 2}$$
A: (1) Theorem:-       Let A’B’C’ be any triangle with corresponding sides a’, b’, c’ and its semi-perimeter = s’. If its in-circle touches A’B’ at M’, then A’M’ = s’ – a’.
(2) Construct the in-circle of $\triangle ABC$ so that it touches AB at M. To make things a bit easier, I assume the left circle ( in red) is larger than the right circle. Then, CD is on the right side of the median CM.

(3) From theorem (1), after some algebra, we will get IM = PK.
(4) DG = PG – PD = PI – PK = PI – IM = PM 
(5) Result follows from the fact that 2PM = AP – BP
