Say, for $u>t$ we have a stochastic process given by :
$$ r_u=r_t + \int_t^u\theta_s ds+\sigma\int_t^udW_s, $$ where $W_t$ is a brownian motion, $\sigma$ is a constant and $\theta_t$ is some deterministic function.
I have solved for the following: $$ P(t,T)=\Bbb E[e^{-\int_t^Tr_udu}|\mathscr F_t]=\exp\left(~\frac{\sigma^2}{6}(T-t)^3-\int_t^T(T-s)\theta_sds-r_t(T-t)~\right). $$
I am trying to evaluate the following expectation though and finding it hard, not really sure how to treat the indicator function:
$$ \Bbb E[e^{-\int_t^Tr_udu}(P(T,S)-K)~ 1_{P(T,S)\ge K}~|\mathscr F_t]. $$ Where K is a constant. I break this down and get to a point where I need to solve two expectations, one of them is: $$ \Bbb E[e^{-\int_t^Sr_udu}~ 1_{P(T,S)\ge K}~|\mathscr F_t]. $$
How can I proceed from here? or how can I treat the indicator function?
I give you a hint for the calculation of this expression (this doesn't fit into a comment) :
$$\Bbb E[e^{-\int_t^Sr_udu}~ 1_{P(T,S)\ge K}~|\mathscr F_t]$$
First see that $\Bbb E[e^{-\int_t^Sr_udu}~ 1_{P(T,S)\ge K}~|\mathscr F_t]=P(t,S).\Bbb E^S[1_{P(T,S)\ge K}~|\mathscr F_t]=P(t,S).\Bbb P^S(P(T,S)\ge K|\mathscr F_t)$ where $\Bbb E^S$ is the expectation under the S-forward measure.
Now check that the law of $P(T,S)$ under $\Bbb P^S$ is log normal. I leave you the tedious task to determine the mean and variance that will give you the final result.
Best regards