# How to treat complex conjugates in a wave equation for EM wave?

In a class of nonlinear optics, the professor said that the E fields are always real and that for an EM wave we write $\vec{E}(\vec{r},t) = \vec{E}(\vec{r})\cdot e^{-i\omega t } + c.c.$ to ensure the realness of the field.

In Boyd's Nonlinear Optics text, Chapter 2, there is a passage of deriving the field equations in a nonlinear medium. He uses Maxwell's equations for macroscopic medium with no free charge or free current to obtain the following equation $$-\nabla^2\vec{E}(\vec{r},t) +\frac{\epsilon^{(1)}_r}{c^2}\frac{\partial^2 \vec{E}(\vec{r},t)}{\partial t^2}=-\frac{1}{\epsilon_0 c^2}\frac{\partial^2 \vec{P}^{NL}(\vec{r},t)}{\partial t^2},$$ where $\vec{P}^{NL}$ is the nonlinear polarization.

We then substitute a particular frequency component of E field given by the following $$\vec{E}_n(\vec{r},t) = \vec{E}_n(\vec{r})\cdot e^{-i\omega_n t } + c.c.$$ The resulting equation is the following: $$\nabla^2\vec{E}_n(\vec{r}) +\frac{\epsilon^{(1)}_r\omega^2_n}{c^2} \vec{E}(\vec{r}) =-\frac{1}{\epsilon_0 c^2} \vec{P}^{NL}_n(\vec{r}).$$

However, if I literally substitute in the expression of $E_n(r,t)=E_n(r)e^{-i\omega t} + c.c.$, I will not be able to factor out the exponential ($e^{-i\omega t}$) and cancel them out in both sides of the equations, because there are the complex conjugates with terms $e^{i\omega t}$.

What am I misunderstanding here?

{Some additional thoughts: As I was typing, I realized one thing which may or may not be the correct explanation. If I group terms with $e^{-i\omega t}$ and $e^{i\omega t}$ when I plug in the specific frequency component of E field into the wave equation for E fields. I will get

(something)$\times e^{-i \omega t} +$ (something else)$\times e^{i\omega t}=0$

Because $e^{-i \omega t}$ and $e^{ i \omega t}$ are orthogonal functions, their coefficients should be identically zero to make their sum zero. (However, as I am writing this... I cannot convince myself that they are orthogonal because if I multiply them and integrate... I don't get zero unless the integration interval is zero)}

Let's say $\vec{E}$ is real, and we have a field $\vec{E} e^{-iwt}$ and we hope adding the c.c. will give us something real.

$\vec{E} e^{-iwt} + \vec{E} e^{iwt} = \vec{E}(\cos(wt) - i\sin(wt) + \cos(wt) +i\sin(wt)) = 2\vec{E}\cos(wt).$

Now let's say $\vec{E}$ had an imaginary part such that $Im(\vec{E}) = \vec{E}_i$

The imaginary part's contribution would be:

$i\vec{E_i}e^{-iwt} - i\vec{E}e^{iwt}$

$= i\vec{E}_i (\cos(wt) - i\sin(wt) - \cos(wt) - i\sin(wt))$

$= -i^2\vec{E}_i\sin(wt) = \vec{E}_isin(wt)$

So both the imaginary and the real part of the field have a real contribution.