We study the elastic properties, electronic structure and equation of state
of titanium diboride and magnesium diboride using a first-principles pseud
opotential method. We show that the results of the calculations carried out
using the gradient-corrected approximation of the density-functional theor
y are in excellent agreement with the most recent experimental data. These
results confirm that early reports of anomalously high elastic anisotropy o
f TiB2 were based on erroneous experimental data for the off-diagonal compo
nents of the elastic coefficients tenser. Present results for TiB2 are more
accurate than previously reported Hartree-Fock calculations. Predicted ela
stic properties of the recently discovered superconductor, MgB2, are presen
ted and compared to contradictory experimental estimates of bulk and linear
compressibilities.