# An example of Feynman-Kac

I've been learning about Feynman-Kac recently and I understand the underlying ideas. I am stuck however in actually computing explicit solutions for specific problems.

For example, assume that $$S_t$$ is the price of an asset with SDE $$dS_t = rS_tdt+ \sigma S_tdW_t$$, where $$r$$ and $$\sigma$$ are positive numbers, and $$W_t$$ is a standard Brownian motion under some measure. Consider the function $$f(t, S_t)$$, dependent on time $$t$$ and on the price $$S_t$$. How to solve the following boundary problem where the domain is $$[0,T]\times \mathbb{R}$$: $$f_t +\dfrac{1}{2}\sigma^2 S^2 f_{SS}=0$$ with terminal condition $$f(T,S)=S^4$$?

• Your PDE seems to assume $r=0$. Is that the case? Nov 19, 2020 at 17:24
• @DaneelOlivaw No. r is not 0 Nov 19, 2020 at 17:47

Hope it is okay to attempt an answer to this slightly old question. The PDE $$f_t +\frac12 \sigma^2 s^2 f_{ss}=0$$ with terminal condition $$f(T,s)=s^4$$, is solved by $$f(t,s)=\mathbb{E}(S_T^4|S_t=s),$$ where $$(S_t)_{t\geq 0}$$ solves the SDE $$dS_t = \sigma S_t dB_t.$$
This is by Feynman-Kac. Applying Ito's lemma to $$X_t = \log S_t$$, gives $$d X_t = -\frac12 \sigma^2 dt + \sigma dB_t,$$ which in turn implies $$S_t = S_0 e^{-\frac12 \sigma^2 t + \sigma B_t}.$$ It follows that $$S_T = S_t e^{-\frac12 \sigma^2 (T-t) + \sigma B_{T-t}},$$ so that upon taking the $$4$$-th power and conditional expectation $$\mathbb{E}(S_T^4|S_t=s) = s^4e^{-2 \sigma^2 (T-t)} \mathbb{E}( e^{4\sigma B_{T-t}})$$ $$=s^4e^{-2 \sigma^2 (T-t)} M_Z(4\sigma\sqrt{T-t}),$$ where $$M_Z(u)=\mathbb{E}(e^{uZ})$$ is the MGF of a standard normal RV. Thus we may finally conclude $$f(t,s) = s^4 e^{6\sigma^2 (T-t)},$$ provided I have not made arithmetical/algebraic errors.