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.
 A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
You can write your series as
\begin{align}
&\bbox[5px,#ffd]{\sum_{n = 0}^{\infty}\pars{-1}^{n}
\pars{{1 \over 4n + 1} + {1 \over 4n + 3}}}
\\[5mm] = &\
\sum_{n = 0}^{\infty}\pars{-1}^{n}
\int_{0}^{1}\pars{x^{4n} + x^{4n + 2}}\dd x
\\[5mm] = &\
\int_{0}^{1}\pars{1 + x^{2}}
\sum_{n = 0}^{\infty}\pars{-x^{4}}^{n}\,\,\dd x
\\[5mm] = &\
\int_{0}^{1}\pars{1 + x^{2}}{1 \over 1 + x^{4}}\,\dd x
\\[5mm] = &\
\int_{0}^{1}{1 - x^{4} + x^{2} - x^{6} \over
1 - x^{8}}\,\dd x
\\[5mm] = &\
{1 \over 8}\int_{0}^{1}{x^{-7/8} - x^{-3/8} + x^{-5/8} - x^{-1/8}\,\, \over 1 - x}\,\dd x
\\[5mm] = &\
{1 \over 8}\bracks{-\Psi\pars{1 \over 8} +
\Psi\pars{5 \over 8} - \Psi\pars{3 \over 8} + \Psi\pars{7 \over 8}}
\\[5mm] = &\
{1 \over 8}\braces{%
\bracks{\Psi\pars{7 \over 8} - \Psi\pars{1 \over 8}} +
\bracks{\Psi\pars{5 \over 8} - \Psi\pars{3 \over 8}}}
\\[5mm] = &\
{1 \over 8}\ \underbrace{\bracks{\pi\cot\pars{\pi \over 8} + \pi\cot\pars{3\pi \over 8}}}_{\ds{2\pi\root{2}}}
\\[5mm] = &\
\bbx{{\root{2} \over 4}\,\pi} \approx 1.1107 \\ &
\end{align}
A: $$  \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 $$
A: From your answer,
$$ \tilde{s}=\int_{0}^{1}\frac{1}{1-ix^2}dx=\int_{0}^{1}\frac{1}{1+x^4}dx+i\int_{0}^{1}\frac{x^2}{1+x^4}dx $$
and then you can obtain
\begin{eqnarray}
s&=&\Re(\tilde{s})+\Im(\tilde{s})\\
&=&\int_{0}^{1}\frac{1 + x^{2}}{1 + x^{4}}\,d x\\
&=&\frac12\int_{0}^{\infty}\frac{1 + x^{2}}{1 + x^{4}}\,d x\\
&=&\frac12\int_{0}^{\infty}\frac{1 + \frac1{x^{2}}}{x^2 + \frac{1}{x^{2}}}\,d x\\
&=&\frac12\int_{0}^{\infty}\frac{1}{(x - \frac{1}{x})^2+2}\,d (x-\frac1x)\\
&=&\frac12\int_{-\infty}^\infty\frac{1}{x^2+2}dx\\
&=&\frac\pi{2\sqrt2}.
\end{eqnarray}
