Find the Exact sum Give the fourier series representation of $f(x) = x$ on $[-\pi, \pi]$.
Use the result to give the exact sum of...
$$\sum_{n=1}^\infty \frac{(-1)^{n+1}}{2n-1}$$
$$\text{ where } x \in [-\pi,\pi]$$
 A: 
I have the fourier series representation of: f(x) = 2[sin(x) - sin(2x) /2 + sin(3x) /3 ...] I'm having a hard time of giving the exact sum 

EDIT. Since your computation agrees with $(2)$, you can skip the first part of this answer. 


*

*By definition of the trigonometric Fourier series we have for $f(x)=x,$ with 
$x\in \left] -\pi ,\pi \right[ $
\begin{eqnarray*}
x &=&\frac{a_{0}}{2}+\sum_{n=1}^{\infty }\left( a_{n}\cos nx+b_{n}\sin
nx\right) \tag{1} \\
a_{n} &=&\frac{1}{\pi }\int_{-\pi }^{\pi }x\cos nx\,dx=0 \\
b_{n} &=&\frac{1}{\pi }\int_{-\pi }^{\pi }x\sin nx\,dx.
\end{eqnarray*}
The coefficients $a_{n}=0$, because $x\cos nx$ is an odd function. As for $b_{n}$ it's integrable by parts and this is a case where the LIATE rule for
choosing the factors of the integrand can help. 
\begin{equation*}
\int u(x)v^{\prime }(x)\,dx=u(x)v(x)-\int u^{\prime }(x)v(x)\,dx
\end{equation*}
According to it since $x$ is an algebraic function and $\sin nx$ a
trigonometric function, we choose $u(x)=x$, $v^{\prime }(x)=\sin nx$.
\begin{equation*}
b_{n}=\frac{1}{\pi }\int_{-\pi }^{\pi }\underset{u(x)}{\underbrace{x}}
\underset{v^{\prime }(x)}{\underbrace{\sin nx}}\,dx
\end{equation*}
Then $u^{\prime }(x)=1$ and $v(x)=\int \sin nx\,dx=-\frac{1}{n}\cos nx$.
Hence 
\begin{eqnarray*}
b_{n} &=&\left. \frac{1}{\pi }x\left( -\frac{1}{n}\cos nx\right) \right\vert
_{-\pi }^{\pi }-\frac{1}{\pi }\int_{-\pi }^{\pi }\left( -\frac{1}{n}\cos
nx\right) \,dx \\
&=&-\frac{1}{n\pi }\left( \pi \cos n\pi -\left( -\pi \right) \cos \left(
-n\pi \right) \right) +\left. \frac{1}{\pi }\frac{1}{n}\left( \frac{1}{n}
\sin nx\right) \right\vert _{-\pi }^{\pi } \\
&=&-\frac{2}{n}\cos n\pi +\frac{1}{\pi }\frac{1}{n^{2}}\left( \sin n\pi
-\sin \left( -n\pi \right) \right)  \\
&=&-\frac{2}{n}\cos n\pi +\frac{2}{\pi n^{2}}\sin n\pi  \\
&=&-\frac{2}{n}\cos n\pi .
\end{eqnarray*}
From these results the Fourier series $(1)$ is then
\begin{equation*}
x=-\sum_{n=1}^{\infty }\frac{2}{n}\cos n\pi \sin nx,\qquad -\pi \lt x\lt
\pi .\tag{2}
\end{equation*}

*Plots of $f(x)=x$  (blue) and of the partial sum $\sum_{n=1}^{10 }\frac{-2}{n}\cos n\pi \sin nx$  (red) for  $-\pi \lt x\lt\pi .$ The Fourier series converges to a periodic function $g(x)$, whose restriction to $]-\pi,\pi[$ coincides with $f(x)=x$. The period of  $g(x)$ is $2\pi$ and it has jumps at $x=\pi+2m\pi$, where $m\in\mathbb{Z}$. At these jumps the Fourier series converges to $\frac{g(x^{-})+g(x^+)}{2}=0$. At the point $x=\frac{\pi }{2}$ used below we thus have  $g(\pi/2)=f(\pi/2)=\pi/2$.


*Setting $x=\frac{\pi }{2}$ and splitting the series into even ($n=2k$) and
odd ($n=2k-1)$ terms, we are left with the odd terms only, because $\cos
2k\pi \sin 2k\pi =0$, $k=1,2,\ldots $. As such,
\begin{eqnarray*}
\frac{\pi }{2} &=&-2\sum_{k=1}^{\infty }\frac{1}{2k-1}\cos \left( (2k-1)\pi
\right) \sin \frac{\left( 2k-1\right) \pi }{2}\tag{3} \\
&& \\
&&\left( \cos \left( (2k-1)\pi \right) =\cos \left( 2k\pi -\pi \right) =\cos
(-\pi )=-1\right)  \\
&&\left( \sin \frac{\left( 2k-1\right) \pi }{2}=\sin \left( k\pi -\frac{\pi 
}{2}\right) =-\cos k\pi =(-1)^{k+1}\right)  \\
&& \\
\frac{\pi }{2} &=&-2\sum_{k=1}^{\infty }\frac{(-1)(-1)^{k+1}}{2k-1}
\Leftrightarrow \sum_{k=1}^{\infty }\frac{(-1)^{k+1}}{2k-1}=\frac{\pi }{4}.\tag{4}
\end{eqnarray*}


You can find another example on how to compute the sum of a series by means of an expansion of a function into a Fourier series in this answer.
A: Since $\;f\;$ is odd  we shall only need the sine coefficients:
$$b_n=\frac1\pi\int\limits_{-\pi}^\pi t\sin nt\;dt$$
By parts:
$$u=t\;\;,\;\;u'=1\\v'=\sin nt\;,\;\;v=-\frac1n\cos nt$$
so
$$b_n=\left.\frac1\pi\left(-\frac tn\cos nt\right|_{-\pi}^\pi+\frac1n\int\limits_{-\pi}^\pi \cos nt\;dt\right)=$$
$$=\frac1\pi\left(-\frac\pi n\cos n\pi-\frac\pi n\cos n\pi\right)+\left.\frac1{\pi n^2}\sin nt\right|_{-\pi}^\pi=-\frac2n\cos n\pi=(-1)^{n+1}\frac{2}n$$
and from here
$$f(x)=\sum_{n=1}^\infty(-1)^{n+1}\frac 2n\sin nx$$
Take now $\;x=\frac\pi2\;$:
$$\frac\pi2=\sum_{n=1}^\infty(-1)^{n+1}\frac2n\sin\frac{n\pi}2=\sum_{n=1}^\infty(-1)^{n+1}\frac2{2n-1}$$
since
$$(-1)^{n+1}\frac2n\sin\frac{n\pi}2=\begin{cases}(-1)^{n+1}\frac2n&,\;\;n=1\pmod 4\\{}\\(-1)^n\frac2n&,\;\;n=3\pmod 4\\{}\\0&,\;\;n=0,2\pmod 4\end{cases}$$
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle #1 \right\rangle}
 \newcommand{\braces}[1]{\left\lbrace #1 \right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack #1 \right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\equalby}[1]{{#1 \atop {= \atop \vphantom{\huge A}}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left( #1 \right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
It is useful to have a "$\tt\mbox{non-Fourier}$" answer:

\begin{align}
\sum_{n = 1}^{\infty}{\pars{-1}^{n+1} \over 2n - 1}&=
\sum_{n = 0}^{\infty}
\bracks{{1 \over 2\pars{2n + 1} - 1} - {1 \over 2\pars{2n + 2} - 1}}
=2\sum_{n = 0}^{\infty}{1 \over \pars{4n + 1}\pars{4n + 3}}
\\[3mm]&=
{1 \over 8}\sum_{n = 0}^{\infty}{1 \over \pars{n + 3/4}\pars{n + 1/4}}
=
{1 \over 8}\,{\Psi\pars{3/4} - \Psi\pars{1/4} \over 3/4 - 1/4}
\\[3mm]&={1 \over 4}\,\bracks{\Psi\pars{3 \over 4} - \Psi\pars{1 \over 4}}\tag{1}
\end{align}
  where $\Psi\pars{z}$ is the Digamma Function.
  $$
\mbox{Also,}\quad\Psi\pars{1 \over 4} = -\gamma - {\pi \over 2} - 3\ln\pars{2}\,,
\quad\Psi\pars{3 \over 4} = -\gamma + {\pi \over 2} - 3\ln\pars{2}
$$
  $$
\mbox{such that}\quad\Psi\pars{3 \over 4} - \Psi\pars{1 \over 4} = \pi
$$
  $\gamma$ is the Euler-Mascheroni Constant. By replacing the above result in $\pars{1}$, we found

$$
\color{#00f}{\large\sum_{n =1}^{\infty}{\pars{-1}^{n + 1} \over 2n - 1}
= {\pi \over 4}}
$$
A: For this particular problem, since you are given the fourier series for $f(x)$, you are meant to try various values of $x$ within the specified interval.  When substituting this value into the fourier series expansion, you should end up seeing something that looks like the sum you are trying to evaluate.  In general, for these types of questions the popular choices for $x$ to try first are $0, \pi/2, \pi$.  
Once you evaluate the fourier series for a value of $x$ and you find something that looks like the sum you're looking for, then you can use that value of $x$ in $f(x) = x$ to get the answer.  
TL;DR, find an $x$ that looks like the sum when plugged into the given fourier series expansion.  Then you know the value of the sum is equal to that $x$.
