We study the problem of the phonon-induced electron-electron interacti
on in a solid. Starting with a Hamiltonian that contains an electron-p
honon interaction, we perform a similarity renormalization transformat
ion to calculate an effective Hamiltonian. Using this transformation s
ingularities due to degeneracies are avoided explicitly. The effective
interactions are calculated to second order in the electron-phonon co
upling. It is shown that the effective interaction between two electro
ns forming a Cooper pair is attractive in the whole parameter space. F
or a simple Einstein model we calculate the renormalization of the ele
ctronic energies and the critical temperature of superconductivity.