<s>[INST] Derivation Verification for an Algebraic Expression This problem comes from a MathOverFlow thread. Inside the thread the user Per Alexandersson mentions how they learned a technique to "simplify" $\sqrt{7+\sqrt{3}}$ from the book Algebra for Beginners, by Todhunter.
Greg Martin replied with the following formula:
$\sqrt{a+\sqrt b} = \sqrt{\frac{a-\sqrt{a^2-b}}{{2}}}+\sqrt{\frac{a+\sqrt{a^2-b}}{{2}}}$
I have three questions around this,
Question 1: Is the below derivation correct? If not, could someone show me how to patch it up?
Derivation:
\begin{align}
\sqrt{a+\sqrt b} &= \sqrt{\frac{a-\sqrt{a^2-b}}{{2}}}+\sqrt{\frac{a+\sqrt{a^2-b}}{{2}}} \\
\left(\sqrt{a+\sqrt b}\right)^{2} &= \bigg(\sqrt{\frac{a-\sqrt{a^2-b}}{{2}}}+\sqrt{\frac{a+\sqrt{a^2-b}}{{2}}}\bigg)^{2} \\
{a+\sqrt b} &= \frac{a-\sqrt{a^2-b}}{{2}} + 2\bigg(\sqrt{\frac{a-\sqrt{a^2-b}}{{2}}}\sqrt{\frac{a+\sqrt{a^2-b}}{{2}}}\bigg) + \frac{a+\sqrt{a^2-b}}{{2}} \\
{a+\sqrt b} &= \frac{a-\sqrt{a^2-b}}{{2}} + \frac{a+\sqrt{a^2-b}}{{2}} + 2\bigg( \sqrt{\frac{a-\sqrt{a^2-b}}{2}\cdot \frac{a+\sqrt{a^2-b}}{2}}\bigg)  \\
{a+\sqrt b} &= \frac{a-\sqrt{a^2-b}+a+\sqrt{a^2-b}}{2}+  2\bigg(\frac{\sqrt{b}}{\sqrt{4}}\bigg) \\
{a+\sqrt b} &= \frac{2a}{2} +  2\bigg(\frac{\sqrt{b}}{2}\bigg) \\
{a+\sqrt b} &= a +  \sqrt{b}
\end{align}
Question 2: I assume that the above is if each step is reversible. But my question is (assuming the derivation is correct), how do we know each step is reversible when there are square roots involved?
Question 3: Regardless if the above derivation is correct or not, could someone show me another derivation and include the steps/explanations of how these are equal? I figure another approach might enlighten me as to how the longer expression was derived from  $\sqrt{a+\sqrt b}$.
 [/INST] Answer 1: Your thoughts are correct.
Answer 2: If the signal of both sides are equal, then the step of squaring both sides (say, the first step in your proof) is invertible.
Answer 3: The way the author expects you to derive this equation might be to find an $x$ and $y$ such that
$$
\begin{align}
x^2+y^2&=2a\tag{1}\label{1},\\
xy&=\sqrt{b}\tag{2}\label{2}.
\end{align}
$$
Then,
$$
\sqrt{a+\sqrt{b}}=\sqrt{\frac{2a+2\sqrt{b}}{2}}=\sqrt{\frac{(x+y)^2}{2}}=\frac{|x|}{\sqrt{2}}+\frac{|y|}{\sqrt{2}}.
$$
This is how you simplify $\sqrt{7+\sqrt{3}}$. Solving $(1)$ and $(2)$, you will find that the $x$ and $y$ are exactly $\sqrt{a-\sqrt{a^2-b}}$ and $\sqrt{a+\sqrt{a^2-b}}$.
</s>