Existence of the derivative of functionals of Brownian motion Let $v(x, t) = \mathbb E [f(x + W_t)]$ with a Brownian motion $W$. Then, Malliavin calculus leads to the sensitivity in $x$:
$$\partial_x v(x, t) = \frac{1}{t} \mathbb E [ f(x + W_t) W_t ].$$
I am interested in $u'(x)$ with $u$ defined by
$$u(x) = \mathbb E \int_0^T f(x + W_t) dt$$
for some function $f$. First we can write
$$u'(x) = \int_0^T \partial_x v(x, t) dt = \int_0^T \frac{1}{t} \mathbb E[f(x+W_t) W_t] dt$$
whenever the last integral exists.
[Question] What is the sufficient conditions on $f$ to have the $u'(x)$? In particular, when $f$ is not differentiable.
[Discussion] For instance, if $f$ is a constant, then $u'(x) = 0$; if $f$ is an identity, $u'(x) = T$. More generally, if $f'$ exists with polynomial growth, then $u'$ can be computed using the following alternative formula:
$$u'(x) = \mathbb E[ \int_0^T f'(x+W_t) dt].$$
 A: $\newcommand{\ep}{\varepsilon}\newcommand{\R}{\mathbb R}\newcommand{\vpi}{\varphi}\newcommand{\De}{\Delta}\newcommand{\Om}{\Omega}$The derivative $u'(x)$ exists and the equality
\begin{equation*}
    u'(x) =\int_0^T \frac{dt}t\, Ef(x+W_t)W_t \tag{1}
\end{equation*}
holds under very mild restrictions on $f$, just a bit stronger than the restrictions on $f$ needed for $u(x)$ itself to exist.
Indeed, suppose that the function $f\colon\R\to\R$ is Borel-measurable and such that
\begin{equation*}
    \int_0^T dt\, E|f(x+W_t)|<\infty; \tag{2}
\end{equation*}
for (2) to hold, it is enough that
\begin{equation*}
    |f(u)|\le Ce^{au^2}\quad\text{for some real $C$}, \\
    \text{some real $a<\frac1{2T}$, and all real $u$. } \tag{3}
\end{equation*}
Then, by Fubini's theorem,
\begin{equation*}
\begin{aligned}
    u(x)&=\int_0^T dt\,Ef(x + W_t) \\ 
    &=\int_0^T dt\int_\R dz\,f(x+z\sqrt t)\vpi(z) \\ 
    &=\int_0^T \frac{dt}{\sqrt t}\int_\R du\,f(u)\vpi\Big(\frac{x-u}{\sqrt t}\Big), 
\end{aligned}
\tag{4}
\end{equation*}
where $\vpi$ is the standard normal density.
Let us show that condition (3) is sufficient for (1) as well:
For all real $s$, let
\begin{equation*}
    \psi(s):=|\vpi'(s)|=|s|\vpi(s). 
\end{equation*}
Take any real $x$, any $\ep\in(0,T/2]$, and any
\begin{equation*}
    b\in\Big(a,\frac1{2T}\Big). \tag{4.5}
\end{equation*}
Then
\begin{equation*}
\begin{aligned}
\max\Big\{\psi\Big(\frac{y-u}{\sqrt t}\Big)\colon \ep\le t\le T,|y-x|\le1\Big\} 
    &\le C_{\ep,x,b,T}e^{-bu^2}, 
\end{aligned}
\tag{5}
\end{equation*}
where $C_{\ep,x,b,T}$ is a real number depending only on $\ep,x,b,T$, but not on $(t,u)$. Also,
\begin{equation*}
    \begin{aligned}
&\int_\ep^T \frac{dt}{\sqrt t}\int_\R du\,
\Big|\partial_x\Big(f(u) \vpi\Big(\frac{x-u}{\sqrt t}\Big)\Big| \\ 
&=\int_\ep^T \frac{dt}t\int_\R du\,|f(u)|
    \psi\Big(\frac{x-u}{\sqrt t}\Big)   
\end{aligned} 
\tag{6}
\end{equation*}
and
\begin{align*}
\int_\ep^T \frac{dt}t\int_\R du\,|f(u)|e^{-bu^2}<\infty, \tag{7}
\end{align*}
by (3) and (4.5).
Moreover, for $y\in[x-1,x+1]$, in view of (3) and the condition $\ep\in(0,T/2]$,
\begin{equation*}
\begin{aligned}
&\int_0^\ep \frac{dt}{\sqrt t}\int_\R du\,
\Big|\partial_y\Big(f(u) \vpi\Big(\frac{y-u}{\sqrt t}\Big)\Big| \\ 
&=\int_0^\ep \frac{dt}{\sqrt t}\,\int_\R dz\,\big|f(y+z\sqrt t)\big|\,|z|\,\vpi(z) \\ 
&\le CC_{x,T}\int_0^\ep \frac{dt}{\sqrt t}\,\int_\R dz\,e^{z^2/3}\vpi(z) \to0
\end{aligned}   
\tag{8}
\end{equation*}
as $\ep\downarrow0$, where $C_{x,T}$ is a real number depending only on $x,T$, but not on $\ep$.
Now we can write
\begin{equation*}
\begin{aligned}
&   \int_0^T \frac{dt}t\, Ef(x+W_t)W_t \\ 
    =&\int_0^T \frac{dt}t\,\int_\R dz\,f(x+z\sqrt t)z\sqrt t\,\vpi(z) \\ 
    =&\int_0^T \frac{dt}t\int_\R du\,f(u)
    \frac{u-x}{\sqrt t}\vpi\Big(\frac{x-u}{\sqrt t}\Big) \\  
    =&\int_0^T \frac{dt}{\sqrt t}\int_\R du\,
    \partial_x\Big(f(u)
    \vpi\Big(\frac{x-u}{\sqrt t}\Big)\Big) \\  
    =&  \partial_x\int_0^T dt\int_\R du\,f(u)
\frac1{\sqrt t}\vpi\Big(\frac{x-u}{\sqrt t}\Big) \\    
    =&  \partial_x\int_0^T dt\, Ef(x+W_t)=u'(x);   
\end{aligned}
    \tag{9}
\end{equation*}
the interchange of the differentiation and integration (the fourth equality in display (9)) is possible by Lemma 2.3, in view of (5), (6), (7), and (8). The penultimate equality in (9) holds by (4).
Thus, it is proved that (3) is sufficient for (1).
