Density-functional calculations of the phonon spectrum and electron-phonon
coupling in MgB2 are presented. The E-2g phonons, which involve in-plane B
displacements, couple strongly to the p(x,y) electronic bands. The isotropi
c electron-phonon coupling constant is calculated to be about 0.8. Allowing
for different order parameters in different bands, the superconducting lam
bda in the clean limit is calculated to be significantly larger. The E-2g p
honons are strongly anharmonic, and the nonlinear contribution to the coupl
ing between the E-2g modes and the p(x,y) bands is significant.