# Electromagnetic energy density in a nonlinear medium

The energy density associated with the electric field in a linear medium of permitivity $$\epsilon$$ is given as $$U = \frac{1}{2}\epsilon\left | E \right |^{2}$$ As Robert Boyd mentions in the first chapter of Nonlinear Optics, the electric field energy density for a nonlinear medium takes a different form from this equation. It has the usual linear term as above,also terms for each of the harmonic frequency.

The equation is lengthy, but assuming a third order non-linearity, it's proportional to $$\vec{E}^*\cdot\vec P,$$ where $$\vec{E}$$ and $$\vec P$$ are the electric field and polarization vectors at third harmonic frequency respectively. If $$\vec{E}$$ and $$\vec P$$ were directly proportional to each other with a real number then this term would be real which is required for a quantity like energy density.

However, for situations like meta-materials, we know that this is not the case. In such situations, how do we go about using this equation to get the real energy density?