I would like to find the sum:
$$ \sum^{\infty}_{n=1} \frac{S(2\sqrt{n}) \cdot C(2\sqrt{n})}{n^3}$$
where $ S(n)$ and $C(n)$ denote the Sine and Cosine Fresnel Integrals respectively. But somewhere in my work i've made a mistake (maybe several) and I would like to know where I went awry.
My work:
To start I use Parseval's identity which states:
$$2\pi\sum_{n=-\infty}^{\infty} |c_n|^2 = \int_{-\pi}^{\pi} |f(x)|^2 \space dx$$
where
$$c_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x) \cdot e^{-inx}\space dx$$
I consider the function:
$$ f(x) = \sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})$$
$c_n$ becomes:
$$c_n = \frac{1}{2\pi}\int_{-\pi}^{\pi} (\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})) \cdot e^{-inx}\space dx$$
This integral is quite difficult for me, so I plugged it into wolfram alpha and found:
$$c_n = \frac{1}{2\pi} \cdot \frac{(-1)^n \sqrt{i\pi}}{2n^{3/2}} \cdot (erfi(\sqrt{2\pi in}) + i\cdot erf(\sqrt{2\pi in}) ) = \frac{1}{4\sqrt{2\pi}} \cdot \frac{(-1)^n (1+i)}{n^{3/2}}\cdot (erfi(\sqrt{2\pi in}) + i\cdot erf(\sqrt{2\pi in}) )$$
where $erf(x)$ and $erfi(x)$ are the error function and imaginary error function respectively.
$g(n) = erfi(\sqrt{2\pi in}) + i\cdot erf(\sqrt{2\pi in}) $ is a complex function with a real and imaginary part, but I believe that:
$$g(n) = erfi(\sqrt{2\pi in}) + i\cdot erf(\sqrt{2\pi in})= \begin{cases} 2i \cdot (C(2\sqrt{n}) + S(2\sqrt{n})) &\text{if }\, n\gt 0\\ 2 \cdot (C(2\sqrt{-n}) - S(2\sqrt{-n})) &\text{if }\, n\lt 0\\ 0 &\text{n = 0} \end{cases} $$
So putting everything together I get that:
$$c_n = \frac{1}{4\sqrt{2\pi}} \cdot \frac{(-1)^n (1+i)}{n^{3/2}}\cdot \begin{cases} 2i \cdot (C(2\sqrt{n}) + S(2\sqrt{n})) &\text{if }\, n\gt 0\\ 2 \cdot (C(2\sqrt{-n}) - S(2\sqrt{-n})) &\text{if }\, n\lt 0\\ 0 &\text{n = 0} \end{cases}$$
simplifying a little gives:
$$c_n = \frac{1}{\sqrt{8\pi}} \cdot \frac{(-1)^n (1+i)}{n^{3/2}}\cdot \begin{cases} i \cdot (C(2\sqrt{n}) + S(2\sqrt{n})) &\text{if }\, n\gt 0\\ C(2\sqrt{-n}) - S(2\sqrt{-n}) &\text{if }\, n\lt 0\\ 0 &\text{n = 0} \end{cases}$$
I think that:
$$ |c_n|^2 = \frac{1}{8\pi} \cdot \frac{1}{n^{3}}\cdot \begin{cases} 2 \cdot (C(2\sqrt{n}) + S(2\sqrt{n}))^2 &\text{if }\, n\gt 0\\ 2 \cdot (C(2\sqrt{-n}) - S(2\sqrt{-n}))^2 &\text{if }\, n\lt 0\\ 0 &\text{n = 0} \end{cases}$$
now plugging this result into parseval's identity gives:
$$2\pi\sum_{n=-\infty}^{-1} \frac{1}{8\pi} \cdot \frac{1}{n^{3}}\cdot 2 \cdot (C(2\sqrt{-n}) - S(2\sqrt{-n}))^2 + 2\pi\sum_{n=1}^{\infty} \frac{1}{8\pi} \cdot \frac{1}{n^{3}}\cdot 2 \cdot (C(2\sqrt{n}) + S(2\sqrt{n}))^2 = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
simplifying gives:
$$\frac{1}{2}\sum_{n=-\infty}^{-1} \frac{1}{n^{3}}\cdot (C(2\sqrt{-n}) - S(2\sqrt{-n}))^2 + \frac{1}{2}\sum_{n=1}^{\infty} \frac{1}{n^{3}}\cdot (C(2\sqrt{n}) + S(2\sqrt{n}))^2 = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
for the first sum on the left hand side I make the substitution -n = t and can then rewrite the left hand side as:
$$\frac{1}{2}\sum_{t=1}^{\infty} -\frac{1}{t^{3}}\cdot (C(2\sqrt{t}) - S(2\sqrt{t}))^2 + \frac{1}{2}\sum_{n=1}^{\infty} \frac{1}{n^{3}}\cdot (C(2\sqrt{n}) + S(2\sqrt{n}))^2 = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
i replace the dummy variable t with n and rewrite once more:
$$\frac{1}{2}\sum_{n=1}^{\infty} -\frac{1}{n^{3}}\cdot (C(2\sqrt{n}) - S(2\sqrt{n}))^2 + \frac{1}{n^{3}}\cdot (C(2\sqrt{n}) + S(2\sqrt{n}))^2 = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
all terms on the left hand side should cancel except for the mixed terms giving:
$$\frac{1}{2}\sum_{n=1}^{\infty} \frac{1}{n^{3}}\cdot 4(C(2\sqrt{n})S(2\sqrt{n})) = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
So I get that:
$$2\sum_{n=1}^{\infty} \frac{1}{n^{3}}\cdot (C(2\sqrt{n})S(2\sqrt{n})) = \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx$$
Wolfram alpha says that
$$ \int_{-\pi}^{\pi} |\sqrt{x + \pi} - (i\cdot\sqrt{x-\pi})|^2 \space dx = \pi^2 \cdot (4 + \pi)$$
which would mean that:
$$\sum_{n=1}^{\infty} \frac{1}{n^{3}}\cdot (C(2\sqrt{n})S(2\sqrt{n})) = \frac{\pi^2}{2} \cdot (4 + \pi)$$
however, when I checked the left hand sum on wolfram alpha the sum is ~0.207871 while $\frac{\pi^2}{2} \cdot (4 + \pi) ~ 35.242$
I can't tell where I made a mistake in my work, could I get some help?
Take care ! In Mathematica (and then Wolfram Alpha) $$S(z)=\int_0^z \sin \left(\frac{\pi }{2}t^2\right)\,dt\qquad C(z)=\int_0^z \cos\left(\frac{\pi }{2}t^2\right)\,dt$$ and not $$S(z)=\int_0^z \sin \left(t^2\right)\,dt\qquad C(z)=\int_0^z \cos\left(t^2\right)\,dt$$
This explains the difference you observe.