Rearranging a formula, transpose for A2 - I'm lost Given the formula:
$$ q = A_1\sqrt\frac{2gh}{(\frac{A_1}{A_2})^2-1} $$
Transpose for $A_2$
I have tried this problem four times and got a different answer every time, none of which are the answer provided in the book. I would very much appreciate if someone could show me how to do this step by step. 
The answer from the book is:
$$ A_2=\sqrt\frac{A_1^2q^2}{2A_1^2gh+q^2} $$
The closest I can get is the following:
$$ q = A_1\sqrt\frac{2gh}{(\frac{A_1}{A_2})^2-1} $$
$$ \frac{q^2}{A_1^2} = \frac{2gh}{(\frac{A_1}{A_2})^2-1} $$
Invert:
$$ \frac{A_1^2}{q^2} = \frac{(\frac{A_1}{A_2})^2-1}{2gh} $$
Multiply both sides by $2gh$:
$$ 2gh\frac{A_1^2}{q^2} = (\frac{A_1}{A_2})^2-1 $$
$$ \frac{2ghA_1^2}{q^2} = (\frac{A_1}{A_2})^2-1 $$
Add 1 to both sides and re-arrange:
$$ \frac{A_1^2}{A_2^2} = \frac{2ghA_1^2}{q^2} +1 $$
Invert again:
$$ \frac{A_2^2}{A_1^2} = \frac{q^2}{2ghA_1^2} +1 $$
Multiply by $A_1^2$:
$$ A_2^2 = \frac{A_1^2q^2}{2ghA_1^2} +1 $$
Get the square root:
$$ A_2 = \sqrt{\frac{A_1^2q^2}{2ghA_1^2}+1} $$
I cannot see where the $q^2$ on the bottom of the textbook answer comes from.

$$\frac{q^2}{A_1^2} = \frac{2gh}{\left(\frac{A_1}{A_2}\right)^2-1} $$
$$\Leftrightarrow \frac{q^2}{A_1^2}\left(\left(\frac{A_1}{A_2}\right)^2-1\right) = 2gh $$
$$\Leftrightarrow \frac{q^2}{A_2^2}-\frac{q^2}{A_1^2} = 2gh $$
$$\Leftrightarrow \frac{q^2}{A_2^2}= 2gh+\frac{q^2}{A_1^2}  $$
$$\Leftrightarrow \sqrt{\frac{q^2}{2gh+\frac{q^2}{A_1^2}}}= \pm A_2  $$
Maybe not the fastest way, but step by step how I did it. Of course this answer can be brought into several equivalent forms.
multiplying the fraction inside the square root with $\frac{1/q^2}{1/q^2}$ gives
$$ \sqrt{\frac{1}{\frac{2gh}{q^2}+\frac{1}{A_1^2}}}= \pm A_2 $$
now with $\frac{A_1^2}{A_1^2}$ to get
$$ \sqrt{\frac{A_1^2}{\frac{2ghA_1^2}{q^2}+1}}= \pm A_2 $$
same expansion with $A_1^2$ starting from my first result gives
$$ \frac{A_1q}{\sqrt{2ghA_1^2+q^2}}= \sqrt{\frac{A_1^2q^2}{2ghA_1^2+q^2}}= \pm A_2 $$
You can keep going as long as you want.... (incidently your closest solution that you have posted does not work due to a wrong invertion as already mentioned in the comments)
