<s>[INST] Find value of $\frac{\sum_{k=1}^{399} \sqrt{20+\sqrt{k}}}{\sum_{k=1}^{399} \sqrt{20-\sqrt{k}}}$ Find value of 

$$S=\frac{\sum_{k=1}^{399} \sqrt{20+\sqrt{k}}}{\sum_{k=1}^{399} \sqrt{20-\sqrt{k}}}$$

I started with $$S+\frac{1}{S}=\frac{\sum_{k=1}^{399} \sqrt{20+\sqrt{k}}}{\sum_{k=1}^{399} \sqrt{20-\sqrt{k}}}+\frac{\sum_{k=1}^{399} \sqrt{20-\sqrt{k}}}{\sum_{k=1}^{399} \sqrt{20+\sqrt{k}}}$$
$\implies$
$$S+\frac{1}{S}=\frac{\sum_{i=1}^{399}(20+\sqrt{i})+2S_1+\sum_{i=1}^{399}(20-\sqrt{i})+2S_2}{\left(\sum_{k=1}^{399}\sqrt{20+\sqrt{k}}\right) \times \left(\sum_{k=1}^{399}\sqrt{20-\sqrt{k}}\right)}$$ $\implies$
$$S+\frac{1}{S}=\frac{15960+2S_1+2S_2}{\left(\sum_{k=1}^{399}\sqrt{20+\sqrt{k}}\right) \times \left(\sum_{k=1}^{399}\sqrt{20-\sqrt{k}}\right)}$$
where $$S_1=\sum_{i \ne j=1}^{399}\left(\sqrt{20+\sqrt{i}}\right)\left(\sqrt{20+\sqrt{j}}\right)$$ and like wise
$$S_2=\sum_{i \ne j=1}^{399}\left(\sqrt{20-\sqrt{i}}\right)\left(\sqrt{20-\sqrt{j}}\right)$$
Any way to proceed from here?
 [/INST] Let
$$S_1=\sum_{k=1}^{m^2-1} \sqrt{m+\sqrt{k}}$$
and 
$$S_2=\sum_{k=1}^{m^2-1} \sqrt{m-\sqrt{k}}.$$
(your sum is $S_1/S_2$ at $m=20$). Note that
$$\left(\sqrt{m+\sqrt{k}}+\sqrt{m-\sqrt{k}}\right)^2=2m+2\sqrt{m^2-k},$$
so
$$\sqrt{m+\sqrt{k}}+\sqrt{m-\sqrt{k}}=\sqrt{2}\sqrt{m+\sqrt{m^2-k}}.$$
Thus
$$S_1+S_2=\sum_{k=1}^{m^2-1} \left(\sqrt{m+\sqrt{k}}+\sqrt{m-\sqrt{k}}\right) = \sqrt{2}\sum_{k=1}^{m^2-1} \sqrt{m+\sqrt{m^2-k}}.$$
However, under the substitution $k\to m^2-k$, the sum on the RHS is simply $S_1$. Thus,
$$S_1+S_2=S_1\sqrt{2}$$
$$S_2=\left(\sqrt{2}-1\right)S_1$$
$$\frac{S_1}{S_2}=\boxed{1+\sqrt{2}}.$$
As Robert Israel points out, this result is independent of $m$. 
</s>