Which inversion circle for an extension of shoemaker's knife figure involving 3 families of circles? In the following figure $p_n$ are the radii of the red circles, $q_n$ are the radii of the green circles, and $r_n$ are the radii of the yellow circles. Then we have
$$\frac{9}{p_{n}^2}+ \frac{4}{q_n^2} + \frac{144}{r_n^2}=\frac{32}{q_nr_n} + \frac{40}{r_np_n} + \frac{4}{p_nq_n}$$

What I thought: 
Inversion with pole B and power $\alpha = BA^2=a^2$
Being the vertices $ D, C, A, B $, respectively.
But I think that it would give a lot of computations.
 A: For simplicity, we will assume the side of the square is $a = 1$.
Choose a coordinate system where the square becomes $[-1,0]\times[0,1]$.
Label the vertices of the square as illustrated below:
$$A = (-1,0), B = (0,0), C = (0,1),  D = (-1,1)$$

In order to present everything in a single figure, instead of a single circle inversion, we will first apply an inversion with respect to the unit circle centered at $B$ (the orange circle), followed by a reflection with respect to the $y$-axis to the configuration at hand. i.e. apply the map
$$(x,y)\quad \mapsto \quad \left(-\frac{x}{x^2+y^2}, \frac{y}{x^2+y^2}\right)$$
to the source square.
Under this map, the red and green quarter circles get mapped to rays on the line $x = \frac12$ and $y = \frac12$ respectively. The blue semicircle get mapped to a ray on the line $x = 1$.
The bunch of yellow circles in the source square get mapped to another bunch of circles sandwiched between the lines $x = \frac12$ and $x = 1$. So the radii of the image circles are $R_r = \frac14$. Notice the largest yellow circle get mapped to one touching above $3$ lines, the center of its image is $(\frac34,\frac34)$. Since other yellow image circles are stacked on top of this, the center of $n^{th}$ image yellow circle is $(x_{rn},y_{rn}) = \left(\frac34, \frac{2n+1}{4}\right)$. Reflect and invert them back, the radius of $n^{th}$ yellow circle in source square is
$$r_n = \frac{R_r}{x_{rn}^2 + y_{rn}^2 - R_r^2} = \frac{4}{4n^2+4n+9}$$ 
Under same map, each red circle in the source square get mapped to a circle in the interstitial space formed among two yellow image circles and the red line $x = \frac12$. It is not hard to work out its radius: $R_p = \frac{1}{16}$.
From this, one find the center of 
$n^{th}$ image red circle is located at $(x_{pn},y_{pn}) = \left(\frac{9}{16}, \frac{n+1}{2}\right)$. Reflect and invert them back, one get
$$p_n = \frac{R_p}{x_{pn}^2 + y_{pn}^2 - R_p^2} = \frac{1}{4n^2 + 8n+ 9}$$
Similarly, the radii of the green image circles is $R_q = \frac{1}{16}$ and the center of $n^{th}$ image green circles is 
$(x_{qn},y_{qn}) = \left(\frac{15}{16}, \frac{n+1}{2}\right)$.
Reflect and invert the last time, one get
$$q_n = \frac{R_q}{x_{qn}^2 + y_{qn}^2 - R_q^2} = \frac{1}{4n^2 + 8n+ 18
}$$
As a double check, with help of a CAS, these three sequences of radii satisfy the identity in question:
$$\frac{9}{p_{n}^2}+ \frac{4}{q_n^2} + \frac{144}{r_n^2}=\frac{32}{q_nr_n} + \frac{40}{r_np_n} + \frac{4}{p_nq_n}$$
In above derivation, there are only two results that are not immediately obvious:


*

*Why $R_p = R_q = \frac{1}{16}$ ?

*When one reflect and invert an image circle centered at $(x,y)$ with radius $R$ back, why the radius of original circle is $\frac{R}{x^2+y^2 - R^2}$? 


Both of them are not that hard to show. I will leave the first one as exercise. For the second one, it is the formula pointed out by conditionalMethod in comment. Follow above link for more details.
