Given the sides of triangle $ABC$. Determine the lengths of $DA$ and $DC$ such that the quadrilateral $ABCD$ is both a cyclic quadrilateral and a tangential quadrilateral. $(AB=20, BC=40, CA=49)$.
Let the lengths of segments $AB, BC, CD, DA, AC$ be denoted by $a$, $b$, $c$, $d$, $e$ respectively. The quadrilateral $ABCD$ is a tangential quadrilateral if and only if $a+c=b+d$, or in other words, the differences $a-b$ and $d-c$ are equal. Let's denote this common value by $k$; since $a, b$ are given, $k$ is also known:

$$
a-b=d-c=k
$$

This is the necessary and sufficient condition for $ABCD$ to be a tangential quadrilateral.

The quadrilateral $ABCD$ is a cyclic quadrilateral if and only if the angles at $B$ and $D$ in triangles $ABC$ and $ADC$ respectively sum up to $180^{\circ}$. This is precisely the case when the sum of the cosines of these two angles is 0:

$$
\frac{a^{2}+b^{2}-e^{2}}{2 a b}+\frac{c^{2}+d^{2}-e^{2}}{2 c d}=0
$$

If we can find values of $c$ and $d$ that satisfy both (1) and (2), a corresponding quadrilateral can be constructed, and these values of the sides will ensure that the equations are satisfied.

![](https://cdn.mathpix.com/cropped/2024_05_02_6b2ab925bf9da834fe0dg-1.jpg?height=572&width=591&top_left_y=760&top_left_x=759)

The unknowns $x_{1}=c$ and $x_{2}=-d$ sum to $-k$ according to (1), and their product $s=x_{1} x_{2}$ satisfies (2):

$$
\left(k^{2}-2 s-e^{2}\right) a b=s\left(a^{2}+b^{2}-e^{2}\right)
$$

which simplifies to

$$
s=a b \frac{(a-b)^{2}-e^{2}}{(a+b)^{2}-e^{2}}
$$

Since $a, b, e$ are the sides of a triangle, we have $|a-b|<e<a+b$, so the numerator on the right-hand side of (3) is negative, and the denominator is positive. Therefore, the quadratic equation

$$
x^{2}+k x+s=0
$$

always has two real roots, one positive and one negative. In our case, the positive root can only be $x_{1}=c$, and the negative root can only be $x_{2}=-d$, so

$$
c=-\frac{k}{2}+\sqrt{\left(\frac{k}{2}\right)^{2}-s}, \quad d=+\frac{k}{2}+\sqrt{\left(\frac{k}{2}\right)^{2}-s}
$$

where the value of $k$ is determined by (1), and the value of $s$ by (3). Since these values satisfy (1) and (2), the problem always has exactly one solution.

Given the values, $k=-20$,

$$
\begin{aligned}
& \left(\frac{k}{2}\right)^{2}-s=100-20 \cdot 40 \cdot \frac{20^{2}-49^{2}}{60^{2}-49^{2}}=1435.1125 \\
& c=10+37.88=47.88, \quad d=-10+37.88=27.88
\end{aligned}
$$