\documentclass[h4paper]{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\title{Find the Diameter}
\author{Amit Yaron}
\maketitle
Here's one nice problem from YouTube I haven't watched yet and am not going
to watch. The solver in the video is MathBooster. My way to deal with the
problem is to draw the most precise diagram I can. So, first I'll solve it,
and then I'll draw it. 
\subsection*{Description of the Problem}
There's a semi circle, and the end points of its diameter's chord are A and D.
Along the semi-circles's arc, there are also points B and C, sych that:
\begin{align*}
  &AB=BC=15\\
  &CD=7
\end {align*}
Let us add the point $O$ oin the middle of $AD$, so 
\[
  OA=OD
\]
is a radius of the semi-circle, let us call it $r$.
So,
\[
  r=OA=OB=OC=OD
\]
\section*{Adding Angles}
Now, let $\theta=\angle AOB$
\\ So, we have:
\begin{align*}
  &OA=OB\\
  &OB=OC\\
  &AB=BC=15\\
\end{align*}
Thus, we have 2 congruent triangles:
\[
  \triangle AOB \cong \triangle BOC
\]
which means that:
\[
  \angle AOB = \angle BOC = \theta
\]
And:
\[
  \angle AOB + \angle BOC + \angle COD = 180^{\circ}
\]
which means that:
\[
  \angle COD = 180^{\circ}-\angle BOC - \angle AOB=180^{\circ}-2\theta
\]
And knowing that $CD=7$, it's time to choose the trigonometric identity to 
use: in this case, the cosine law.
\subsection*{Using the Cosine Law} 
In triangle $\triangle AOB$:
\begin{align}
  &AB^2=AO^2+BO^2-2AO\cdot BO\cos(\angle AOB)\Rightarrow\nonumber\\
  \Rightarrow &15^2=r^2+r^2-2r^2\cos(\theta)\Rightarrow\nonumber\\
  \Rightarrow &15^2=2r^2(1-\cos(\theta))
\end{align}
and in triangle $\triangle COD$:
\begin{align}
  &CD^2=CO^2+DO^2-2CO\cdot DO\cos(\angle COD)\Rightarrow\nonumber\\
  \Rightarrow &7^2=r^2+r^2-2r^2\cos(180^{\circ}-2\theta)\Rightarrow\nonumber\\
  \Rightarrow &7^2=2r^2(1-\cos(180^{\circ}-2\theta)\Rightarrow\nonumber\\
  \Rightarrow &7^2=2r^2(1+\cos(2\theta))
\end{align}
For convenience, let us define $t=\cos(\theta)$, then:
\[
  \cos(2\theta)=\cos^2(\theta)-\sin^2(\theta)=\cos^2(\theta)-1+\cos^2(\theta)=
  2\cos^2(\theta)-1=2t^2-1
\]
Let us plug it into (1) and (2) and form the following  system:
\[\begin{cases}
  15^2=2r^2(1-t)\\
   7^2=2r^2(2t^2)
\end{cases}\]
Let us divide by $2r^2$m then:
\[\begin{cases}
  1-t=\frac{225}{2r^2}\\
  2t^2=\frac{49}{2r^2}
\end{cases}\]
Multiply yhe first equation by 49 and the second by 225"
\[\begin{cases}
  49-49t=\frac{49\cdot225}{2r^2}\\
  450t^2=\frac{49\cdot225}{2r^2}
\end{cases}\]
From both, we get that:
\begin{align*}
  &450t^2=49-49t\Rightarrow\\
  \Rightarrow &450t^2+49t-49=0\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{49^2-4\cdot450\cdot(-49)}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{49^2+4\cdot450\cdot(49)}}{900}\Rightarrow \\
  \Rightarrow &t=\frac{-49\pm\sqrt{49^2+2\cdot900\cdot(49)}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{49(49+2\cdot900}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{49\cdot1849}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{49(1600+249)}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{7^2(1600+240+9)}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{7^2(40^2+2\cdot40\cdot3+3^2)}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm\sqrt{7^2(40+3)^2}}{900}\Rightarrow\\ 
  \Rightarrow &t=\frac{-49\pm\sqrt{7^2\cdot43^2}}{900}\Rightarrow\\
  \Rightarrow &t=\frac{-49\pm7\cdot43}{900}
\end{align*}
Now, $t$ is the cosine of an acute angle, thus it is positive.
So,
\[
  t=\frac{-49+7\cdot43}{900}=\frac{7\cdot43-7^2}{900}=\frac{7\cdot36}{900}=
      \frac{7\cdot4\cdot9}{25\cdot4\cdot9}=\frac7{25}
\]
Let us find $r$, from (1):
\begin{align*}
  &15^2=2r^2(1-t)\Rightarrow\\
  \Rightarrow&15^2=2r^2\big(1-\frac7{25}\big)=2r^2\big(\frac{18}{25}\big)\Rightarrow\\
  \Rightarrow&15^2=\frac{36r^2}{25}\Rightarrow\\
  \Rightarrow&15^2=\frac{(6r)^2}{5^2}\Rightarrow\\
  \Rightarrow&\frac{6r}5=15\Rightarrow\\
  \Rightarrow& r=\frac{75}{6}=\frac{25}2
\end{align*}
And the diameter is twice the radius, thus the answer is 25.
Now, let us draw the semi-circle with the chords.
It is easy to do so with package "tikz". Using the library "tikzmath", you can
even define variables and use mathematical functions. \\
Following is a picture of the semi-circle and chords with their lengths:
\\ \\
\usetikzlibrary{math}
\tikzmath{
  \d=12.5;
  \r=\d/2;
  \ang=acos(0.28);
  \xa=\d;
  \ya=0;
  \xd=0;
  \yd=0;
  \xb=\r+\r*cos(\ang);
  \yb=\r*sin(\ang);
  \xc=\r+\r*cos(2*\ang);
  \yc=\r*sin(2*\ang);
%
% Adding text nodes
  \tABx = (\xa+\xb)/2-0.15;
  \tABy = (\ya+\yb)/2-0.1;
  \tBCx = (\xb+\xc)/2-0.16;
  \tBCy = (\yb+\yc)/2-0.17;
  \tCDx = (\xc+\xd)/2+0.1;
  \tCDy = (\yc+\yd)/2;
}
\begin{tikzpicture}
    \coordinate(A) at (\xa,\ya);
    \coordinate (D) at (\xd,\yd);
    \draw (D)--(A);
    \draw(A) arc(0:180:\r);
    \coordinate (B) at (\xb,\yb);
    \draw(A)--(B);
    \coordinate(C) at (\xc,\yc);
    \draw (B) -- (C);
    \draw (C) -- (D);

    % Add text nodes
    \node (tAB) at (\tABx,\tABy) {15};
    \node (tBC) at (\tBCx,\tBCy) {15};
    \node (tCD) at (\tCDx,\tCDy) {7};
\end{tikzpicture}
\\
That's a good place to start solving without trigoometric function. Let us copy the picture and add some lines and points to it:\\ \\
\tikzmath{
  \xo=\r;
  \yo=0;
  \tOx=\r;
  \tOy=-0.15;
  \tAx = \xa;
  \tAy = -0.15;
  \tDx = \xd;
  \tDy = -0.15;
  \tBx = \xb;
  \tBy = \yb+0.15;
  \tCx = \xc-0.1;
  \tCy = \yc+0.15;
  \tOAx = (\xo + \xa) / 2;
  \tOAy = -0.15;
  \tODx = (\xo + \xd) / 2;
  \tODy = -0.15;
  \tOBx = (\xo + \xb) / 2-0.1;
  \tOBy = (\yo + \yb) / 2;
  \tOCx = (\xo + \xc) / 2;
  \tOCy = (\yo + \yc) / 2-0.1;
}

\begin{tikzpicture}
    \draw (D)--(A);
    \draw(\d,0) arc(0:180:\r);
    \draw(A)--(B);
    \draw (B) -- (C);
    \draw (C) -- (D);
    \coordinate (O) at (\xo,\yo);
    \draw (O) -- (B);
    \draw (O) -- (C);
    % Add text nodes
    \draw (tAB) node {15};
    \draw (tBC) node {15};
    \draw (tCD) node {7};
    \node (tO) at (\tOx, \tOy) {O};
    \node (tA) at (\tAx, \tAy) {A};
    \node (tD) at (\tDx, \tDy) {D};
    \node (tB) at (\tBx, \tBy) {B};
    \node (tC) at (\tCx, \tCy) {C};
    \node (tOA) at (\tOAx,\tOAy) {r};
    \node (tOD) at (\tODx,\tODy) {r};
    \node (tOB) at (\tOBx,\tOBy) {r};
    \node (tOC) at (\tOCx,\tOCy) {r};
\end{tikzpicture}
Now, $O$ is the origin, that is the point where you pin the compass to draw
an arc, and $A,B,C,D$ are points along the arc, such that $AD$ is the diameter
and $OA=OB=OC=OD$, let us call their values "$r$".
\\
Also, let us copy the picture once again, and add the line $AC$. That will 
create the angle $\angle ACD$, which is an inscribed angle opposite the
diameter and thus a right angle. $AC$ will also intersect with a common side
of two congruent triangle, thus more useful right angles will be created.
\\ \\
\tikzmath{
  \xp = (\xa + \xc) / 2;
  \yp = (\ya + \yc) / 2;
  \tPx = \xp + 0.1;
  \tPy = \yp + 0.1; 
  \tOPx = (\xo + \xp) / 2-0.1;
  \tOPy = (\yo + \yp) / 2;
  \tPAx = (\xp + \xa) /2;
  \tPAy = (\yp + \ya) / 2 -0.1;
  \tPCx = (\xp + \xc) /2;
  \tPCy = (\yp + \yc) / 2 -0.1;
}
\begin{tikzpicture}
    \draw (D)--(A);
    \draw(\d,0) arc(0:180:\r);
    \draw(A)--(B);
    \draw (B) -- (C);
    \draw (C) -- (D);
    \coordinate (O) at (\xo,\yo);
    \draw (O) -- (B);
    \draw (O) -- (C);
    % Add text nodes
    \draw (tAB) node {15};
    \draw (tBC) node {15};
    \draw (tCD) node {7};
    \draw (tO) node {O};
    \draw (tA) node {A};
    \draw (tD) node {D};
    \draw (tB) node {B};
    \draw (tC) node {C};
    \draw (tOA) node {r};
    \draw (tOD) node {r};
    \draw (tOB) node {r};
    \draw (tOC) node {r};
    \draw (A) -- (C);
    \node (tP) at (\tPx,\tPy){P};
    \node (tOP) at (\tOPx,\tOPy) {a};
    \node (tPA) at (\tPAx,\tPAy) {b};
    \node (tPC) at (\tPCx,\tPCy) {b};
\end{tikzpicture}
Now, because 
\[
  \triangle BOA \cong \triangle BOC
\]
we get that
\[
  \angle POC=\angle BOC = \angle BOA = \angle POA
\]
and $PO$ is a common side, and $OA=OC$.
Thus,
\[
  \triangle OPA \cong \triangle OPC
\]
Which means that $PA=PC$,and because P is on $AC$:
\[
  \angle OPA=\angle OPC=90^{\circ}
\]
Let $a=OP, b=AP=PC$, then since $OA$ is the hypotenuse of
$\triangle APO$:
\begin{equation}
  r^2=(OA)^2=a^2+b^2
\end{equation}
That also means that $\angle BPO = 90^{\circ}$\\
and $BP=OB-OP=r-1$, thus:
\begin{equation}
  15^2=(r-a)^2+b^2
\end{equation}
Last, but not least:\\
because $\angle ACD$ is an inscribed angle opposite the diameter:
\[
  \angle ACD=90^{\circ}
\]
Thus,
\begin{equation}
  (2r)^2=(AD)^2=(AC)^2+(CD)^2=(2b)^2+7^2
\end{equation}
Now, since $\frac{AP}{AC}=\frac{AO}{OD}=\frac{1}{2}$, it also 
means by proportional sections that:
\[
  \frac{PO}{CD}=\frac{a}7=\frac12\Rightarrow a=\frac72
\]
Let us plug $a=\frac72$ into equation (3):
\begin{equation}
  r^2=\bigg(\frac72\bigg)^2+b^2
\end{equation}
Multiply equation (6) by 4:
\begin{equation}
(2r)^2=7^2+(2b)^2
\end{equation}
Same as (5), but with (4):
\begin{equation}
  4\cdot15^2=(2r-7)^2+(2b)^2\Rightarrow 30^2=(2r)^2-2\cdot7\cdot2r+7^2+(2b)^2
\end{equation}
From (7), plug $(2b)^2=(2r)^2-7^2$ into (8):
\begin{align*}
  &30^2=2\cdot(2r)^2-2\cdot7\cdot2r\Rightarrow\\
  \Rightarrow & 2\cdot(2r)^2-14\cdot2r-900=0\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2-4\cdot2\cdot(-900)}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2+7200}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2+72\cdot100}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2+72(72+28)}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2+72^2+28\cdot72}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{14^2+72^2+2\cdot14\cdot72}}{4}\Rightarrow\\
  \Rightarrow &2r=\frac{14\pm\sqrt{(72+14)^2}}{4}=\frac{14\pm\sqrt{86^2}}{4}=\frac{14\pm86}4
\end{align*}
But $2r$ is a diameter, so it cannot be negative, thus,
\[\boxed{2r=\frac{14+86}{4}=\frac{100}4=25}\]
\end{document}
