In Greene's Econometric Analysis there is a derivation regarding the F stat. The setup is a null hypothesis of the form: $H_0: R\beta =q$ where $\beta$ is a $k\times 1$ vector of parameters, $R$ is a $J\times k$ matrix and $q$ is a $J\times 1$ vector. $R$ and $q$ together define restrictions that are hypothesized. $e_*$ are residuals that result from OLS when imposing the restrictions and $e$ are residuals when estimating OLS without restrictions. $b_*$ and $b$ are respective parameter estimates. (Note that $Rb_*=q$).
Greene's derivation has a portion in which this line is shown,
$$(1) \hspace{3.2cm} e_*'e_*=e'e +(b-b_*)'X'X(b-b_*) $$ The next line shows,
$$(2) \hspace{0.5cm}e_*'e_*-e'e =(Rb-q)'[R(X'X)^{-1}R']^{-1}(Rb-q) $$
I am curious how to go between these lines. If $R$ were an invertible square matrix, it is immediate because $e'e +(b-b_*)'X'X(b-b_*) =e'e +(b-b_*)'R'(R')^{-1}X'XR^{-1}R(b-b_*)$ then we simplify further.
$R$ is not an invertible square matrix however, so this can't be the method. Futhermore, appealing to the pseudoinverse does not help, because $R$ does not have full column rank, thus $R^+R\ne I$ and we can't proceed with $e'e +(b-b_*)'X'X(b-b_*) =e'e +(b-b_*)'R'(R')^{+}X'XR^{+}R(b-b_*)$.
In short, there must be an algebraic trick to go from equation (1) to (2). I am curious what that trick is.