\(B=x^3-y^3+\left(x+y\right)^2\)
\(=\left(x-y\right)^3+3xy\left(x-y\right)+\left(x-y\right)^2+4xy\)
\(=4^3+3\cdot4\cdot5+4^2+4\cdot5\)
\(=160\)
\(\left(x+y\right)^2=\left(x-y\right)^2+4xy=4^2+4.5=36\)
\(x^3-y^3=\left(x-y\right)^3+3xy\left(x-y\right)=4^3+3.5.4=124\)
\(\Rightarrow B=124+36=160\)