Show $ \lambda(P - \lambda^2)^{-1} = -i \int_0^\infty e^{-it\lambda} \cos(t \sqrt{P}) dt$ for positive, self-adjoint $P$, and $\text{Im} \lambda < 0$ Let $P$ be a positive, self-adjoint operator on an Hilbert space $(H, \langle \cdot, \cdot \rangle)$. Then for each $\lambda \in \mathbb{C}$ with $\text{Im} \lambda < 0$, $\lambda^2$ belongs to the resolvent set of $P$.

I would like to show
$$\lambda (P - \lambda^2)^{-1} = -i \int_0^\infty e^{-it\lambda} \cos(t \sqrt{P}) dt, \qquad \text{Im} \lambda < 0. $$

This identity is "well known" and is quoted without proof or reference in an article I'm reading. Hints or solutions are greatly appreciated.
 A: It suffices to show that, for $u$ in the domain of the operator $P$,
$$\frac{-i}{\lambda} \int_0^\infty e^{-it\lambda} \cos(t \sqrt{P}) dt (P- \lambda^2)u = u$$.
One has
\begin{equation*}
\begin{split}
\frac{-i}{\lambda} \int_0^\infty e^{-it\lambda} \cos(t \sqrt{P}) dt (P- \lambda^2)u &= \lim_{R \to \infty} \int_0^R e^{-it\lambda} \cos(t \sqrt{P}) dt (P- \lambda^2)u  \\
&= \lim_{R \to \infty} \int_0^R e^{-it\lambda} \cos(t \sqrt{P})(P- \lambda^2)u dt \\
&= \lim_{R \to \infty} \int_0^R e^{-it\lambda} (-\partial_t^2- \lambda^2) \cos(t \sqrt{P})u dt
\end{split}
\end{equation*}
From here, one needs to integrate by parts twice. The resulting integrals cancel each other and the boundary terms at $t = R$ vanish in the limit that $R \to \infty$. One can check we are left only with
\begin{equation*}
\begin{split}
\frac{-i}{\lambda} \int_0^\infty e^{-it\lambda} \cos(t \sqrt{P}) dt (P- \lambda^2)u &=  \frac{i}{\lambda} e^{-it\lambda}\sin(t \sqrt{P})\sqrt{P}u 
\rvert_{t= 0} \\
&+ e^{-it\lambda}\cos(t \sqrt{P})u
\rvert_{t= 0}\\
&=u.
\end{split}
\end{equation*}
