Question about integral identites / splitting I have questions about 2 integral identities that are used often.
1)
Following this thread: complex keyhole contour integral $\int_0^\infty \frac{x^{p-1}}{1+x^{2}} \, dx$, Mark Viola states that ($0<p<2$)
$$\int_{-\infty}^\infty \frac{x^{p-1}}{1+x^2}\,dx =(1+e^{i(p-1)\pi})\int_0^\infty \frac{x^{p-1}}{1+x^2}\,dx \tag1$$
if I let $p=1$, then it is clear, because  $1/(1+x^2)$ is even and we would be  having
$$\int_{-\infty}^\infty \frac{x^{0}}{1+x^2}\,dx =2\int_0^\infty \frac{x^{0}}{1+x^2}\,dx \tag2$$
but how can I prove/see that the general case in (1) holds?



*

and also this: Closed form for $ \int_0^\infty {\frac{{{x^n}}}{{1 + {x^m}}}dx }$ (robjohn) ($0<\alpha<1$)
\begin{align}
\int_0^\infty\frac{x^{\alpha-1}}{1+x}\,\mathrm{d}x &=\int_0^1\frac{x^{-\alpha}+x^{\alpha-1}}{1+x}\,\mathrm{d}x \tag3\\
\\
\end{align}
If someone could show to me how one can derive the formulae of (1) and (3) I would be really thankful.
(since they are similar I put them both in one question, hope that it is fine.)

1)
$$
\begin{align}
\int_{-\infty}^\infty\frac{x^{p-1}}{1+x^2}\,\mathrm{d}x
&=\int_0^\infty\frac{x^{p-1}}{1+x^2}\,\mathrm{d}x+\int_{-\infty}^0\frac{x^{p-1}}{1+x^2}\,\mathrm{d}x\tag{1a}\\
&=\int_0^\infty\frac{x^{p-1}}{1+x^2}\,\mathrm{d}x+(-1)^{p-1}\int_0^\infty\frac{u^{p-1}}{1+u^2}\,\mathrm{d}u\tag{1b}\\
&=\left(1+e^{i\pi(p-1)}\right)\int_0^\infty\frac{x^{p-1}}{1+x^2}\,\mathrm{d}x\tag{1c}
\end{align}
$$
Explanation:
$\text{(1a):}$ split the domain of integration
$\text{(1b):}$ substitute $x=-u$
$\text{(1c):}$ substitue $u\mapsto x$ and apply $-1=e^{i\pi}$
2) As mentioned by Anne Bauval in comments,
$$
\begin{align}
\int_0^\infty\frac{x^{a-1}}{1+x}\,\mathrm{d}x
&=\int_0^1\frac{x^{a-1}}{1+x}\,\mathrm{d}x+\int_1^\infty\frac{x^{a-1}}{1+x}\,\mathrm{d}x\tag{2a}\\
&=\int_0^1\frac{x^{a-1}}{1+x}\,\mathrm{d}x+\int_0^1\frac{u^{-a}}{1+u}\,\mathrm{d}u\tag{2b}\\
&=\int_0^1\frac{x^{a-1}+x^{-a}}{1+x}\,\mathrm{d}x\tag{2c}
\end{align}
$$
Explanation:
$\text{(2a):}$ split the domain of integration
$\text{(2b):}$ substitute $x=1/u$
$\text{(2c):}$ substitue $u\mapsto x$ and combine integrals
