In complex form, we know that the $n$-th Fourier coefficient of a function $f$ is given by $$\int_{-\pi}^{\pi} f(\theta)e^{-in\theta} d\theta.$$
My question: What exactly does it mean to integrate the complex function $f(\theta)e^{-in\theta}$ over a real domain? How can I visualize this—in general and in this particular case?
Let $f:[a,b]\to \mathbb{C}$. Since $f$ is a complex-valued function, then there exist real valued functions $f_1,f_2$ such that $$f(x)=f_1(x)+if_2(x),$$ ($f_1,f_2$ are nothing but the real and imaginary part). You can simply define the integral of $f$ by $$\int_a^b f(x)dx:=\int_a^b f_1(x)dx+i\int_a^b f_2(x)dx,$$ where $\int_a^b f_1(x)dx$ and $\int_a^b f_2(x)dx$ are the usual integrals of real valued functions.
You can even define integration of a function $f:\mathbb{C}\to \mathbb{C}$ over a countour in the complex plane.