Evaluating $\int_{0}^{1} \lim_{n \rightarrow \infty} \sum_{k=1}^{4n-2}(-1)^\frac{k^2+k+2}{2} x^{2k-1} dx$ for $n \in \mathbb{N}$ For $n \in \mathbb{N}$, evaluate
$$\int_{0}^{1} \lim_{n \rightarrow \infty} \sum_{k=1}^{4n-2}(-1)^\frac{k^2+k+2}{2} x^{2k-1} dx$$
I could not use wolframalpha, I do not know the reason.
For $n = 1$, the integrand $=x+x^3$
For $n = 2$, the integrand $=x+x^3-x^5-x^7+x^9+x^{11}$
For $n = 3$, the integrand $=x+x^3-x^5-x^7+x^9+x^{11}-x^{13}-x^{15}+x^{17}+x^{19}$
and so on.
For $n = 1000$, the integrand $=x+x^3-x^5-x^7+x^9+x^{11}-x^{13}-x^{15}+x^{17}+x^{19}-\dots+x^{7993}+x^{7995}$
Using MS-EXCEL with $n=1000$, I found that the value is approximately $0.56...$.
I do not know if  $n \rightarrow \infty$ , will the required expression have a closed form or no.

Your help would be appreciated. THANKS!

Let
$$a = \int_{0}^{1} \lim_{n \rightarrow \infty} \sum_{k=1}^{4n-2}(-1)^\frac{k^2+k+2}{2} x^{2k-1} dx$$
Modified solution (now the main solution)
We have two choices: integral first then sum or vice versa.
Taking the integral first gives the following for the (finite) sum which we split immediately into even and odd terms
$$a=\sum_{k=1}^{4n-2}(-1)^\frac{k^2+k+2}{2} \frac{1}{2k}=\sum_{m=1}^{2n-1}(-1)^\frac{1+m}{2} \frac{1}{4m}+\sum_{m=1}^{2n-1}(-1)^\frac{1-m}{2} \frac{1}{4m-2}\tag{1}$$
Now we take the limit $n\to \infty$ to get the result $(4)$ of the original solution.
Claude Leibovici, in a comment, has taken the other altervative with the sum first.
Original solution
Exchanging integral and sum, and doing the limit in the sum gives
$$\sum_{k=1}^{\infty}(-1)^\frac{k^2+k+2}{2} \frac{1}{2k}$$
Now splitting even and odd summands
$k \to 2m$, $(-1)^{\frac{k^2+k+2}{2}}\to (-1)^{1+m+2m^2}\to (-1)^{1+m}$
$$s_{e} = \sum_{m=1}^{\infty} (-1)^{1+m} \frac{1}{4 m}=\frac{\log(2)}{4}\tag{2}$$
$k \to 2m-1$, $(-1)^{\frac{k^2+k+2}{2}}\to (-1)^{1-m+2m^2}\to (-1)^{1-m}$
$$s_{o} = \sum_{m=1}^{\infty} (-1)^{1+m} \frac{1}{4 m-2}=\frac{\pi}{8}\tag{3}$$
Hence we have
$$a = s_{e}+s_{o} = \frac{\log(2)}{4} +\frac{\pi}{8}\simeq 0.565986... \tag{4}$$
