Characteristic Function of Geometric Brownian motion - PDE with terminal condition approach I want to compute the characteristic function of the standard geometric brownian motion. Note that I know that it is easy when you exploit the distributional properties of the process, but I'm trying to come up with some exercises by myself in order to apply the same approach to broader classes of stochastic processes.
Consider the usual equation of the GBM:
$$
dX_t = \mu X_t dt + \sigma X_t dW_t
$$

Then, by Feynman-Kac, we have to solve the PDE:
$$
\frac{\partial f}{\partial t} + \mu x \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2 x \frac{\partial^2 f}{\partial x^2} = 0
$$
In order to find the characteristic function, we have to take into account the terminal condition
$$
f(x,T) = \exp(i \omega x)
$$
Substituting $f(x,T)$ inside the PDE yields
$$
\mu x i \omega \exp(i \omega x) - \frac{1}{2}\sigma^2 x \omega^2 \exp(i \omega x)=0
$$
But then, how do I proceed? The above doesn't look at all like the characteristic function of a random variable with lognormal distribution).
Obviously considering the logarithm of $\frac{dX_t}{X_t}$ simplifies things a lot, however I really want to came up with the characteristic function of $X_t$, not its logarithm (see p. 41-42 in Pricing Bermudan and American Options Using the FFT Method).

I hope that somebody can help me, or even discuss things a little bit. By the way, excuse me for my poor way of handling PDEs. :)
First of all there is a typo in the partial differential equation(PDE) that you state. Let us firstly recall that PDE describes the time evolution of the one-point probability density function of the stochastic process in question. That PDE is termed the backward Chapman-Kolmogorov equation; you can look up the Wikipedia page to learn how to get from the Langevin equation (the stochastic differential equation) to the Chapman-Kolmogorov equation.
Now the correct version is :
\begin{equation}
\frac{\partial f}{\partial t} + \mu x \frac{\partial f}{\partial x} + \frac{1}{2} \sigma^2x^2 \frac{\partial^2 f}{\partial x^2} = 0 
\end{equation}
Now solving PDEs is in general a hard task but in this particular case the  substitution $y=\log(x)$ turns the PDE into one with constant coefficients. Indeed we have:
\begin{eqnarray}
\frac{\partial f}{\partial y} &amp;=&amp; x \frac{\partial f}{\partial x}\\
\frac{\partial^2 f}{\partial y^2} &amp;=&amp; x \frac{\partial f}{\partial x} + x^2 \frac{\partial ^2 f}{\partial x^2}
\end{eqnarray}
and therefore our PDE takes the form:
\begin{equation}
\frac{\partial f}{\partial t} + \left(\mu-\frac{1}{2} \sigma^2\right) \frac{\partial f}{\partial y} + \frac{1}{2} \sigma^2 \frac{\partial^2 f}{\partial y^2} = 0 
\end{equation}
which is basically saying that the logarithm of a geometrical Brownian motion with parameters $(\mu,\sigma^2)$ is a Gaussian stochastic process with drift $\mu - 1/2 \sigma^2$ and variance $\sigma^2$. Interestingly enough we would have arrived at the same conclusion by using the original Langevin equation and Ito's lemma only.
Now going back to the PDE in question the standard way of solving it is to take Fourier transforms which is actually something you seek to obtain.
We define:
\begin{equation}
\tilde{f}(k,t) := \frac{1}{2\pi} \int\limits_{\mathbb R} e^{\imath k y} f(y,t) d y
\end{equation}
and we transform the PDE above into a ODE:
\begin{equation}
\frac{d \tilde{f}}{d t} + \left[(\mu-\sigma^2) (-\imath k) + \frac{1}{2} \sigma^2 (\imath k)^2 \right] \cdot \tilde{f} = 0
\end{equation}
which, given an initial condition at time $t=T$, is solved by: 
\begin{equation}
\tilde{f}(k,t) = \tilde{f}(k,T) e^{\left[(\mu-\sigma^2) (-\imath k) + \frac{1}{2} \sigma^2 (\imath k)^2 \right](T-t)}
\end{equation}
This is the characteristic function that you were seeking. In applications like option pricing the initial condition $\tilde{f}(k,T)$ is equal to a Fourier transform of the option's payoff at maturity and the fair price of an option at some time before maturity is obtained by taking an inverse Fourier transform of the characteristic function.

Now, the really interesting question is to generalize that approach to more generic stochastic processes for example to L\'{e}vy stable processes. This leads to a fractional PDE. Those are much more difficult to handle yet it is worthwhile to pursue this approach because in here the Ito's lemma does not work.
Disclaimer: I took only one class of undergrad PDE and no grad PDE courses. In grad, our use of FK was just to solve a PDE. We didn't prove anything (well, there were some proofs but not required to study for exam hehe). There are most likely errors here assuming the whole thing isn't severely wrong, but I hope to gain better understanding through others' feedback.

