7. On side $BC$ of triangle $ABC$, a point $K$ is marked such that $AK=8$, $BK=24$, $KC=3$. A circle is circumscribed around triangle $ABK$. A line through point $C$ and the midpoint $D$ of side $AB$ intersects the circle at point $P$, with $CP > CD$. Find $DP$ if $\angle APB = \angle BAC$.
# Solution:

![](https://cdn.mathpix.com/cropped/2024_05_06_50f0bbe00f908a027b9ag-13.jpg?height=757&width=1063&top_left_y=338&top_left_x=605)

$\angle A P B = \angle B A C, \angle A P B = \angle A K C, \angle A K C = \angle B A C, \angle K A C = \angle A B C$. Segment $A C$ is a tangent to the circle.

$\triangle A B C \approx \triangle A K C \Rightarrow$

$\frac{A B}{A K} = \frac{A C}{K C} = \frac{B C}{A C} \Rightarrow \frac{A B}{8} = \frac{A C}{3} = \frac{27}{A C} \Rightarrow A C = 9, \quad A B = 24$.

$C D$ is a median $\Rightarrow$ by the cosine rule for triangles $A D C$ and $B D C$ we have

$A C^{2} = A D^{2} + C D^{2} - 2 A D \cdot C D \cos \angle A D C, \quad B C^{2} = B D^{2} + C D^{2} + 2 B D \cdot C D \cos \angle A D C$.

Since $A D = B D$, then $A C^{2} + B C^{2} = 2 A D^{2} + 2 C D^{2}$, $C D^{2} = \frac{1}{2} \left( A C^{2} + B C^{2} \right) - A D^{2} = \frac{1}{2}(81 + 729) - 144 = 261, C D = 3 \sqrt{29}$.

Let $D P = x, D N = y (N$ - the intersection point of line $C D$ with the circle, $N \neq P)$. Quadrilateral $A N B P$ is inscribed in the circle $\Rightarrow A D \cdot D B = P D \cdot B T, 144 = x y$.

By the properties of tangents and secants to the circle, we have $C N \cdot C P = A C^{2}, (C D - y) \cdot (C D + x) = A C^{2}, (3 \sqrt{29} - y) \cdot (3 \sqrt{29} + x) = 81$.

Solving the system of equations $144 = x y, \quad (3 \sqrt{29} - y) \cdot (3 \sqrt{29} + x) = 81 \Rightarrow y = \frac{12}{\sqrt{29}} + x \Rightarrow$ $x^{2} + \frac{12}{\sqrt{29}} x - 144 = 0, x = \frac{-6 + 18 \sqrt{13}}{\sqrt{29}}, D P = \frac{-6 + 18 \sqrt{13}}{\sqrt{29}}$.

Answer: $\frac{-6 + 18 \sqrt{13}}{\sqrt{29}}$.