The solution to the problem is as mentioned by @chris in comments of the question Replace the `VectorPlot3D[]` command which is VectorPlot3D[Grad[rint3[x, y, z], {x, y, z}], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] by VectorPlot3D[Grad[rint3[x, y, z], {x, y, z}]//Evaluate, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] "//Evaluate" command has been added. The output will be [![Gravitational Field due to a cube][1]][1] [1]: https://i.sstatic.net/sKCVc.jpg