Let $B$ be a standard Brownian motion and let $\alpha, \beta > 0$. Let \begin{align} \tau = \inf\{t \geq 0 : B_t = \alpha \ \ \text{or}\ \ B_t=-\beta\}. \end{align} It can be shown by defining independent events $A_j = \{|B_{j+1}-B_{j}| \geq \alpha + \beta\}$ for integers $0 \leq j \leq n-1$ and $\epsilon = \mathbb{P}(A_j) = \mathbb{P}(A_0) $, that there exists an $\epsilon \in (0,1)$ such that $\mathbb{P}(\tau \geq n) \leq (1-\epsilon)^{n}$.
My question is about showing that for all $p \geq 1$, $\mathbb{E}[\tau^p] < \infty$. I do not understand why \begin{align} \mathbb{E}[\tau^p] = \int_0^\infty p t^{p-1} \mathbb{P}(\tau \geq t ) dt. \end{align} And subsequently why is \begin{align} \int_0^\infty p t^{p-1} \mathbb{P}(\tau \geq t ) dt = \sum_{n=0}^\infty \int_n^{n+1} p t^{p-1} \mathbb{P}(\tau \geq t ) dt ? \end{align}
Note that $P(\tau\geq t)=E(I_{\{\tau\geq t\}})$ and $$\int_{0}^{+\infty}pt^{p-1}P(\tau\geq t)dt=\int_{0}^{+\infty}pt^{p-1}E(I_{\{\tau\geq t\}})dt\overset{!}{=} E\bigg(\int_{0}^{+\infty}pt^{p-1}I_{\{\tau\geq t\}}dt\bigg)=E\bigg(\int_{0}^{\tau}pt^{p-1}dt\bigg)=E(\tau^p),$$ where in ! we used the Fubini - Tonelli theorem. For the second part just note that $$\displaystyle \int_{0}^{\infty}g(t)dt=\sum_{n=0}^{+\infty}\int_{n}^{n+1}g(t)dt$$ for an integrable function $g$ on $[0,+\infty)$ (in the generalized sense).
EDIT. $$I_{\{\tau\geq t\}}=\left \{\begin {array}{ll} 1,~t\leq \tau\\ 0,~t> \tau\\ \end{array} \right. $$ and therefore $$\int_{0}^{+\infty}pt^{p-1}I_{\{\tau\geq t\}}dt=\int_{0}^{\tau}pt^{p-1}~dt + \int_{\tau}^{+\infty}0~dt= \int_{0}^{\tau}pt^{p-1}dt.$$