\(A=\frac{1}{\sqrt{3}+1}+\frac{1}{\sqrt{3}-1}\)
\(=\frac{\sqrt{3}-1}{\left(\sqrt{3}+1\right)\left(\sqrt{3}-1\right)}+\frac{\sqrt{3}+1}{\left(\sqrt{3}-1\right)\left(\sqrt{3}+1\right)}\)
\(=\frac{\sqrt{3}-1+\sqrt{3}+1}{\left(\sqrt{3}+1\right)\left(\sqrt{3}-1\right)}\)
\(=\frac{2\sqrt{3}}{\left(\sqrt{3}+1\right)\left(\sqrt{3}-1\right)}\)
\(=\frac{2\sqrt{3}}{3-1}\)
\(=\frac{2\sqrt{3}}{2}\)
\(=\sqrt{3}\)
\(B=\frac{5+\sqrt{5}}{5-\sqrt{5}}+\frac{5-\sqrt{5}}{5+\sqrt{5}}\)
\(=\frac{\sqrt{5}\left(\sqrt{5}+1\right)}{\sqrt{5}\left(\sqrt{5}-1\right)}+\frac{\sqrt{5}\left(\sqrt{5}-1\right)}{\sqrt{5}\left(\sqrt{5}+1\right)}\)
\(=\frac{\left(\sqrt{5}+1\right)}{\left(\sqrt{5}-1\right)}+\frac{\left(\sqrt{5}-1\right)}{\left(\sqrt{5}+1\right)}\)
\(=\frac{\left(\sqrt{5}+1\right)^2}{\left(\sqrt{5}-1\right)\left(\sqrt{5}+1\right)}+\frac{\left(\sqrt{5}-1\right)^2}{\left(\sqrt{5}+1\right)\left(\sqrt{5}-1\right)}\)
\(=\frac{5+2\sqrt{5}+1+5-2\sqrt{5}+1}{\left(\sqrt{5}-1\right)\left(\sqrt{5}+1\right)}\)
\(=\frac{12}{\left(\sqrt{5}-1\right)\left(\sqrt{5}+1\right)}\)
\(=\frac{12}{5-1}\)
\(=\frac{12}{4}\)
\(=3\)