# Integrating a vector quantity

1. Jun 19, 2012

### aaaa202

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?

2. Jun 19, 2012

### Muphrid

You break the vector into its components. Note that if you break the vector $r'$ into cartesian components but expressed in terms of spherical variables, the basis vectors are constant and can be pulled out of the integral. This is what I would suggest, as using spherical basis vectors requires keeping those vectors inside the integral, which is a pain.