Let us consider the following problem: it is necessary to find the shape of the body with fixed mass and density which at large distances compared with its characteristic dimensions would give the greatest deviations from the strength of the gravitational field of the point mass with the same mass placed in the center of the mass of the object. I understand that in this case the dipole moment is zero and it is necessary to maximize all the components of the quadruple moment tensor of the object. It is naturally that it is necessary to use a variational calculus. But I can’t make specific calculations. Please, help me with a solution to this problem.
Just a few hints, not a complete answer, since this is a homework question.
The maximal deviations from the monopole are not reached for the case where all components of the tensor are maximal, this is not even a coordinate independent notion, since the components change under coordinate transformations.
The quadrupole tensor $Q$ is symmetric and traceless (the trace part would just gives an additional monopole term, the anti-symmetric part vanishes when contracting with the symmetric tensor $\vec r \circ \vec r$). Therefore, there are five independent components, but we can change the coordinate system so that the tensor is diagonal, so there are only two independent quantities that determine the strength of the deviations from the monopole (and the other degrees of freedom determine the spatial orientation of them).
The maximal value of $\vec r \cdot Q \vec r$ and the maximal deviation from the $1/r$ potential is therefore along the main axis with the largest eigenvalue.
If you guess the correct solution (which can be done by thinking about the deviations directly), the maximality of the quadrupole moment can be shown by a simple estimate, without needing calculus of variations.