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.