<s>[INST] Find the length of $x$. Let $ABC$ be a right angled triangle right-angled at $B$. The angle bisectors of angles $A$ and $C$ are drawn, intersecting the opposite sides at $D$ and $E$ respectively. Given that $CD=12$ and $AE=8$ find the length of $AC$ (which was given as $x$ in the question). Furthermore, let the points at which the incircle is tangent to the side $AB$ and $BC$ be $F$ and $G$ respectively. (Diagram given at end of question)
I tried two approaches:
Approach 1 : I tried to use trigonometry for this one. Let $\angle BAO= \alpha$. And let $r$ be the magnitude of inradius of the triangle $ABC$. Also let $EF=y$ and $DG=z$. Then in $\triangle AGO$ and $\triangle OEG$, $z=r \tan \alpha$ and $z=\frac{r}{\tan \left(\frac{\pi}{4}-\alpha \right)} - 12 $. Combing both of them I get this:
$$12=r \left( \frac{1}{\tan \left(\frac{\pi}{4}-\alpha \right)}- \tan \alpha \right)  $$
Similarly in $\triangle AGO$ and $\triangle OFD$ :
$$8= r \left( \dfrac{1}{\tan \alpha} - \tan \left( \frac{\pi}{4} - \alpha\right) \right)$$
Dividing those two equations and simplifying by letting $t=\tan \alpha$, I get the following expression:
$t^3+4t^2-2t+2=0$ which has an extremely horrifying solution, so I left it.

Edit: I am a complete fool and did the calculations wrong: after dividing it simplifies to $(2t-1)(t+3)=0$ after which it immediately follows that $x=24$.
Approach 2 (incomplete) : So instead of using trigonometry, I tried to use elementary techniques this time. Since $\triangle AFO \sim \triangle OGD$, we get
$$\frac{r}{y}=\frac{z+12}{r} \implies r^2 = y(z+12)$$
Similarly $r^2=z(8+y)$. Combining those two, we get $3y=2z$. The value of $x=20+y+z$. Now only if I could find $y+z$ the question would be finished. Would please anybody give any hint or could provide a better solution?
Diagram of original question: 
Labelled diagram: 
 [/INST] Let $BC=a$, $AB=c$ and $a=tc$.
Thus, since $\frac{cx}{x+a}=8$ and $\frac{ax}{x+c}=12,$ we obtain:
$$\frac{a(x+a)}{c(x+c)}=\frac{3}{2}$$ or
$$\sqrt{a^2+c^2}(2a-3c)=3c^2-2a^2$$ or
$$\sqrt{t^2+1}(2t-3)=3-2t^2,$$ which gives $$\sqrt{1.5}<t<1.5$$
Now, after squaring we obtain:
$$t(4t-3)(3t-4)=0,$$ which gives $$t=\frac{4}{3},$$
$$a=\frac{4}{5}x$$ and $$c=\frac{3}{5}x,$$ which gives $x=24.$
</s>