Tangent circles in a rectangle

Let $\bigcirc E$, $\bigcirc F$, $\bigcirc G$, $\bigcirc H$ have respective radii $e$, $f$, $g$, $h$, and define $u := |BF|$ and $v := |AH|$.

enter image description here

Then each tangency gives a Pythagorean relation:

$$\begin{align} e^2+u^2 &= (e+f)^2\tag{1} \\ e^2+v^2 &= (e+h)^2 \tag{2} \\ f^2+(2e-g)^2 &= (f+g)^2 \tag{3} \\ g^2+(u+f-v)^2 &= (g+h)^2 \tag{4} \\ (u-v)^2 + (2e)^2 &= (f+h)^2 \tag{5} \end{align}$$

It's possible to chug through the system eliminating variables one by one, but the symbol-crunching seems to be a mess best left to a computer. If we're going to resort to that anyway, we might as well just let the CAS tackle the whole system in one go. Mathematica readily generates two solutions: the extraneous $(f,g,h,u,v) = (0,e,-2e,0,0)$ and also $$(f,g,h,u,v) = \left(\frac98 e, \frac{16}{25} e, \frac{25}{28} e, \frac{15}8 e, \frac{45}{28} e\right) \tag{6}$$

from which we find

$$|AB|:|BC| = 2e : u+f = 2 : 3 \tag{$\star$}$$

The fact that all of the values in $(6)$ are rational multiples of $e$ suggests that there might be a clever way to get to the solution, but I'm not seeing it.


Let us take a coordinate system with $A$ the origin, $AB$ the $x$-axis, $AD$ the $y$ axis. We can assume WLOG that the abscissa of $B$ is $2$.

Let use notations: $r$ and $s$ for the radii of circles centered in $H$ and $F$ resp. and

$$D=(0,d), \ H=(0,h), \ G=(g,d)$$

As a consequence $F=(2,d-s)$.

The 5 circles' contacts give the 5 conditions:

$$\begin{cases}(1)&h^2+1&=&(1+r)^2\\ (2)&1+(d-s)^2&=&(1+s)^2\\ (3)&g^2+(d-h)^2&=&(g+r)^2\\ (4)&4+(d-s-h)^2&=&(r+s)^2\\ (5)&(2-g)^2+s^2&=&(g+s)^2\end{cases}$$

(a big thank to Jan-Magnus Økland who has spotted the errors in my initial system. Thank you as well to Blue who has alerted me about the existence of a solution, whereas I thought at first there was none).

We have a system of 5 non linear equations in 5 real unknows $d,g,h,r,s$ with positivity constraint (in fact there are other restrictions if we want to comply with the positions given in the figure).

In fact, using (1) and (2), one can obtain:

$$r=\sqrt{1+h^2}-1 \ \ \text{and} \ \ s=\dfrac{d^2}{2(d+1)}.$$

Plugging these expressions in the remaining equations (3),(4),(5), we get a system of 3 equations in 3 unknowns.

We could study the triple points of intersections of the implicit surfaces with these equations.

I have done differently by submitting system (1) to a Computer Algebra System which has given two $5$-tuples of solutions. Only one of them was physically meaningful...

$$d=3, \ \ g=16/25 \approx 0.64, \ \ h=45/28 \approx 1.6071, \ \ r=25/28 \approx 0.8929, \ \ s=9/8 \approx 1.1250$$

Therefore: AB/BC = 2/3.

Edit 1: Matlab program with symbolic variables:

syms d g h r s
[D,G,H,R,S]=solve(...
   h^2+1==(1+r)^2,...
   1+(d-s)^2==(1+s)^2,...
   g^2+(d-h)^2==(g+r)^2,...
   4+(d-s-h)^2==(r+s)^2,...
   (2-g)^2+s^2==(g+s)^2,...
  d,g,h,r,s)

Edit 2: Using 3 symmetries on the initial figure (situated on the bottom left) gives rise to a new figure that can be used (by suppressing the external half-circles) as a base for a non-classical periodic arrangement of mutually tangent disks of 3 different sizes on the plane (see for example "Unequal circles" in https://en.wikipedia.org/wiki/Circle_packing

enter image description here


Just to add the number crunching in M2. Jean Marie had two misprints in his equations (3) and (5). The solution point $(d,g,h,r,s)=(3,\frac{16}{25},\frac{45}{28},\frac{25}{28},\frac98)$ is found by the following few lines:

R=QQ[d,g,h,r,s] 
I=ideal(h^2+1-(r+1)^2,1+(d-s)^2-(1+s)^2,g^2+(d-h)^2-(r+g)^2,4+(d-s-h)^2-(r+s)^2,(2-g)^2+s^2-(s+g)^2) 
primaryDecomposition I -- {ideal(8*s-9,28*r-25,28*h-45,25*g-16,d-3), ideal(r+3*s+2,g*s+2*g-2,d*s-h*s-3*s^2-4*g-2*s+4,h^2-9*s^2-6*s,d*h-h*s-3*s^2,d^2-2*h*s-6*s^2-8*g-6*s+8)} 

So to answer the question, the ratio is $2:3$