Skip to main content
2 of 2
added 2 characters in body

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