Potential Density of Brownian local time Let $L_t^a$ be the local time of a Brownian motion $W_t$. Then in particular, $$L_t^a = \lim_{\varepsilon \longrightarrow 0} \frac{1}{\varepsilon} \lambda( s \in [0,t] : W_s \in [a,a+\varepsilon])$$ holds. The book I'm working with defines the potential density, given a terminal time $T$ as the following: $$u_T(x,y)=\mathbb{E}^x[L_T^y],$$ where the expectation is calculated for the law of a Brownian starting at $x \in \mathbb{R} $. For the terminal time $T_0=\inf \{t \geq 0 : W_t = 0\} $ my book states that the following holds: $$ u_{T_0}(x,y)= \begin{cases} 2(|x| \wedge |y|) \text{ if }xy>0 \\ 0 \text{ if }xy \leq 0 \end{cases}  $$
I don't have a clue why this should be the case. Especially thinking, that $u_{T_0} (1,2) = u_{T_0}(1,9999999)$ seems absurd to me, the expectation of $W$ being close to $9999999$ before reaching $0$ should be much lower than $W$ being close to $2$ before reaching $0$.
 A: One way to this is through Tanaka's formula:
$$
|W_t-y|=|x-y|+\int_0^t\operatorname{sgn}(W_s-y) dW_s + L^y_t.\qquad\qquad (1)
$$
The stochastic integral is a continuous martingale, call it $M$, with $M_0=0$.
If $x$ and $y$ are of different signs, then no local time at $y$ will accrue before $T_0$, so $u_{T_0}(x,y)=0$ is clear in that case.
In the remaining case, $x$ and $y$ have the same sign; let's say both positive (without loss of generality).
Case 1: $0<y<x$. In this case, no local time accrues until time $T_y$, which time happens strictly before $T_0$. Therefore $u_{T_0}(x,y) = u_{T_0}(y,y)$. One is tempted to now take expectations of both sides of (1), invoking the optional stopping theorem. Some care is needed here. Define $\tau_m:=\inf\{t: |M_t|>m\}$. Then $M_{t\wedge\tau_m}$ is a bounded martingale.
With $t=T_{T_0\wedge T_n\wedge \tau_m}$ in (1), taking expectations  we obtain
$$
E^y[|W_{T_0\wedge T_n\wedge\tau_m}-y|]=E^y[L^y_{T_0\wedge T_n\wedge\tau_m}].\qquad\qquad (2)
$$
The process $W$ stopped at time $T_0\wedge T_n$ is bounded, so we can let $m\to\infty$ in (2) to obtain
$$
E^y[|W_{T_0\wedge T_n}-y|]=E^y[L^y_{T_0\wedge T_n}].\qquad\qquad(3)
$$
But it is well known that $P^y[T_0<T_n] = (n-y)/n$, so the left side of (3) can be explicitly evaluated and seen to be equal to
$$
{2y(n-y)\over n}.
$$
Letting $n\to\infty$ in (3), using monotone convergence on the right we see that
$$
2y=u_{T_0}(y,y)
$$
for $y>0$.
Case 2: $0<x<y$. In this case, if $T_0<T_y$ then $L^y_{T_0}=0$. Using the strong Markov property at time $T_y$:
$$
u_{T_0}(x,y) =P^x[T_y<T_0]\cdot u_{T_0}(y,y).
$$
Using the value for $u_{T_0}(y,y)$ found in Case 1, and the known fact that
$$
P^x[T_y<T_0]={x\over y}
$$
you have $u_{T_0}(x,y) = 2x$ in this case.
In short, $u_{T_0}(x,y) = 2(x\wedge y)$ when both $x$ and $y$ are positive.
