# Provide us a detailed explanation to calculate the Mellin transform of a cosine function, and get the closed form of a related sum

I would like to know how define and compute the Mellin transform (see the definition of previous integral transform in the Wikipedia's article) of $\cos\left(2\pi\frac{k}{n}x\right)$. My genuine problem is consider the Möbius function expressed as $$\mu(n)=\sum_{\substack{(k,n)=1\\1\leq k\leq n}}\cos\left(2\pi\frac{k}{n}\right),$$ then I am interested in calculate the Mellin transform of the following related function, here thus $n\geq 1$ is a fixed integer, $$f_{n}(x)=\sum_{\substack{(k,n)=1\\1\leq k\leq n}}\cos\left(2\pi\frac{k}{n}x\right)$$ as $$\left\{ \mathcal{M} f_n\right\}(s)=\sum_{\substack{(k,n)=1\\1\leq k\leq n}}\int_0^\infty x^{s-1}\cos\left(2\pi\frac{k}{n}x\right)dx,$$ using that this integral transform is linear.

Question 1. Can you explain how get easily the Mellin transform of one of the summands, thus $$\int_0^\infty x^{s-1}\cos\left(2\pi\frac{k}{n}x\right)dx?$$ Where is defined the integral transform? (I say where is defined the result.)

After,

Question 2. Can you state the more simplified form (if there are simplifications to get the sum) for $$\left\{ \mathcal{M} f_n\right\}(s)?$$ Thanks in advance.

• All users, the main question was solved and the second (more optional), now I try do more calculations (using the functional equation), but I believe that there are no closed form for such sum on $gcd(k,n)=1$ with $1\leq k\leq n$. The main problem for me was how start to calculate Mellin transforms. Thanks all user. – user243301 Sep 10 '16 at 19:37

Let $a=\frac{k}{n}$ for $k,n \in \mathbb{N}$ $$\int\limits_{0}^{\infty} x^{s-1} \cos(2\pi a x) \mathrm{d}x = \frac{1}{2} \int\limits_{0}^{\infty} x^{s-1} \mathrm{e}^{ia2\pi x} + x^{s-1} \mathrm{e}^{-ia2\pi x} \mathrm{d}x$$

The first integral: \begin{align} \int\limits_{0}^{\infty} x^{s-1} \mathrm{e}^{ia2\pi x} \mathrm{d}x &= \left(\frac{-1}{ia2\pi}\right)^{s} \int\limits_{0}^{\infty} y^{s-1} \mathrm{e}^{-y} \mathrm{d}y \\ &= \left(\frac{-1}{ia2\pi}\right)^{s} \Gamma(s) \\ &= \frac{1}{(a2\pi)^{s}} \Gamma(s) \mathrm{e}^{is\pi/2} \end{align}

The second integral: \begin{align} \int\limits_{0}^{\infty} x^{s-1} \mathrm{e}^{-ia2\pi x} \mathrm{d}x &= \frac{1}{(ia2\pi)^{s}} \int\limits_{0}^{\infty} y^{s-1} \mathrm{e}^{-y} \mathrm{d}y \\ &= \frac{1}{(ia2\pi)^{s}} \Gamma(s) \\ &= \frac{1}{(a2\pi)^{s}} \Gamma(s) \mathrm{e}^{-is\pi/2} \end{align}

Thus, \begin{align} \int\limits_{0}^{\infty} x^{s-1} \cos(2\pi a x) \mathrm{d}x &= \frac{1}{2} \Big[\frac{1}{(a2\pi)^{s}} \Gamma(s) \mathrm{e}^{is\pi/2} + \frac{1}{(a2\pi)^{s}} \Gamma(s) \mathrm{e}^{-is\pi/2} \Big] \\ &= \frac{1}{(a2\pi)^{s}} \Gamma(s) \cos\left(\frac{s\pi}{2}\right) \end{align}

Here is another solution that avoids the issue addressed in the comment made by user243301.

In Volume 2 of Higher Transcendental Functions (Bateman Manuscript), Section 9.10, Equation 1 we have a generalization of the fresnel integrals attributed to Bohmer: \begin{align} \mathrm{C}(x,a) &= \int\limits_{x}^{\infty} z^{a-1} \cos(z) \mathrm{d}z \\ &= \frac{1}{2} \Big[\mathrm{e}^{i\pi a/2} \Gamma(a,-ix) + \mathrm{e}^{-i\pi a/2} \Gamma(a,ix)\Big] \end{align}

Thus $$\mathrm{C}(0,a) = \int\limits_{0}^{\infty} z^{a-1} \cos(z) \mathrm{d}z = \Gamma(a) \cos\left(\frac{\pi}{2}a\right)$$

For our integral, let $z=2\pi ax$ $$\int\limits_{0}^{\infty} x^{s-1} \cos(2\pi as) \mathrm{d}x = (2\pi a)^{-s} \int\limits_{0}^{\infty} z^{s-1} \cos(z) \mathrm{d}z = (2\pi a)^{-s} \Gamma(s) \cos\left(\frac{\pi}{2}s\right)$$

• Very thanks much, your answer is very valuable because now I've understand more things. I've understand that you use $\cos z=(e^{iz}+e^{-iz}/2)$, after the first integral (the second is the same calculation) you do the change of variable $y=-ia2\pi x$, and I've undertand subsequent calculations. The only that I don't know is how calculate the new upper limit of integration as $\infty$ (also I've observed that since $x=\infty$ then should be $y=-ia2\pi\infty$) but I don't know if this make sense. PLease how do you justify the upper limit of integration. Thanks, I accept the answer. – user243301 Sep 10 '16 at 19:34
• I am glad that you found the solution useful. I chose to interpret the limits of integration as moduli. This took care of the negative sign and allowed me to evaluate the integral. I checked my solution with Wolfram Alpha (using a = 1) and it matched. Maybe someone else can provide a proof for this. – poweierstrass Sep 10 '16 at 19:48
• Very thanks much to you and other user for your answer. – user243301 Sep 10 '16 at 19:53
• You can't do the complex change of variable $\int_0^\infty x^{s-1} e^{-i a x}dx = (ia)^{-s} \int_0^\infty x^{s-1} e^{- x} dx = (ia)^{-s} \Gamma(s)$ ($a \in \mathbb{R}$) without some complex analysis : contour integration or analytic continuation. @user243301 – reuns Sep 19 '16 at 1:55
• – reuns Sep 19 '16 at 1:58

$\int_0^\infty x^{s-1}\cos\dfrac{2\pi kx}{n}~dx=\dfrac{n^s\Gamma(s)}{2^s\pi^sk^s}\sin\dfrac{\pi(1-s)}{2}=\dfrac{n^s\Gamma(s)}{2^s\pi^sk^s}\cos\dfrac{\pi s}{2}$

• I believe that there is a typo in your answer. Very thanks much for your attention and reference. – user243301 Sep 10 '16 at 19:40
• $\pi$ in the denominator should be raised to the power s. – poweierstrass Sep 10 '16 at 19:50