<s>[INST] Help evaluating an interesting series. I'm trying to evaluate the sum
$$
s = 1+\frac{1}{3}-\frac{1}{5}-\frac{1}{7}+\frac{1}{9}+\frac{1}{11}\cdots.
$$
The hint I was given was $\frac{1}{2n+1} = \int_0^1 x^{2n} \, dx$. I'm familiar with the trick of writing the $n$th term of series with a definite integral and then interchanging the order of integral and sum, but the signs on the terms are making this difficult for me. If this were a normal alternating series, we could do something like
\begin{align*}
\sum_{n=0}^{\infty}(-1)^n\frac{1}{2n+1} &= \sum_{n=0}^\infty\int_0^1 (-1)^n x^{2n} \, dx\\
&= \int_0^1 \left(\sum_{n=0}^{\infty} (-x^2)^{n}\right)dx\\
&= \int_0^1 \frac{1}{1+x^2} \, dx = \arctan(1)-\arctan(0) = \frac{\pi}{4}.
\end{align*}
I can't however seem to proceed with the strange alternating series. I know that $(-1)^{(n^2+n+2)/2}$ gives the right pattern of $++--++--\dots$, but that doesn't combine well with the $x^{2n}$ term in the integrand after exchanging sum and integral.
Any thoughts?
Edit: If I use the imaginary unit $i$, then I can write a related sum
$$
\tilde{s} = 1+\frac{1}{3}i-\frac{1}{5}-\frac{1}{7}i+\frac{1}{9}+\frac{1}{11}\cdots.
$$
Using the above trick gives
$$
\sum_{n=0}^{\infty}(i)^{n}\frac{1}{2n+1} = \sum_{n=0}^{\infty}\int_{0}^{1}(i)^nx^{2n}dx = \int_{0}^{1} \sum_{n=0}^{\infty}(ix^2)^n =\int_{0}^{1}\frac{1}{1-ix^2}dx
$$
Which I imagine I can do with some type of partial fraction decomposition.
My hope is that from this new sum I can recover my old sum by adding real and imaginary parts. My only concern is that this would essentially be a rearrangement of the series (adding the even indexed terms together and then the odd indexed terms separately) and this series doesn't converge absolutely so I'm worried that this isn't rigorously justified.
 [/INST] $$  \left( 1+x^2 - x^4 - x^6 \right)  \left(1 + x^8 + x^{16} + x^{24}  + x^{32} + x^{40} + x^{48} \cdots  \right) $$
$$   \frac{1+x^2-x^4-x^6}{1-x^8} =   \frac{(1-x^4)(1+x^2)}{(1-x^4)(1 + x^4)} = \frac{1+x^2}{1 + x^4}$$
which can be integrated by partial fractions; note that
$$ x^4 + 1 = \left(x^2 - x\sqrt 2 + 1 \right)  \left(x^2 + x \sqrt 2 + 1 \right) $$
We are looking for
$$  \int \frac{1}{1+(x \sqrt 2 + 1)^2}  + \frac{1}{1+(x \sqrt 2 - 1)^2} dx $$
</s>