Let $f: \mathbb{R}^d \longrightarrow \mathbb{R}^d$ be twice continuously differentiable and $\{B(t): t \ge 0 \}$ be a d-dimensional Brownian motion. Further suppose that, for all $t>0$ and $x \in \mathbb{R}^d$ we have $$\mathbb{E}_x \int_{0}^{t}e^{-\lambda s}|f(B(s))| \, ds< \infty $$ and $$\mathbb{E}_x \int_{0}^{t}e^{-\lambda s}|\Delta f(B(s))| \, ds < \infty.$$ Prove that $X(t)=e^{-\lambda t}f(B(t))- \int_{0}^{t} e^{-\lambda s} (\dfrac{1}{2}\Delta f(B(s))- \lambda f(B(s))) \, ds$ is a martingale.
I solved the easier case $\lambda=0$ in the following way but I got stuck to generalize it: For any $0 \le s \le t$,
$$\mathbb{E}[X(t)|\mathcal{F}(s)]=\mathbb{E}_{B(s)}[f(B(t-s))]-\dfrac{1}{2} \int_{0}^{s} \Delta f(B(u)) du - \int_{0}^{t-s} \mathbb{E}_{B(s)}[\dfrac{1}{2} \Delta f(B(u)) du.$$
Using integration by parts and the fact that the probability density of $B$ satisfies the heat equation , i.e. $\dfrac{1}{2} \Delta \mathfrak{p}(t,x,y)=\dfrac{\partial}{\partial t}p(t,x,y)$, we get
\begin{align*} \mathbb{E}_{B(s)}[\dfrac{1}{2} \Delta f(B(u))] &=\dfrac{1}{2} \int \mathfrak{p}(u, B(s), x) \Delta f(x)\, dx \\ &=\dfrac{1}{2} \int \Delta \mathfrak{p}(u, B(s), x) f(x) \, dx \\ &=\int \dfrac{\partial}{\partial u} \mathfrak{p}(u,B(s),x) f(x) \, dx \end{align*}
and then
\begin{align*} \int_{0}^{t-s} \mathbb{E}_{B(s)}[\dfrac{1}{2} \Delta f(B(u)) \, du &= \lim_{\epsilon \downarrow 0} \int \left[\int_{\epsilon}^{t-s} \dfrac{\partial}{\partial u} \mathfrak{p}(u, B(s), x) \, du \right] f(x) \, dx \\ &= \int \mathfrak{p}(t-s, B(s), x) f(x) dx - \lim_{\epsilon \downarrow 0} \int \mathfrak{p}(\epsilon, B(s), x) f(x) dx \\ &= \mathbb{E}_{B(s)} [f(B(t-s))]-f(B(s)) \end{align*}
and hence we get $$\mathbb{E}[X(t) \mid \mathcal{F}(s)]=f(B(s))-\dfrac{1}{2}\int_{0}^{s} \Delta f(B(u)) \, du$$ which confirms the martingale property.