\(\sqrt{1+\frac{1}{a^2}+\frac{1}{\left(a+1\right)^2}}=\sqrt{1+\frac{2}{a^2}+\frac{2}{a}-\frac{2}{a+1}-\frac{2}{a\left(a+1\right)}+\frac{1}{\left(a+1\right)^2}}=\sqrt{\left(1+\frac{1}{a}\right)^2-\frac{2\left(1+\frac{1}{a}\right)}{a+1}+\frac{1}{\left(a+1\right)^2}}=\sqrt{\left(1+\frac{1}{a}-\frac{1}{a+1}\right)^2}=1+\frac{1}{a}-\frac{1}{a+1}\)\\(\Rightarrow B=1+\frac{1}{1}-\frac{1}{2}+1+\frac{1}{2}-\frac{1}{3}+1+\frac{1}{3}-\frac{1}{4}+......+1+\frac{1}{49}-\frac{1}{50}=50-\frac{1}{50}=\frac{2499}{50}\)