$\cos{n^2}/n$ series convergence

Given series $\sum_{n=1}^{\infty}\frac {\cos(n^2)}n$.

It is easy to prove it does not converge absolutely.

I need to prove that it converges —Āonditionally.

I thought about using Dirichlet’s test because $1/n$ series is monotone and $\lim_{n\rightarrow\infty} 1/n = 0$.

So the thing i need to prove is $\left|\sum_{1}^k \cos(n^2)\right| < M,\ \forall k$.

If there was $\cos(n)$ instead of $n^2$, it would be easy to prove this statement by multiplication and division by $\cos(0.5)$ and then using some trigonometric formula so that $\left|\sum_{1}^k \cos(n^2)\right| = \left|\frac{cos(0.5)-cos(n-0.5)}{\cos(0.5)}\right| < 2$ or something like that. But this approach seems to be impossible for $\cos(n^2)$.

Maybe there is a way to prove it using the fact that $\int \cos(x^2) = \sqrt{2/\pi}$?

Or any simpler way?

Solutions Collecting From Web of "$\cos{n^2}/n$ series convergence"

It is sufficient to show that
$$\left|\sum_{n=0}^{N}\cos(n^2)\right|\leq C\sqrt{N}\log N\tag{1}$$
to ensure convergence by partial summation. Consider that:
$$\left\|\sum_{n=1}^{N}e^{in^2}\right\|^2 = \left(\sum_{n=1}^{N}e^{in^2}\right)\cdot\left(\sum_{n=1}^{N}e^{-in^2}\right)=N+\sum_{d=1}^{N-1}\sum_{r=1}^{N-d}2\cos(2dr+d^2),\tag{2}$$
and that:
$$(2)\ll \sum_{d=1}^{N-1}\min\left(N-d,\left\|\frac{d}{\pi}\right\|^{-1}\right)\tag{3}$$
(where $\|x\|$ denotes the distance of $x$ from the closest integer) by the usual arguments about simple exponential sums. If now we take $\frac{a}{q}$ as a good rational approximation of $\frac{1}{\pi}$, $\left|\frac{a}{q}-\frac{1}{\pi}\right|<\frac{1}{3Nq}$, it is not difficult to see that:
$$ (3)\ll \sum_{\substack{d=1\\q\nmid d}}^{N}\left\|\frac{a d}{q}\right\|^{-1}\ll(N+q)\log q\ll N\log N,\tag{4}$$
hence $(1)$ holds and the series $\sum_{n=1}^{+\infty}\frac{\cos n^2}{n}$ converges.