Which is the right voltage divider formula?
I'm assuming that the first equation is a typo and is really $$R_2 = \frac{R_1V_{out}}{V_{in} - V_{out}}$$

We can factor out \$V_{out}\$ which yields: $$R_2 =\frac{V_{out}}{V_{out}} \frac{R_1}{\frac{V_{in}}{V_{out}} - 1} = \frac{R_1}{\frac{V_{in}}{V_{out}} - 1}$$

Which is the second equation.