Derivation of Perron's formula I tried to derive Perron's formula, but got really screwed up. I know of other ways to derive it, but I'm not quite sure why this way isn't working. I would appreciate some pointers on where I'm going wrong here.
The problem I'm working on actually requires me to define this for something like a "continuous Dirichlet series." This is basically a Mellin transform under a change of variables, but it's notationally useful to make that change, so I'm going to do that below.
Let's define the "Dirichlet transform" of a function $f(x)$ as $\mathcal{D}f(s) = \mathcal{M}f(1-s)$. Then:
$\mathcal{D}f(s) = \int_0^\infty f(x) \, x^{-s}\, dx$
Now, let's look at the inverse Mellin transform. Applying the substitution $u = \phi(s) = 1-s$, we get
$f(x) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} \mathcal{M}f(s) \, x^{-s} \, ds \\
= \frac{1}{2 \pi i} \int_{\phi^{-1}(c-i\infty)}^{\phi^{-1}(c+i\infty)}\mathcal{M}f(\phi(s)) \, x^{-\phi(s)} \, \phi'(s) \, ds \\
= \frac{1}{2 \pi i} \int_{1-c+i\infty}^{1-c-i\infty} \mathcal{M}f(1-s) \, x^{s-1} \, (-1) ds$
Noting that the limits on the integral have been order-reversed, we can flip them around and cancel out the extra $-1$ term:
$f(x) = \frac{1}{2 \pi i} \int_{d-i\infty}^{d+i\infty} \mathcal{D}f(s) \, x^{s-1} \, ds $
making the substitutions $\mathcal{D}f(s) = \mathcal{M}f(1-s)$ and $d = 1-c$.
Now, since the Mellin transform of a Dirac delta distribution $\delta(x-n)$ is $n^{s-1}$, its Dirichlet transform is $n^{-s}$. Thus, we can identify any arithmetic function $a(n)$ with a weighted delta train $\tilde{a}(x) = \sum_n a(n) \, \delta(x-n)$, in the sense that the Dirichlet series associated with the former equals the Dirichlet transform of the latter.
Now, note that the summatory function $A(x) = \int_0^x \tilde{a}(t) \, dt$.
Given the Mellin transform $\mathcal{M}f(s)$ of $f(x)$, the Mellin transform of $\int_0^x f(t) \, dt$ is $\mathcal{M}\hat{f}(s) = \frac{1}{-s} \mathcal{M}f(s+1)$. Hence, its Dirichlet transform is $\mathcal{D}\hat{f}(s) = \mathcal{M}\hat{f}(1-s) = \frac{1}{s-1} \mathcal{M}f(2-s) = \frac{1}{s-1} \mathcal{D}f(s+1)$.
Now, let's try to derive Perron's formula by taking the inverse Dirichlet transform of the Dirichlet transform of $\int_0^x \tilde{a}(t) \, dt$.
$\mathcal{D}\tilde{a}(s) = \int_0^\infty \tilde{a}(x) \, x^{-s} \, dx \\
\mathcal{D}\hat{\tilde{a}}(s) = \frac{1}{s-1} \mathcal{D} \tilde{a}(s+1) \\
A(x) = \frac{1}{2 \pi i} \int_{d-i\infty}^{d+i\infty} \mathcal{D}\hat{\tilde{a}}(s) \, x^{s-1} \, ds \\
A(x) = \frac{1}{2 \pi i} \int_{d-i\infty}^{d+i\infty} \frac{1}{s-1} \mathcal{D} \tilde{a}(s+1) \, x^{s-1} \, ds \\$
However, Perron's formula says
$A(x) = \frac{1}{2 \pi i} \int_{d-i\infty}^{d+i\infty} \frac{1}{s} \mathcal{D} \tilde{a}(s) \, x^{s} \, ds \\$
Is there some way these two are equivalent, or have I done something wrong?
 A: Given a Dirichlet series
$$
D(s)=\sum_{n=1}^{+\infty}a_{n}n^{-s}\;,
$$
with abscissa of absolute convergence $\sigma=\sigma_{0}\in\Bbb R$, then we get
\begin{equation}
\sideset{}{'}\sum_{n\leq x}a_{n}=\frac{1}{2\pi i}\int_{c-\infty i}^{c+\infty i}D(s)x^{s}\frac{ds}{s}\;,
\end{equation}
ove $c>\sigma_{0}$; in this way, the Dirichlet series $D(s)$ converges absolutely on the integration line $\sigma=c$. The sign over the sum symbol denotes that if $x\in\Bbb N$, then the last term of the sum is counted with weight $\frac{1}{2}$, i.e. it is substitued by $\frac{1}{2}a_{x}$. 
Observing that that the absolute convergence of $D$ allows to permute the sum with the integral, we'll authorized to integrate term-by-term on the line  $\sigma=c$, thus:
\begin{align*}
\frac{1}{2\pi i}\int_{c-\infty i}^{c+\infty i}D(s)x^{s}\frac{ds}{s}
=&\frac{1}{2\pi i}\int_{c-\infty i}^{c+\infty i}\sum_{n=1}^{+\infty}a_{n}n^{-s}x^{s}\frac{ds}{s}\\
=&\frac{1}{2\pi i}\int_{c-\infty i}^{c+\infty i}\sum_{n=1}^{+\infty}a_{n}\left(\frac{x}{n}\right)^{s}\frac{ds}{s}\\
=&\sum_{n=1}^{+\infty}a_{n}\frac{1}{2\pi i}\int_{c-\infty i}^{c+\infty i}\left(\frac{x}{n}\right)^{s}\frac{ds}{s}\\
=&\sideset{}{'}\sum_{n\leq x}a_{n}\;,
\end{align*}
However the real Perron formula is a version of this one, slightly more general in which the integration is performed over a segment, not over a whole line: the proof is long and in this case we should take in account some error terms.
