# Real part of an integral with complex argument

This is a paper about Fourier cosine series approximation to option pricing problem. The coefficient $A_k$ is defined as $$A_k=\frac{2}{b-a}\int_a^bf(x)\cos\left(k\pi\frac{x-a}{b-a}\right)dx$$ Then the characteristic function is approximated in the following way $$\phi_1(\omega):=\int_a^be^{i\omega x}f(x)dx\approx\int_Re^{i\omega x}f(x)dx=\phi(\omega)$$ Then comparing those 2 equations they state $$A_k\approx\frac{2}{b-a} \Re \left[ \phi_1\left(\frac{k\pi}{b-a}\right).\exp\left(-i\frac{ka\pi}{b-a}\right) \right]$$

On my side , what I see is $$A_k=\frac{2}{b-a}\int_a^bf(x)\cos\left(k\pi\frac{x-a}{b-a}\right)dx=\frac{2}{b-a}\int_a^bf(x)\Re \left[ e^{ik\pi \frac{x-a}{b-a}} \right]dx\\=\frac{2}{b-a}\int_a^bf(x)\Re \left[ e^{ik\pi \frac{x}{b-a}}e^{-ik\pi \frac{a}{b-a}} \right]dx$$

But then it's not obvious to me that I'm allowed to take out the second exponential from the real part operator, which is the last step to recover what was announced. And I don't see how I'm allowed to take the integral inside the real part either, and here is why:
If I define g in this way $$g(x)\equiv \Re \left[ e^{ ik\pi \frac { x }{ b-a } }e^{ -ik\pi \frac { a }{ b-a } } \right]=\frac { e^{ik\pi \frac { x }{ b-a } }e^{ -ik\pi \frac { a }{ b-a } } + \overline { e^{ ik\pi \frac { x }{ b-a } }e^{ -ik\pi \frac { a }{ b-a } } }}{ 2 }$$ then $$\frac { 2 }{ b-a } \int f(x)\Re \left[ e^{ ik\pi \frac { x }{ b-a } }e^{ -ik\pi \frac { a }{ b-a } } \right] dx=\frac { 2 }{ b-a } \int f(x)g(x)dx$$ and from here I don't see why I'd be allowed to take the integral in g(x)... This might be trivial to you but not to me so far.

-
Does $f$ take real or complex values? –  Davide Giraudo Jul 30 '12 at 9:10
You could have mentioned/linked to the paper, y'know... –  Guess who it is. Jul 30 '12 at 10:19
It's the chapter 15 of the book PDE and martingale methods in option pricing. f takes real values. You can also find the same discussion , page 4 of ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/COS.pdf –  zebullon Jul 31 '12 at 4:40

In fact, what you need to do is take $\int_a^bf(x)\ldots\mathrm dx$ inside the real-part operator. This is justified because $f(x)$ is presumably real and $\int_a^b\ldots\mathrm dx$ is linear. (You already wrote $\mathrm dx$ inside the real-part operator, which makes no sense with the integral sign outside. In stating the desired result, you even have a $\mathrm dx$ in there without an integral in sight.)