# Stochastic integral involving Poisson Process

Consider an (inhomogeneous) Poisson process $$N_t$$ with intensity $$\lambda_t$$. Then I want to compute the following integral

$$\mathbb{E} \left(\int f(t,N_{t-}) d\tilde{N}_t\right)^2$$

for some smooth enough function $$f$$ and $$d\tilde{N}_t=dN-\lambda_t dt$$ denotes the compensated process.

Is it true that

$$\mathbb{E} \left(\int_0^t f(t,N_{t-}) d\tilde{N}_t\right)^2$$

$$= \mathbb{E} \int_0^t |f(t,N_{t-}) |^2 dN_t$$

$$= \mathbb{E} \int_0^t |f(t,N_{t-}) |^2 \lambda_t dt?$$

If so, then how can I prove this fact?

Let \begin{align*} X_t=\left(\int_0^t f(s,N_{s-}) d\tilde{N}_s\right)^2 \end{align*} and \begin{align*} Y_t = \int_0^t f(s,N_{s-}) d\tilde{N}_s. \end{align*} By It$$\hat{\text{o}}$$'s product rule for jump processes (see Corollaries 11.4.10 and 11.5.5 of this book), \begin{align*} X_t &= 2\int_0^t Y_s dY_s + [Y, Y]_t\\ &=2\int_0^t Y_s dY_s + \sum_{0 Given that both \begin{align*} \int_0^t Y_s dY_s \end{align*} and \begin{align*} \int_0^t f(s,N_{s-})^2 d\tilde{N}_s \end{align*} are martingale, we conclude that \begin{align*} E\left(\int_0^t f(s,N_{s-}) d\tilde{N}_s\right)^2 = E\left(\int_0^t f(s,N_{s-})^2 \lambda_s ds\right). \end{align*}