In many problems I am asked to compute a vector integral: Consider for instance the following example: Two spheres with total charge +Q and -Q spread uniformly over their surfaces are placed on the z-axis at z=d/2 and z=-d/2 respectively. What are their total dipole moment with respect to the origin. Now it happens that from symmetry, the total dipole moment is just Qd in the z-direction, which can be seen easily. But sometimes when symmetry does not allow for such easy solutions you would have to the integrals for the dipole moments in full glory, that is: p = ∫V'r'ρ(r')dV' I have tried doing that integral in spherical coordinates but didn't get anything useful. How do you do an integral like that where you actually get a direction for the resulting vector. In my example for instance - how do you do the integral such that all the vectors add to zero?