Prove $\int_0^{\infty }\frac1{\sqrt{x}}\left(\frac{\cos(\pi x^2)}{\sinh (\pi x)}-\frac1{\pi x}\right)dx=\frac{1}{\sqrt{2}}\zeta(\frac{1}{2})$ I encountered an astonishing integral (numerically verified)

$$\int_0^{\infty } \frac{1}{\sqrt{x}}\left[\frac{\cos \left(\pi  x^2\right)}{\sinh (\pi  x)}-\frac{1}{\pi x}\right] \, dx=\frac{1}{\sqrt{2}}\zeta\left(\frac{1}{2}\right)$$

What technique should we use to establish it? Any help will be appreciated.
 A: Let $$\mathscr{I}(s) = \int_0^\infty  {{x^{s - 1}}\left( {\frac{{\cos (\pi {x^2})}}{{\sinh \pi x}} - \frac{1}{{\pi x}}} \right)dx} $$
It suffices to prove, for $0<\Re(s)<1$, $$\tag{*}\mathscr{I}(s) + 2\frac{{\Gamma (s)}}{{{{(2\pi )}^s}}}\sin \frac{{\pi s}}{2}\mathscr{I}(1 - s) = 2\frac{{\Gamma (s)\zeta (s)}}{{{{(2\pi )}^s}}}$$

We need a nontrivial Fourier transform:

(Lemma 1) For $\xi\in \mathbb{R}\setminus \{0\}$, $$\int_{ - \infty }^\infty  {(\frac{{{e^{i\pi {x^2}}}}}{{\sinh \pi x}} - \frac{1}{{\pi x}}){e^{ - 2\pi ix\xi }}dx}  = i\frac{{{e^{ - i\pi {\xi ^2}}} - {e^{\pi \xi }}}}{{\sinh \pi \xi }} + 2i{\chi _{(0,\infty )}}(\xi )$$
where $\chi_A$ is the characteristic function of set $A$.

Proof: Let $C(r)$ be a contour along real axis, but with small indention above $r \in \mathbb{R}$, then $$\int_{C(0)} {\frac{{{e^{i\pi {z^2}}}{e^{ - 2\pi iz\xi }}}}{{\sinh \pi z}}dz}  = {e^{ - i\pi {\xi ^2}}}\int_{C( - \xi )} {\frac{{{e^{i\pi {z^2}}}}}{{\sinh \pi (z + \xi )}}dz} $$
Let $F(z)=\dfrac{{{e^{i\pi {z^2}}}{e^{4\pi z}}}}{{\sinh \pi (z + \xi )\sinh 4\pi z}}$,
then $$F(z) - F(z + 4i) = \frac{{2{e^{i\pi {z^2}}}}}{{\sinh \pi (z + \xi )}}$$
therefore
$$\int_{C( - \xi )} {\frac{{2{e^{i\pi {z^2}}}}}{{\sinh \pi (z + \xi )}}dz}  = \int_C {F(z)dz}  = 2\pi i\color{red}{\frac{{1 - {e^{\pi \xi }}{e^{i\pi {\xi ^2}}}}}{{\pi \sinh \pi \xi }}}$$
where $C$ is the rectangular contour with vertices $\pm \infty, \pm \infty + 4i$, and has small indentions above $-\xi, -\xi+4i, 0, 4i$. Observe that $F$ has $20$ poles inside $C$, summing over residues at these points gives the red expression. Thus,
$$\begin{aligned}&\int_{ - \infty }^\infty  {(\frac{{{e^{i\pi {x^2}}}}}{{\sinh \pi x}} - \frac{1}{{\pi x}}){e^{ - 2\pi ix\xi }}dx}  = \int_{C(0)} {\frac{{{e^{i\pi {z^2}}}{e^{ - 2\pi iz\xi }}}}{{\sinh \pi z}}dz}  - \int_{C(0)} {\frac{{{e^{ - 2\pi iz\xi }}}}{{\pi z}}dz}  \\ &= i\frac{{{e^{ - i\pi {\xi ^2}}} - {e^{\pi \xi }}}}{{\sinh \pi \xi }} + 2i{\chi _{(0,\infty )}}(\xi )\end{aligned}$$
proving the lemma.

