We write a formula for the LMO invariant of a rational homology sphere presented as a rational surgery on a link inS 3. Our main tool is a careful use of the Århus integral and the (now proven) “Wheels” and “Wheeling” conjectures of B-N, Garoufalidis, Rozansky and Thurston. As steps, side benefits and asides we give explicit formulas for the values of the Kontsevich integral on the Hopf link and on Hopf chains, and for the LMO invariant of lens spaces and Seifert fibered spaces. We find that the LMO invariant does not separate lens spaces, is far from separating general Seifert fibered spaces, but does separate Seifert fibered spaces which are integral homology spheres.