\(B=\frac{x^2}{5x+25}+\frac{2\left(x-5\right)}{x}+\frac{50+5x}{x^2+5x}\)
\(=\frac{x^2}{5\left(x+5\right)}+\frac{2\left(x-5\right)}{x}+\frac{5\left(10+x\right)}{x\left(x+5\right)}\)
\(=\frac{x^3+10x^2-250+250+25x}{5x\left(x+5\right)}\)
\(=\frac{x^3+10x^2+25x}{5x\left(x+5\right)}\)
\(=\frac{x\left(x^2+10x+25\right)}{5x\left(x+5\right)}\)
\(=\frac{x\left(x+5\right)^2}{5x\left(x+5\right)}=\frac{x+5}{5}\)
Thay x=-2 vào phân thức ta có
\(\frac{-2+5}{5}=\frac{3}{5}\)