# Question in "Computational Methods in Finance" by Ali Hirsa - Chapter 2: Derivatives Pricing via Transform Techniques"

Reference: "Computational Methods in Finance" by Ali Hirsa - Chapter 2: Derivatives Pricing via Transform Techniques" - Page 37*

Background: The author prices call option using the Fourier Transform. Let $X_T$ be time-T price of the underlying security; $f(X_T)$ be pdf of $X_T$ under some e.m.m; $q(x_T)$ be pdf of $x_T=ln(X_T)$; $k=ln(K)$ be the log of the strike price; $C_T(k)$ be price of a strike $K=e^k$ and maturity $T$.

$\Phi(v) = \int_{-\infty}^{\infty}e^{ivx_T}q(x_T)dx_T$ is the characteristic function of the log of the underlying security $x_T$.

$C_T(k)$ can be expressed as: $C_T(k)=CE[(X_T-K)^{+}]=C\int_{K}^{\infty}(X_T-K)f(X_T)dX_T=C\int_{k}^{\infty}(e^{x_T}-e^{k})q(x_T)dx_T$ where $C$ is constant coefficient which depends on the e.m.m. chosen.

Then define $\Psi_T(v)=\int_{-\infty}^{\infty}e^{ivk}C_T(k)dx_T$ as the Fourier transform of $C_T(k)$.

Question: The author continues to derive an explicit form of $\Psi_T(v)$ which goes as follows: $\Psi_T(v) = \int_{-\infty}^{\infty}e^{ivk}(C\int_{k}^{\infty}(e^{x}-e^{k})q(x)dx)dk = C\int_{-\infty}^{\infty}\int_{-\infty}^{x}e^{ivk}(e^{x}-e^{k})q(x)dkdx$. The latter equality seems to be derived from Fubini's Theorem, but I could not understand the change to $\int_{-\infty}^{x}$ from $\int_{k}^{\infty}$ in the previous equation when the double integral places the $e^{ivk}$ inside and swapped the order of integration.

Could someone kindly explain how Fubini's theorem is applied here?

Thanks a lot.

$\int_{-\infty}^{\infty}{e^{i\nu k} \left( C \int_k^{\infty} \left( e^x - e^k \right) q(x) dx \right) dk} = \int_{-\infty}^{\infty}{\int_k^{\infty}{C e^{i\nu k} \left( e^x - e^k \right) q(x) dx} dk}$
Now, let $f(x, k) = C e^{i\nu k} \left( e^x - e^k \right) q(x)$,
$\int_{-\infty}^{\infty}{\int_k^{\infty}{f(x, k) dx} dk} = \int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{x > k} dx} dk}$
Switching the order of integration (and using the fact that the indicator function will not affect the integrability of $f(x, k)$:
$\int_{- \infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{x > k} dk} dx} = \int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{k < x} dk} dx} \\ = \int_{-\infty}^{\infty}{\int_{-\infty}^{x}{f(x, k) dk} dx}\\ =\int_{-\infty}^{\infty}{\int_{-\infty}^{x}{C e^{i\nu k} \left( e^x - e^k \right) q(x) dk} dx}$