Let $W(t)_{t\ge 0}, B(t)_{t\geq0}$ be independent Brownian Motions on $\Bbb R$ an $\tau(a) := \inf \{ t \geq 0 : W(t) = a\}$ the first hitting time of $a\geq0$. Now I want the distribution of $$X(a) := B(\tau (a))$$
My attempt (EDITED):
I know the density of $\tau(a)$. It is $$\rho_{\tau(a)}(t)= \frac a {\sqrt{2 \pi t^3}} \exp\left({\frac {- a^2}{2t}}\right)$$ So further we can calculate for a suitable function $f$: $$\Bbb E[f(X(a))] = \Bbb E [f(B(\tau (a)))] =\int_0^\infty \frac a {\sqrt{2 \pi t^3}} \exp\left({\frac {- a^2}{2t}}\right) \int_\Bbb R \frac 1 {\sqrt{2\pi t}}\exp\left( \frac {- y^2}{2t} \right) f(y) \text{d}y \text{d}t \\ = \int_\Bbb R f(y) \int_0^\infty \frac{a}{2\pi t^2}\exp\left( \frac {-a^2 - y^2}{2t} \right) \text{d}t \text{d}y $$
But here I don't know how to get further. So far I know it should be $$\int_0^\infty \frac{a}{2\pi t^2}\exp\left( \frac {-a^2 - y^2}{2t} \right) \text{d}t \overset{!}{=} \frac {a}{\pi(a^2 +y^2)}$$ But I think that is not the way to do it, maybe someone has another idea for this.
EDIT: it is straight forward to show the (!)
You made a little mistake in your expression. You should have written $$ \begin{split} \Bbb E\left[f\big(B(\tau(a))\big)\right]&=\int_0^\infty\mathrm d t\frac{a}{\sqrt{2\pi t^3}}\mathrm e^{-a^2/2t}\int_{\Bbb R}f(y)\exp\left(-\frac{y^2}{2{\color{red} t}}\right)\frac{\mathrm dy}{\sqrt{2\pi t}}\\ &=\frac{a}{2\pi}\int_{\Bbb R}f(y)\mathrm dy\int_0^\infty\exp\left(-\frac{a^2+y^2}{2t}\right)\frac{\mathrm dt}{t^2}\\ &=\int_{\Bbb R}f(y)\underbrace{\frac{a}{\pi}\frac{1}{a^2+y^2}}_{\text{Cauchy law density}}\,\mathrm dy. \end{split} $$