In a triangle $\triangle ABC$, the sum of two sides is $x$, and their product is $y$. If $x^2-c^2=y$, find $\frac{r}{R}$ in terms of $x, c, y$ This problem comes from a previous JEE Advanced examination, the problem is as follows:

In a triangle $\triangle ABC$, the sum of two sides is $x$, and their product is $y$. If $x^2-c^2=y$ where $c$ is the third side, find the ratio of the inradius to the circumradius in terms of $x, c, y$

This is indeed a pretty challenging and tricky problem. Upon initial examination, spamming algebra seems to not lead anywhere. I found a solution using some angle chasing, which I'll share below, please share your own approaches as well!
Let $a+b=x$ and $ab=y$
We know that:
$$x^2-c^2=y$$
$$(a+b)^2-c^2=ab$$
$$a^2+b^2-c^2=-ab$$
Dividing by $2ab$ and exploiting the Law of Cosines, we can say that:
$$\frac{a^2+b^2-c^2}{2ab}=-\frac{1}{2}$$
Now, this implies that $\angle C=120^\circ$
Now, using the Law of Sines, we get:
$$\frac{1}{2R}=\frac{\sin{C}}{c}$$
$$\frac{c}{2R}=\frac{\sqrt3}{2}$$
$$R=\frac{c}{\sqrt3}$$
We also know that:
$$\Delta= \frac{1}{2}ab\sin{C}$$
$$\Delta=\frac{\sqrt{3}y}{4}$$
Further, we can note that:
$$s=\frac{a+b+c}{2}$$
$$s=\frac{x+c}{2}$$
Also, $r=\frac{\Delta}{s}$, therefore:
$$\frac{2\sqrt{3}y}{4(x+c)}=r$$
$$r=\frac{\sqrt{3}y}{2(x+c)}$$
Finally:
$$\frac{r}{R}=(\frac{\sqrt{3}y}{2(x+c)})(\frac{\sqrt{3}}{c})$$
$$\frac{r}{R}=\frac{3y}{2c(x+c)}$$
 A: Let’s assume $S$ is the Area of the triangle and $P$ is half of the perimeter.
If $x=a+b$ and $y=ab$ $\\$ then $(a-b)^2=(a+b)^2-4ab=x^2-4y$.
We know that $S=\frac{abc}{4S}$ and $r=\frac{S}{P}$ then using the Heron’s formula we have:$$\frac{r}{R}=\frac{\frac{S}{P}}{\frac{abc}{4S}}=\frac{4S^2}{Pabc}=\frac{4(P-a)(P-b)(P-c)}{abc}$$
And also, $(P-a)(P-b)(P-c)=\frac{c-(a-b)}{2}\times\frac{c+(a-b)}{2}\times\frac{x-c}{2}=\frac{c^2-(a-b)^2}{4}\times\frac{x-c}{2}$ $$=\frac{c^2-(x^2-4y)}{4}\times\frac{x-c}{2}=\frac{3y(x-c)}{8}$$
Therefore $$\frac{r}{R}=\frac{\frac{3y(x-c)}{2}}{yc}=\frac{{3(x-c)}}{2c}$$
Which is consistent with Goku カカロット
's final answer.
A: Goku's solution with some geometric point of view:

*

*Dropping a perpendicular from $O$, the circumcenter, to side $c$, we have $\frac{c}{2}=R\sin C=R\sin120^{\circ}$ and hence $R=\frac{c}{\sqrt 3}.$

*Droping perpendiculars from the incenter $I$, to the sides $a,b,c$ we find:
$a=r\cot\frac B2+r\cot \frac C2=r\cot\frac B2+\frac{r}{\sqrt3}\tag1$
$b=r\cot\frac A2+r\cot \frac C2=r\cot\frac A2+\frac{r}{\sqrt3}\tag2$
$c=r\cot\frac A2+r\cot \frac B2.\tag3$
Now, $(1)+(2)-(3)$ gives $a+b=c+\frac{2r}{\sqrt 3}$ and hence $r=\frac{\sqrt 3}{2}(x-c)$.

From 1 and 2, $$\frac rR=\frac{\frac{\sqrt 3}{2}(x-c)}{\frac{c}{\sqrt3}}=\frac{3(x-c)}{2c}=\frac{3(x^2-c^2)}{2c(x+c)}=\frac{3y}{2c(x+c)}$$
which is, I mean the final expression I found as the answer is, not only consistent but looks exactly like Goku's final expression for the answer.
A: From Law of Cosine, replace cosine with accurate haversine.
$c^2 = a^2 + b^2 - 2ab×\cos(C) = (a-b)^2 + 4ab×hav(C)$
Let $\displaystyle z = ab×hav(C) = \frac{(c-(a-b)(c+(a-b))}{4}$
$→ z = (s-a)(s-b)$
$→ (a\,b-z) = s(s-c)$
$Δ = \sqrt{s(s-a)(s-b)(s-c)} = \sqrt{(ab-z)\,z}$
If c is the smallest side, (a-b) is exact, RHS area formula is very accurate.

Back to the oringal problem, without "angle chasing"
$\displaystyle z = \frac{c^2 - (a-b)^2}{4} 
= \frac{(x^2 - y) - (x^2 - 4y)}{4} 
= \frac{3y}{4}$
$\displaystyle Δ = \sqrt{(ab-z)\,z} 
= \sqrt{\left(y-\frac{3y}{4}\right) \left(\frac{3y}{4}\right)}
= \frac{\sqrt{3}\,y}{4}$
$\displaystyle \frac{r}{R}
= \frac{Δ}{s} ÷ \frac{a\,b\,c}{4Δ}
= \frac{4Δ^2}{s\,a\,b\,c}
= \frac{3y^2/4} {\left( \frac{x+c}{2} \right)y\,c}
= \frac{3y}{2c(x+c)}
$
