# Why don't I get this right $\frac{d}{dt}\mathop{\mathbb{E}}\left[ e^{-\int_t^Tr(s)ds}|\mathscr{F}_t \right]$

Let $$r$$ a random process defined by :

$$dr_t=\theta(t)dt + \sigma dW_t$$

$$\theta$$ is deterministic in $$t$$ and $$W$$ a brownian motion.

I don't know where my calculation below is going wrong :

Let $$R=\int r(s)ds$$

then : $$\frac{d}{dt}\mathop{\mathbb{E}}\left[ e^{-\int_t^Tr(s)ds}|\mathscr{F}_t \right] = \mathop{\mathbb{E}}\left[ \frac{d}{dt} e^{-(R_T - R_t)}|\mathscr{F}_t \right] = \mathop{\mathbb{E}}\left[ r(t) e^{-(R_T - R_t)}|\mathscr{F}_t \right] = r(t) \mathop{\mathbb{E}}\left[ e^{-\int_t^Tr(s)ds}|\mathscr{F}_t \right]$$

But regarding this question Bond dynamics in Ho Lee model my computation is not correct

• What is your problem ?
– Ezy
Feb 14 '19 at 11:30
• Regarding this question quant.stackexchange.com/questions/44002/… my computation is not correct Feb 14 '19 at 12:06
• Your first equality is wrong. It is true that you can bring the derivative inside the expectation operator due to Lebesgue dominated convergence theorem (the function is bounded). However, you need to find the solution of the SDE for $r_t$ and then compute the mean of this Gaussian variable. Feb 14 '19 at 12:37
• @JohnLord then update your question to clarift. Also your notation is bad: do you wish to calculate partial derivative or total derivative ? Those are not the same.
– Ezy
Feb 14 '19 at 12:45
• @FunnyBuzer why do you need the solution of $r_t$ SDE? after the derivative, the resulting $r_t$ is know given $F_t$ and we can simply take it out of the expectation. No? Feb 14 '19 at 13:42

You can use the stochastic integration by parts to solve the integral inside the expectation: $$\int_t^Tr_sds=Tr_T-tr_t-\int_t^Tsdr_s=(T-t)r_t+\int_t^T(T-s)\underbrace{dr_s}_{:=\theta(s)ds+\sigma dW_s}$$ Solve this integral and then take the expectation and solve the derivative. For a complete answer see Ho and lee derivation for short rates model.