# Sharygin equation In this note we will show how to find strictly positive integer solutions to the following equation $$ \frac{a}{b+c}+\frac{b}{c+a} = \frac{c}{a+b}\tag{1} $$ Some of the algebraic manipulations are rather tedious, so we will use a symbolic algebra package to justify some of the steps. ``` >>> from sympy import * >>> init_printing(use_unicode=True) ``` Since we are only looking for positive $a$, $b$ and $c$ we can multiply both sides of (1) by $(a+b)(b+c)(c+a)$ and obtain polynomial equation. $$ a(a+b)(c+a)+b(a+b)(b+c) - c(b+c)(c+a) = 0\tag{2} $$ With the help of `sympy` we expand (2) as follows: ``` >>> a, b, c = symbols('a b c') >>> P = a*(a+b)*(c+a)+b*(a+b)*(b+c)-c*(b+c)*(c+a) >>> P.expand() 3 2 2 2 2 3 2 2 3 a + a ⋅b + a ⋅c + a⋅b + a⋅b⋅c - a⋅c + b + b ⋅c - b⋅c - c ``` $$ a^{3} + a^{2} b + a^{2} c + a b^{2} + a b c - a c^{2} + b^{3} + b^{2} c - b c^{2} - c^{3} = 0 \tag{3} $$ We will later explain that equation (1) comes from a geometrical problem were $a$, $b$ and $c$ are the lengths of the sides of a triangle. ![xyz](https://i.imgur.com/3ULcrLz.png) The following variable substitution is well known in planimetry $$ \begin{aligned} a &= y + z\\ b &= x + z\\ c &= x + y \end{aligned} \tag{4} $$ and turns (3) into ``` >>> x, y, z = symbols('x y z') >>> Q = P.subs(dict(a=y+z, b=x+z, c=x+y)).expand() >>> Q 2 2 2 2 2 2 3 - 3⋅x ⋅y + 5⋅x ⋅z - 3⋅x⋅y + 6⋅x⋅y⋅z + 9⋅x⋅z + 5⋅y ⋅z + 9⋅y⋅z + 4⋅z ``` $$ -3\,x^{2} y + 5\,x^{2} z - 3\,x y^{2} + 6\,x y z + 9\,x z^{2} +5\,y^{2} z + 9\,y z^{2} + 4\,z^{3} = 0 $$ The last equation is homogeneous, so instead of looking for three integer values, we can set $z=1$ and look for two rational values of $x$ and $y$: ``` >>> R = Q.subs(z, 1) >>> R 2 2 2 2 - 3⋅x ⋅y + 5⋅x - 3⋅x⋅y + 6⋅x⋅y + 9⋅x + 5⋅y + 9⋅y + 4 ``` $$ -3 x^{2} y + 5 x^{2} - 3 x y^{2} + 6 x y + 9 x + 5 y^{2} + 9 y + 4 = 0 $$ This equation, while qubic overall, is only quadratic in $x$ and $y$. Thus for fixed $y$ it has the form $$ \alpha(y)x^2 + \beta(y)x + \gamma(y) = 0\tag{5} $$ where $$ \begin{aligned} \alpha(y) &= 5 - 3\,y\\ \beta(y) &= - 3\,y^{2} + 6\,y + 9\\ \gamma(y) &= 5\,y^{2} + 9\,y + 4 \end{aligned} $$ which while easily derived by hand can be found in `sympy` as follows: ``` >>> R.coeff(x, 2) 5 - 3⋅y >>> R.coeff(x, 1) 2 - 3⋅y + 6⋅y + 9 >>> R.coeff(x, 0) 2 5⋅y + 9⋅y + 4 ``` If $x_1$ is one solution of (5) then the other can be found by Vieta theorem $$ x_1 + x_2 = -\frac{\beta(y)}{\alpha(y)} = \frac{3\,y^{2} - 6\,y - 9}{5 - 3\,y} $$ In other words, if $(x_1, y)$ satisfy (4) then so will $(x_2, y)$ with $$ x_2 = \frac{3\,y^{2} - 6\,y - 9}{5 - 3\,y} - x_1 $$ Furthermore, since (4) is symmetric with respect to $x$ and $y$, $(x_2, y)$ being a solution implies that so will be $(y, x_2)$. This explans the role of the following function in our solution: ``` def a(p): x, y = p return y, (3 * y * (y - 2) - 9) / (5 - 3 * y) - x ``` It maps one rational solution $(x_1, y)$ of (4) into another --- $(y, x_2)$. And thus, since $P=(1, -3)$ is a solution so will be $a(a(a(a(P))))$ which happens to be positive. $$ \begin{aligned} x&=\frac{13387}{391}\\ y&=\frac{1895139}{1067039} \end{aligned} $$ In order to find an integer solution we need to rescale $$ (x,\;y,\;z) = \left(\frac{13387}{391},\;\frac{1895139}{1067039},\;1\right) $$ by a common denominator of $x$ and $y$ which happens to be $1067039 = 391\cdot2729$. $$ \begin{aligned} (x,\;y,\;z) &= (13387\cdot2729,\;1895139,\;1067039)\\ &= (36533123,\;1895139,\;1067039) \end{aligned} $$ Finally, substituting these values back in (4) we obtain the sought values for $a$, $b$, and $c$. $$ \begin{aligned} a &=y + z = 1895139 + 1067039 = 2962178\\ b &=x + z = 36533123 + 1067039 = 37600162\\ c &=x + y = 1895139 + 36533123 = 38428262 \end{aligned} $$ Since all values that we just found are even, we can make a smaller solution by dividing each value by $2$: $$ (a,\,b,\,c) = (\mathbf{1\,481\,089},\;\mathbf{18\,800\,081},\; \mathbf{19\,214\,131}) $$ ## Sharygin triangle Sharygin triangle is a scalene triangle whose bisectoral triangle is isosceles. In the following diagram, $\triangle ABC$ is a Sharygin triangle and $\triangle A_1B_1C_1$ is its bisectoral triangle. ![](https://alnitak-ab.github.io/sharygin.svg) We will use this diagram to prove that the lengths $a$, $b$ and $c$ of the sides of a Sharygin triangle satisfy equation (1). Consider triangles $\triangle CC_1A_1$ and $\triangle CC_1B_1$. They have two pairs of mutually congruent sides ($CC_1$ is common and $C_1A_1\cong C_1B_1$ by assumption) and congruent angles ($\angle A_1CC_1\cong\angle B_1CC_1$ because $CC_1$ is a bisector). This can happen only in two cases: when the two triangles are congruent or when they have supplementary angles $$ \measuredangle CA_1C_1 + \measuredangle CB_1C_1 = 180^\circ.\tag{6} $$ The first case is realised when $\triangle ABC$ is isosceles which is contrary to our assumption, so we will focus on the second case. Since $\angle AB_1C_1$ is supplementary to $\angle CB_1C_1$ is supplementary to $\angle CA_1C_1$, we can conclude that $$ \angle AB_1C_1 \cong \angle CA_1C_1.\tag{7} $$ Now, let's rotate $\triangle AB_1C_1$ clockwise around point $C_1$ until $B_1C_1$ consides with $A_1C_1$ and point $A$ becomes $D$. Note that congruence of the angles (7) requres that $D$ lies on the linear extension of the segment $BC$ beyond the point $C$. The resulting triangle $\triangle DC_1A_1$ together with the adjacent $\triangle BC_1A_1$ form $\triangle DBC_1$ that is similar to $\triangle ABC$ and the lengths of its sides can be expresed as follows: $$ \begin{aligned} |BC_1| &= \frac{ac}{a+b},\qquad\textbf{ [derive this]}\\ %&|C_1D|=|AC_1|=\frac{bc}{a+c}\\ |BD|&=|BA_1|+|A_1D| = |BA_1|+|B_1A|=\frac{ac}{b+c}+\frac{bc}{a+c}. \end{aligned} $$ The similarity $$\triangle DBC_1 \sim\triangle ABC$$ implies $$ \frac{|BC_1|}{|BC|}=\frac{|BD|}{|AB|} $$ or after substitution and cancellation $$ \frac{a}{b+c}+\frac{b}{c+a} = \frac{c}{a+b}.\quad\blacksquare $$ ## Sharygin's original ![I. F. Sharygin](https://i.imgur.com/b1YegQ4.png) This problem was first published in issue 17 of Kvant's Library in 1982. Kvant's Library (Библиотечка "Квант") was a series of books for schoolchildren popular in the Soviet Union but largely unknown in the West. These days books from this series are difficult to find and Sharygin's "Problems in Geometry" is not an exception. Only medium quality scanned copies [3] are available оn the Internet and only in Russian. For this reason, we will reprint Sharygin’s original formulation and his solution here together with English translation. ### Problem 58 _A given triangle is such that the triangle formed by the bases of its bisectors is isosceles. Is it true that the given triangle is also isosceles?_ [3, pp. 154, 157–158] Let $ABC$ --- given triangle. $AA_1$, $BB_1$, $CC_1$ --- bisectors. If $|A_1B_1|=|A_1C_1|$, then either $\widehat{A_1B_1C}=\widehat{A_1C_1B}$ (in this case $\triangle ABC$ will be isosceles), or $\widehat{A_1B_1C}+\widehat{A_1C_1B}=180^\circ$. In the second case, we will rotate $\triangle A_1B_1C$ around point $A_1$ by angle $\widehat{B_1A_1C_1}$. As a result, triangles $A_1C_1B$ and $A_1B_1C$ will become adjacent and form a triangle similar to $\triangle ABC$. If the sides of $\triangle ABC$ are $a$, $b$ и $c$, then the sides of the resulting triangle will be $\frac{ac}{b+c}$, $\frac{ab}{b+c}$ and $\frac{ac}{a+b}+\frac{ab}{a+c}$. Taking similarity into account, we find the following relation between $a$, $b$ and $c$: $\displaystyle\frac{c}{a+b}+\frac{b}{a+c}=\frac{ab}{b+c}~\Rightarrow$ $$ b^3+c^3-a^3+b^2c+b^2a+c^2b+c^2a-a^2b-a^2c+abc=0.\tag{1} $$ Let's denote $\cos\widehat{BAC}=x$; by cosine theorem, $b^2+c^2-a^2=2\,b\,c\,x$. Multiplying the last equation by $a$, $b$ and $c$ in sequence and subtracting results from (1), we obtain $2\,x\,(a+b+c)+a=0\Rightarrow a=-\displaystyle\frac{2\,(b+c)\cdot x}{2x+1}.$ Since $0<a<b+c$, $$ -\frac{1}{4}<x<0.\tag{2} $$ $\qquad$Expressing $a$ in the cosine theorem expression in terms of $b$, $c$ and $x$ and denoting $\frac{b}{c}=\lambda$, we get the following equation for $\lambda$: $$ (4x+1)\lambda^2-2\lambda\,(4x^3+8x^2+x)+4x+1=0. $$ In order for this equation to have solution $\lambda>0$ under conditions (2), the following inequalities must hold: $$ 4x^3+8x^2+x>0, $$ $$ \begin{split} \frac{1}{4}D&=(4x^3 + 8x^2 + x)^2=\\ &=(2x+1)^2(x+1)(2x-1)(2x^2+5x+1)>0. \end{split}\tag{4} $$ The system of inequalities (2), (3), (4) holds when $-\frac{1}{4}<x<\frac{\sqrt{17}-5}{4}$. $\qquad$Therefore, the original triangle is not necessarily isosceles. However, we have just proven that this can only happen in such case when one of the angles of the original triangle is obtuse and its cosine falls in the interval $\left(-\frac{1}{4},\frac{\sqrt{17}-5}{4}\right)$, which for the angle corresponds to the interval $(102^\circ40';104^\circ28')$. At one end of the interval $\left(-\frac{1}{4}\right)$ the constructed triangle will degenerate and the other end $\left(\frac{\sqrt{17}-5}{4}\right)$ corresponds to the equality $\widehat{A_1B_1C}=\widehat{A_1C_1B}=90^\circ$, in other words, the two cases that we identified at the start of the solution coincide for this value of the angle. ### Задача 58 _Про данный треугольник известно что треугольник образованный основаниями его биссектрис, является равнобедренным. Будет ли верно что и данный треугольник является равнобедренным?_ [3, стр. 154, 157--158] Пусть $ABC$ --- данный треугольник. $AA_1$, $BB_1$, $CC_1$ --- биссектрисы. Если $|A_1B_1|=|A_1C_1|$, то или $\widehat{A_1B_1C}=\widehat{A_1C_1B}$ (в этом случае $\triangle ABC$ будет равнобедренным), или $\widehat{A_1B_1C}+\widehat{A_1C_1B}=180^\circ$. Во втором случае повернём $\triangle A_1B_1C$ вокруг точки $A_1$ на угол $\widehat{B_1A_1C_1}$. В результате треугольники $A_1C_1B$ и $A_1B_1C$ окажутся приложенными друг к другу и образуют треугольник подобный $\triangle ABC$. Если стороны $\triangle ABC$ есть $a$, $b$ и $c$, то стороны получившегося треугольника быдут равны $\frac{ac}{b+c}$, $\frac{ab}{b+c}$ и $\frac{ac}{a+b}+\frac{ab}{a+c}$. Учитывая подобие, получим между $a$, $b$ и $c$ соотношение $\displaystyle\frac{c}{a+b}+\frac{b}{a+c}=\frac{ab}{b+c}~\Rightarrow$ $$ b^3+c^3-a^3+b^2c+b^2a+c^2b+c^2a-a^2b-a^2c+abc=0.\tag{1} $$ Обозначим $\cos\widehat{BAC}=x$; по теореме косинусов $b^2+c^2-a^2=2\,b\,c\,x$. Умножая последнее равенство последовательно на $a$, $b$ и $c$ и вычитая из (1), получим $2\,x\,(a+b+c)+a=0\Rightarrow a=-\displaystyle\frac{2\,(b+c)\cdot x}{2x+1}.$ Поскольку $0<a<b+c$, $$ -\frac{1}{4}<x<0.\tag{2} $$ $\qquad$Заменив в теореме косинусов $a$ через $b$, $c$ и $x$ и обозначив $\frac{b}{c}=\lambda$, получим для $\lambda$ уравнение $$ (4x+1)\lambda^2-2\lambda\,(4x^3+8x^2+x)+4x+1=0. $$ Для того чтобы это уравнение при условиях (2) имело решение $\lambda>0$, $\lambda\neq0$, должны выполняться неравенства $$ 4x^3+8x^2+x>0, $$ $$ \begin{split} \frac{1}{4}D&=(4x^3 + 8x^2 + x)^2=\\ &=(2x+1)^2(x+1)(2x-1)(2x^2+5x+1)>0. \end{split}\tag{4} $$ Система неравенств (2), (3), (4) удовлетворяется при $-\frac{1}{4}<x<\frac{\sqrt{17}-5}{4}$. $\qquad$Таким образом, исходный треугольник не обязательно равнобедренный. Однако мы доказали, что это может иметь место только в том случае, когда один из углов исходного треугольника тупой и его косинус находится в интервале $\left(-\frac{1}{4},\frac{\sqrt{17}-5}{4}\right)$, что соответствует для угла интервалу приблизительно $(102^\circ40';104^\circ28')$. Для одного конца интервала $\left(-\frac{1}{4}\right)$ построенный нами треугольник будет вырождаться, другой же конец $\left(\frac{\sqrt{17}-5}{4}\right)$ соответствует равенству $\widehat{A_1B_1C}=\widehat{A_1C_1B}=90^\circ$, т.&nbsp;е. два случая, которые мы выделели в начале решения, для этого значения угла совпадают. ## References 1. I. V. Netay and A.V. Savvateev, ["Sharygin triangles and elliptic curves"](https://arxiv.org/abs/1610.04626), (October 2016). 2. Oliver Nash, ["Sharygin's group of triangles"](http://olivernash.org/2016/12/18/sharygins-group-of-triangles/index.html) (December 2016). 3. I. F. Sharygin, ["Problems in Geometry (Planimetry)"](http://ilib.mccme.ru/djvu/geometry/sharygin_pl.htm) [in Russian], Nauka, 1982.