Mellin transform of polynomials over the unit interval. How to invert? Let's take the mellin transform of $1 - 2 x$ over the interval $x = 0 \ldots
1$
\begin{equation}
  \int_0^1 (1 - 2 x) x^{s - 1} d x = - \frac{s - 1}{s (s + 1)}
\end{equation}
How can we use the mellin inversion theorem to transform $- \frac{s - 1}{s (s
+ 1)}$ back into $1 - 2 x$?
 A: To exist (convergence of the integral near $x=0$), the Mellin transform you calculated needs the condition $\Re(s)>0$. Then, the inverse transform can be written as
\begin{equation}
f(x)=\frac{1}{2i\pi}\int_{c-i\infty}^{c+i\infty}x^{-s}\frac{1-s}{s(s+1)}\,ds
\end{equation} 
where $\Re(c)>0$.The function to integrate has two poles: $s=0$ and $s=-1$, their corresponding residues being $1$ and $-2$. 
When $0<x<1$, we choose to close the contour by a large half-circle $\Re(s)<c$ and use the residue theorem. The contribution of the half-circle can easily be seen to vanish as its radius increases to infinity. Then
\begin{equation}
f(x)=1-2x
\end{equation} 
When $x>1$, closing the contour by a large half-circle $\Re(s)>c$, both poles are out of the contour and the contribution of the half-circle vanishes. Then
\begin{equation}
f(x)=0
\end{equation} 
A: We have also the line integral without any need to deal with circles and contours
${\frac {-i/2}{\pi }\int_{c-i\infty }^{c+i\infty }\!-{\frac { \left( s-
1 \right) {x}^{-s}}{ \left( s+1 \right) s}}\,{\rm d}s}={\frac {-i/2
 \left( -4\,ix\pi +2\,i\pi  \right) }{\pi }}=-2\,x+1 \forall c>0,0<x<1$
