Let $ABCD$ be a cyclic quadrilateral with $AB=4,BC=5,CD=6,$ and $DA=7.$ Let $A_1$ and $C_1$ be the feet of the perpendiculars from $A$ and $C,$ respectively, to line $BD,$ and let $B_1$ and $D_1$ be the feet of the perpendiculars from $B$ and $D,$ respectively, to line $AC.$ The perimeter of $A_1B_1C_1D_1$ is $\frac mn,$ where $m$ and $n$ are relatively prime positive integers. Find $m+n.$
Note that $\cos(180^\circ-\theta)=-\cos\theta$ holds for all $\theta.$ We apply the Law of Cosines to $\triangle ABE, \triangle BCE, \triangle CDE,$ and $\triangle DAE,$ respectively: \begin{alignat}{12} &&&AE^2+BE^2-2\cdot AE\cdot BE\cdot\cos\angle AEB&&=AB^2&&\quad\implies\quad AE^2+BE^2-2\cdot AE\cdot BE\cdot\cos\theta&&=4^2, \hspace{15mm} &(1\star) \\ &&&BE^2+CE^2-2\cdot BE\cdot CE\cdot\cos\angle BEC&&=BC^2&&\quad\implies\quad BE^2+CE^2+2\cdot BE\cdot CE\cdot\cos\theta&&=5^2, \hspace{15mm} &(2\star) \\ &&&CE^2+DE^2-2\cdot CE\cdot DE\cdot\cos\angle CED&&=CD^2&&\quad\implies\quad CE^2+DE^2-2\cdot CE\cdot DE\cdot\cos\theta&&=6^2, \hspace{15mm} &(3\star) \\ &&&DE^2+AE^2-2\cdot DE\cdot AE\cdot\cos\angle DEA&&=DA^2&&\quad\implies\quad DE^2+AE^2+2\cdot DE\cdot AE\cdot\cos\theta&&=7^2. \hspace{15mm} &(4\star) \\ \end{alignat} We subtract $(1\star)+(3\star)$ from $(2\star)+(4\star):$ \begin{align} 2\cdot AE\cdot BE\cdot\cos\theta+2\cdot BE\cdot CE\cdot\cos\theta+2\cdot CE\cdot DE\cdot\cos\theta+2\cdot DE\cdot AE\cdot\cos\theta&=22 \\ 2\cdot\cos\theta\cdot(\phantom{ }\underbrace{AE\cdot BE+BE\cdot CE+CE\cdot DE+DE\cdot AE}_{\text{Use the result from }\textbf{Remark}\text{.}}\phantom{ })&=22 \\ 2\cdot\cos\theta\cdot59&=22 \\ \cos\theta&=\frac{11}{59}. \end{align} Finally, substituting this result into $(\bigstar)$ gives $22\cos\theta=\frac{242}{59},$ from which the answer is $242+59=\fbox{301}.$ ~MRENTHUSIASM (credit given to Math Jams's 2021 AIME I Discussion)