Analytical description of longitudinal optical binding of two spherical nanoparticles