# Provide a bond pricing differential equation and invoke Feynman-Kac Theorem

Grateful for any assistance.

Consider the process: $dZ=r(t)Z\,dt$ , where $r(t)$ is stochastic interest rate and $Z=Z(r,t;T)$ is a zero coupon bond Price. Provide a bond pricing partial differential equation and invoke Feynman-Kac Theorem to show the solution requires the risk neutral measure $\mathbb{Q}$:

$$Z(r,t;T)=\mathbb{E_t^Q}\left[\exp\left({-\int^T_tr(s)\,ds} \right)\right].$$

Everything I read suggests write the PDE associated with $Z(r,t;T)$, integrate it and then take the expected value. I am stuck however on the first step as $dZ$ does not look like the usual Brownian motion with drift and diffusion? Instead the process evolves like having money in the bank earning interest, i.e. the change in the value of the zero coupon bond ($dZ$) in a timestep ($dt$) is equivalent to earning interest at a rate $r(t)$ over time. Grateful for any guidance on how to approach this.

1. If we know that $r_t$ follows the Ito process as described by the following stochastic differential equation \begin{align} d{{r}_{t}}=\mu ({{r}_{t}},t)dt+\sigma ({{r}_{t}},t)d{{W}_{t}^{Q}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(1) \end{align} and we are given a function $Z(r,t; T)$ with boundary condition $Z(r,T; T)=1$, then we can always obtain the solution for $Z(r,t; T)$ as Equation \begin{align} {{Z}_{t}}+\mu(r_t,t)\,{{Z}_{r}}\,+\frac{1}{2}{{\sigma }^{2}(r_t,t)} {{Z}_{rr}}-{{r(t)}}\,Z=0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(2) \end{align} and with boundary condition $Z(r,T; T)=1$ The theorem asserts that $Z(r,t; T)$ has the solution \begin{align} Z(r,t;T)={{E}^{Q}}\left[ exp\left(-\int_{t}^{T}r_s\,ds\right)\underbrace{Z(r,T;T)}_{1}\,\,|{\mathcal{F}_{t}} \right](3) \end{align}
2. If we know that the solution to $Z(r,t; T)$ is given by equation $(3)$ and that $r_t$ follows the process in $(1)$ then we are assured that $Z(r,t; T)$ satisfies the PDE in Equation $(2)$.