Summary:(I assume you mean $\sigma^2 x^2$)

I think what you did wrong was that you got some $f$ and then plugged it into the PDE. I'm not sure that gets us anywhere. I think we are supposed to solve the PDE for $f$ (To clarify, this is $f = f(x,t)$, a function of two variables; I think you plugged in the '$f(x,T)$' in the initial condition, which is a function of only one variable) and then get the characteristic function from there.

The difference between this and, for example, that seems to be that in that, we come up with a stochastic process to solve the PDE while in this, we are given a stochastic process and then we need to solve the PDE.

If I'm not mistaken, FK seems to be implying two things:


Given a certain PDE, this conditional expectation solves it.
Any solution to a certain PDE can be expressed as a conditional expectation.


(Is that existence and uniqueness? Idk)

So...

In that: we use (1) in considering what stochastic process (Ansatz ) to guess to try to solve the PDE i.e. the PDE dictates the stochastic process (Ansatz) we guess.

In this: we solve the PDE through non-probabilistic methods and then we would know that by (2), our solution is a conditional expectation s.t. if we set $t=0$, we get the characteristic function i.e. the stochastic process dictates the PDE to solve wherein we use an Ansatz that does not explicitly involve a stochastic process (of course FK is saying that there is an implicit stochastic process).



Based on Arithmetic Brownian Motion (see 21.1,21.4):


Let T > 0, and suppose we have a stochastic processes $\{X_t\}_{t \in [0,T]}$ given by $$dX_t = \sigma(X_t,t)dW_t + \mu(X_t,t)dt$$


Then, the characteristic function of $X_T$ is $E[u(X_T)|X_0 = x]$ with $u(x) = \exp(i\omega x)$.

In the article, the author is given ABM

$$dX_t = \pm\sigma dW_t + \mu dt$$

Here, we are given GBM

$$dX_t = \pm\sigma xdW_t + \mu xdt \tag{*}$$


Now for the same stochastic processes but for any $u \in C^{2}(\mathbb R)$ (so this part doesn't have to do with characteristic functions), we can compute $E[u(X_T)|X_0 = x]$ by computing $E[u(X_T)|X_t = x]$ and then setting $t=0$ (duh!).
But how do we compute $E[u(X_T)|X_t = x]$?


(Come to think of it, I'm guessing you could compute it directly, but it would be difficult or something which is kind of why we're using FK.)

FK tells us that for any $u \in C^{2}(\mathbb R)$ (so this part too doesn't have to do with characteristic functions),  $f(x,t) := E[u(X_T)|X_t = x]$ is a (the?) solution of

$$\frac{\partial f}{\partial t} + \mu(x,t) \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2(x,t) \frac{\partial^2 f}{\partial x^2} = 0$$

Whose parameters are dictated by the stochastic process $(*)$. Hence, we must solve the ff PDE:

$$\frac{\partial f}{\partial t} + \mu x \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2x^2 \frac{\partial^2 f}{\partial x^2} = 0 \tag{**}$$

In Arithmetic Brownian Motion, the author used separation of variables i.e. used Ansatz $f(x,t) = \chi(x)\tau(t)$ and then plugged it into the PDE there which is simpler than ours because the coefficients are all constant.


Ours however has nonconstant coefficients for partial derivative of $f$ so it's not as simple. I'm not even sure it's possible: if we use the same Ansatz for GBM as with ABM namely $f(x,t) = \chi(x)\tau(t)$ to $(**)$, I think we will see that $f(x,t)$ is actually not separable, as in the case of the Ornstein-Uhlenbeck SDE (see 21.5).
Perhaps we may try the Ansatz in Ornstein-Uhlenbeck


$$f(x,t) = \exp(i \omega \alpha(t)x + \beta(t))$$

to find $\alpha(t), \beta(t)$ which are supposed to be deterministic functions s.t. $\alpha(T) = 1$ and $\beta(T) = 0$, but I think we will end up with

$$i\theta\alpha'(t) x + \beta'(t) + \mu x [i \theta \alpha(t)] + \frac12 \sigma^2 x^2 [i \theta \alpha(t)]^2 = 0$$

and so we cannot group the coefficients like in Ornstein-Uhlenbeck.

So I guess it all comes to down to finding the right Ansatz (or perhaps there's none?)



Alternatively:

Let $\{Y_t\}_{t \in [0,T]}$ be a stochastic process s.t. $dY_t := \frac{dX_t}{X_t}$. If we can find the cf of $X_t$ given the cf of $Y_t$ then note that $Y_t$ is Arithmetic Brownian Motion, whose cf we know.