\(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\)
\(=4^3+3\cdot5\cdot4+4^2\)
\(=64+16+60\)
=140
\(B=x^3-y^3+\left(x-y\right)^2=\left(x-y\right)\left(x^2+xy+y^2\right)+\left(x-y\right)^2=\left(x-y\right)\left(x^2+xy+y^2+x-y\right)=\left(x-y\right)\left[\left(x-y\right)^2+\left(x-y\right)+3xy\right]=4\left(4^2+4+3.5\right)=140\)