<s>[INST] $\frac{\sqrt{1+\sqrt{x}}+\sqrt{1+\sqrt{1-x}}}{\sqrt{1-\sqrt{x}}+\sqrt{1-\sqrt{1-x}}}$ Find the value of $\frac{\sqrt{1+\sqrt{x}}+\sqrt{1+\sqrt{1-x}}}{\sqrt{1-\sqrt{x}}+\sqrt{1-\sqrt{1-x}}}$, if $x\in \left(0,\frac{1}{2}\right)$. I know it is equal to $\sqrt{2}+1$, but I don't know how to prove it?
 [/INST] Let $a=\sqrt{1-\sqrt{x}}, b=\sqrt{1+\sqrt{x}}$, and $b>a>0$ for all $x\in\left(0,\frac{1}{2}\right)$. One could get that $ab=\sqrt{1-x}$, $b^2-a^2=2\sqrt{x}$, $1-a^2b^2=\sqrt{x}$, and $b^2+a^2=2$. Then, one could obtain: $b+a=\sqrt{2}\cdot\sqrt{1+ab}$ and $b-a=\sqrt{2}\sqrt{1-ab}$.
Now, when one would prove that the value of the above function is equal to $\sqrt{2}+1$ for all $x\in\left(0,\frac{1}{2}\right)$. Given $y=f(x)=\frac{\sqrt{1+\sqrt{x}}+\sqrt{1+\sqrt{1-x}}}{\sqrt{1-\sqrt{x}}+\sqrt{1-\sqrt{1-x}}}=\frac{b+\sqrt{1+ab}}{a+\sqrt{1-ab}}\equiv \sqrt{2}+1$. So, it only required to prove that $y^2-2y-1=0$. The proof is the same as to prove that $\left(\frac{b+\sqrt{1+ab}}{a+\sqrt{1-ab}}\right)^2-2\left(\frac{b+\sqrt{1+ab}}{a+\sqrt{1-ab}}\right)-\left(\frac{a+\sqrt{1-ab}}{a+\sqrt{1-ab}}\right)$ shall be equal to zero for all $x\in\left(0,\frac{1}{2}\right)$. In the case of a non-trivial solution being existed in, the portion of denominator shall not be equal to zero, and the numerator shall be zero. After expansion, one got the portion of numerator as follows: $(b+\sqrt{1+ab})^2-2(b+\sqrt{1+ab})(a+\sqrt{1-ab})-(a+\sqrt{1-ab})^2=b^2-a^2+2ab-2ab+2(b-a)\sqrt{1+ab}-2(b+a)\sqrt{1-ab}-2\sqrt{1-a^2b^2}\equiv 2\sqrt{x}+2\sqrt{2}\sqrt{1-ab}\sqrt{1+ab}-2\sqrt{2}\sqrt{1+ab}\sqrt{1-ab}-2\sqrt{1-a^2b^2}=2\sqrt{x}+2\sqrt{2}\sqrt{1-a^2b^2}-2\sqrt{2}\sqrt{1-a^2b^2}-2\sqrt{x}=0$. So, the proof was done, and we show that $y=f(x)=\frac{\sqrt{1+\sqrt{x}}+\sqrt{1+\sqrt{1-x}}}{\sqrt{1-\sqrt{x}}+\sqrt{1-\sqrt{1-x}}}\equiv\sqrt{2}+1$, $\forall x\in\left(0,\frac{1}{2}\right)$.
</s>