The problem I am attempting is the following

I got pretty far into it, however, I was not able to do the last step of the solution. The given solution is here
What I don't understand: I don't understand where the last equation comes from. Can someone clarify where it comes from?

It's just the moment of force balance. In the statement of the problem, it's said that the distance from the axis to the center of mass is $\cfrac{3\pi a\sin \theta}{16\theta}$.
Basically, in the following formula $$F_1 l_1 = F_2 l_2$$ we have $F_1 = \cfrac{Mg\theta}{\pi}$,$~ l_1 =\cfrac{3\pi a\sin \theta}{16\theta}$ and $F_2 = 2T\sin \theta$, $~l_2 = a$.