Let $0<\Re(s)<1$, we have $$\int_0^\infty  {{x^{s - 1}}{e^{ - 2\pi ix\xi }}dx}  = \frac{{\Gamma (s)}}{{{{(2\pi i)}^s}}}{\xi ^{ - s}}\qquad \Im(\xi)\leq 0$$
Plancherel theorem
$\int_\mathbb{R} f(x) \overline{g(x)} dx = \int_\mathbb{R} \hat{f}(\xi) \overline{\hat{g}(\xi)} d\xi$ produces
$$\begin{aligned}&\int_0^\infty  {{x^{s - 1}}\left( {\frac{{{e^{-i\pi {x^2}}}}}{{\sinh \pi x}} - \frac{1}{{\pi x}}} \right)dx}  = \frac{{\Gamma (s)}}{{{{(2\pi i)}^s}}}\int_{ - \infty }^\infty  {{\xi ^{ - s}}\left[ { - i\frac{{{e^{i\pi {\xi ^2}}} - {e^{\pi \xi }}}}{{\sinh \pi \xi }} - 2i{\chi _{(0,\infty )}}(\xi )} \right]d\xi } 
\\ &=  - \frac{{\Gamma (s)}}{{{{(2\pi )}^s}}}{e^{ - \pi is/2}}i\int_0^\infty  {{\xi ^{ - s}}\left[ {\frac{{{e^{i\pi {\xi ^2}}} - {e^{\pi \xi }}}}{{\sinh \pi \xi }} + 2} \right]d\xi }  + \frac{{\Gamma (s)}}{{{{(2\pi )}^s}}}{e^{\pi is/2}}i\int_0^\infty  {{\xi ^{ - s}}\frac{{{e^{i\pi {\xi ^2}}} - {e^{ - \pi \xi }}}}{{\sinh \pi \xi }}d\xi }\end{aligned}$$
Taking complex conjugation (i.e. replace $i$ by $-i$), then sum up with the original gives:
$$\begin{aligned}\mathscr{I}(s) &=  - \frac{{\Gamma (s)}}{{{{(2\pi )}^s}}}\sin \frac{{\pi s}}{2}\int_0^\infty {{\xi ^{ - s}}\left[ {\frac{{{e^{ - i\pi {\xi ^2}}} - {e^{\pi \xi }}}}{{\sinh \pi \xi }} + 2 + \frac{{{e^{i\pi {\xi ^2}}} - {e^{ - \pi \xi }}}}{{\sinh \pi \xi }}} \right]d\xi } \\
& = - \frac{{\Gamma (s)}}{{{{(2\pi )}^s}}}\sin \frac{{\pi s}}{2} \left[ 2\mathscr{I}(1 - s) + 2\int_0^\infty  {{x^{ - s}}\left( {\frac{1}{{\pi x}} - \coth \pi x + 1} \right)dx}\right]
\end{aligned}$$
the next lemma completes the proof of $(*)$.

(Lemma 2) For $0<\Re(s)<1$, $$\int_0^\infty  {{x^{s - 1}}\left( {\frac{1}{{\pi x}} + 1 - \coth \pi x} \right)dx}  =  - \sec \frac{{\pi s}}{2}\zeta (1 - s)$$

Proof: A lucid method is via Mellin inversion. First, expand $\coth \pi x$ in power series of $e^{-\pi x}$, termwise integration yields
$$\int_0^\infty  {{x^{s - 1}}\left( {1 - \coth \pi x} \right)dx}  =  - {2^{1 - s}}{\pi ^{ - s}}\Gamma (s)\zeta (s) =  - \sec \frac{{\pi s}}{2}\zeta (1 - s) \qquad \Re(s)>1$$
where we used the functional equation of $\zeta$. Note that $\zeta$ has "moderate growth" in every vertical strip, so Mellin inversion is permissible
$$\frac{1}{{2\pi i}}\int_{\sigma  - i\infty }^{\sigma  + i\infty } {\left[ { - \sec \frac{{\pi s}}{2}\zeta (1 - s)} \right]{x^{ - s}}ds}  = 1 - \coth \pi x \qquad \sigma>1$$
Now shift the path of integration, to make it has real part $0<\sigma'<1$, taking residue at $s=1$ into account, the LHS of above equation equals
$$  \frac{1}{{2\pi i}}\int_{\sigma ' - i\infty }^{\sigma ' + i\infty } {\left[ { - \sec \frac{{\pi s}}{2}\zeta (1 - s)} \right]{x^{ - s}}ds}  - \frac{1}{{\pi x}} \qquad 0<\sigma'<1$$
apply Mellin inversion again proves the lemma.
