  We calculate the pion self-energies in asymmetric nuclear matter in the
two-loop approximation of chiral perturbation theory. We find three types of
corrections beyond the well-known linear density approximation. The resulting
s-wave potential (or equivalent mass-shift) of a $\pi^-$ in the center of a
heavy nucleus like Pb turns out to be $U_{\pi^-}=\Delta m_{\pi^-} \simeq 14$
MeV, about half of what is needed to form the deeply bound and narrow pionic
atom-states recently observed at GSI. The potential for a $\pi^+$ under the
same conditions is $U_{\pi^+}=\Delta m_{\pi^+} \simeq -1$ MeV. In the same way
we calculate the mass-shifts of $K^+$-mesons in symmetric nuclear matter and
neutron matter and find an increase of the $K^+$-mass by 9% and 5%,
respectively. As a further application we give an analytical result for the
third order term in the scattering length expansion of the in-medium
self-energy of an interacting light-boson/heavy-fermion system.
