  In existing theoretical approaches to core-level excitations of
transition-metal ions in solids relaxation and polarization effects due to the
inner core hole are often ignored or described phenomenologically. Here we set
up an ab initio computational scheme that explicitly accounts for such physics
in the calculation of x-ray absorption and resonant inelastic x-ray scattering
spectra. Good agreement is found with experimental transition-metal $L$-edge
data for the strongly correlated $d^9$ cuprate Li$_2$CuO$_2$, for which we
determine the absolute scattering intensities. The newly developed methodology
opens the way for the investigation of even more complex $d^n$ electronic
structures of group VI B to VIII B correlated oxide compounds.
