We performed an experimental study of the temperature and doping dependence of the energy-loss function of the bilayer and trilayer Bi-cuprate family. The primary aim is to obtain information on the energy stored in the Coulomb interaction between the conduction electrons, on the temperature dependence thereof, and on the change of Coulomb interaction when Cooper-pairs are formed. We performed temperature-dependent ellipsometry measurements on several Bi$_2$Sr$_2$CaCu$_2$O$_{8-x}$ single crystals: under-doped with $T_c=60, 70$ and 83K, optimally doped with $T_c=91$K, overdoped with $T_c=84, 81, 70$ and $58$K, as well as optimally doped Bi$_2$Sr$_2$Ca$_2$Cu$_3$O$_{10+x}$ with $T_c=110$K. Our first observation is that, as the temperature drops through $T_c$, the loss function in the range up to 2~eV displays a change of temperature dependence as compared to the temperature dependence in the normal state. This effect at - or close to - $T_c$ depends strongly on doping, with a sign-change for weak overdoping. The size of the observed change in Coulomb energy, using an extrapolation with reasonable assumptions about its $q$-dependence, is about the same size as the condensation energy that has been measured in these compounds. Our results therefore lend support to the notion that the Coulomb energy is an important factor for stabilizing the superconducting phase. Due to the restriction to small momentum, our observations do not exclude a possible significant contribution to the condensation energy of the Coulomb energy associated to the region of $q$ around $(pi,pi)$.