\documentclass[10pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}
\AddThinSpaceBeforeFootnotes
\FrenchFootnotes
\usepackage{fourier}
\usepackage[scaled=0.875]{helvet}
\renewcommand{\ttdefault}{lmtt}
\usepackage{amsmath,amssymb,makeidx}
\usepackage{fancybox}

\usepackage[normalem]{ulem}
\usepackage{pifont}

\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}

\setlength{\voffset}{-1,5cm}
\setlength{\hoffset}{-2,5cm}
\setlength{\textheight}{23,5cm}
\setlength{\textwidth}{17cm}

\usepackage{fancyhdr}
\usepackage[np]{numprint}
\usepackage{pst-plot,pst-text,pst-circ,pstricks-add}
%\usepackage{graphicx}
%\usepackage{xcolor}

\begin{document}\everymath{\displaystyle}
\setlength\parindent{0mm}
\renewcommand \footrulewidth{.2pt}%

\pagestyle{fancy}
\thispagestyle{empty}


Soit $f$ la fonction définie sur $\R$ par $f(t) = 1$ sur $[0;\pi[$, \quad  $f(t) = 0$ sur $[\pi ; 2\pi[$; $f$ est $2\pi$-périodique

\begin{enumerate}

\item Dessiner $f$ sur au moins deux périodes

\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-3.64,-0.72)(9.26,2.64)
\multips(0,0)(0,1.0){4}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(-3.64,0)(9.26,0)}
\multips(-3,0)(1.0,0){13}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-0.72)(0,2.64)}
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt 0,subticks=2]{->}(0,0)(-3.64,-0.72)(9.26,2.64)
\psline[linecolor=red](0.,1)(3.14,1)
\psline[linecolor=red,linestyle=dotted](3.14,1)(3.14,0)
\psline[linecolor=red](3.14,0)(6.28,0)
\psline[linecolor=red,linestyle=dotted](6.28,1)(6.28,0)
\psline[linecolor=red](6.28,1)(9.42,1)
\psline[linecolor=red](0.,0.)(-3.14,0)
\psline[linecolor=red,linestyle=dotted](-3.14,1)(-3.14,0)
\psline[linecolor=red](-3.14,1)(-6.28,1)
\end{pspicture*}

\item Calculer $a_0$ et $V_{eff}^2$

\begin{minipage}{0.34\linewidth}

{\red
$a_0=\dfrac{1}{2\pi}\int_{-\pi}^{+\pi} f(t)dt$

$a_0=\dfrac{1}{2\pi}\times \left(\int_{0}^{\pi} f(t)dt + \int_{\pi}^{2\pi} f(t)dt\right)$

$a_0=\dfrac{1}{2\pi}\times \left(\int_{0}^{\pi} 1dt + \int_{\pi}^{2\pi} 0dt\right)$

$a_0=\dfrac{1}{2\pi}\times \left( \Big[t\Big]_{0}^{\pi}\quad + \quad 0 \right)$

\medskip

$a_0=\dfrac{1}{2\pi}\times \left( \pi\quad + \quad 0 \right)$

\fbox{$a_0=\dfrac{1}{2}$}
}

\end{minipage}\hfill
\begin{minipage}{0.66\linewidth}

{\red
$V_{eff}^2=\dfrac{1}{2\pi}\int_{0}^{2\pi} f^2(t)dt$\qquad car $f^2$ est $2\pi$-périodique

$V_{eff}^2=\dfrac{1}{2\pi}\times \left(\int_{0}^{\pi} f^2(t)dt + \int_{\pi}^{2\pi} f^2(t)dt\right)$\qquad  d'après la relation de Chasles

$V_{eff}^2=\dfrac{1}{2\pi}\times \left(\int_{0}^{\pi} 1^2 dt + \int_{\pi}^{2\pi} 0^2 dt\right)$\quad  car $f(t) = \left\{\begin{matrix} t &\text{ sur }[0;\pi]\cr 0& \text{ sur }[\pi;2\pi]\end{matrix}\right.$

$V_{eff}^2=\dfrac{1}{2\pi}\times \left(\int_{0}^{\pi} 1 dt\quad + \quad 0\right)$

$V_{eff}^2=\dfrac{1}{2\pi}\times \left[t\right]_{0}^{\pi}$

$V_{eff}^2=\dfrac{1}{2\pi}\times \pi$

\fbox{$V_{eff}^2=\dfrac12$}

}

\end{minipage}

\item Pour tout $n\in\N^*$, calculer pour tout $n\in\N^*$, $a_n$ et $b_n$

{\red Pour tout $n\in\N^*$, on a :

$a_n = \dfrac{2}{2\pi}\int_{0}^{2\pi} f(t) \cos nt dt$ car $f$ est une fonction $2\pi$-périodique

$a_n = \dfrac{1}{\pi}\times \left(\int_{0}^{\pi} f(t) \cos nt dt + \int_{\pi}^{2\pi} f(t) \cos nt dt\right)$ d'après le relation de Chasles

$a_n = \dfrac{1}{\pi}\times \left(\int_0^{\pi} 1 \cos nt dt + \int_{\pi}^{2\pi} 0 \cos nt dt\right)$ car $f(t) = \left\{\begin{matrix} t &\text{ sur }[0;\pi]\cr 0& \text{ sur }[\pi;2\pi]\end{matrix}\right.$

$a_n = \dfrac{1}{\pi}\times \left(\left[\dfrac{\sin nt}{n}\right]_0^{\pi}\quad + \quad 0\right)$

$a_n = \dfrac{1}{\pi}\times (0-0\quad + \quad 0)$ car $\sin(n\pi) = 0$

\fbox{$a_n=0$}}

\bigskip

{\red Pour tout $n\in\N^*$, on a :

$b_n = \dfrac{2}{2\pi}\int_{0}^{2\pi} f(t) \sin nt dt$ car $f$ est une fonction $2\pi$-périodique

$b_n = \dfrac{1}{\pi}\times \left(\int_{0}^{\pi} f(t) \sin nt dt + \int_{\pi}^{2\pi} f(t) \sin nt dt\right)$ d'après le relation de Chasles

$b_n = \dfrac{1}{\pi}\times \left(\int_0^{\pi} 1 \sin nt dt + \int_{\pi}^{2\pi} 0 \sin nt dt\right)$ car $f(t) = \left\{\begin{matrix} t &\text{ sur }[0;\pi]\cr 0& \text{ sur }[\pi;2\pi]\end{matrix}\right.$

$b_n = \dfrac{1}{\pi}\times \left(\left[\dfrac{-\cos nt}{n}\right]_0^{\pi}\quad + \quad 0\right)$

$b_n = \dfrac{1}{\pi}\times \left(\dfrac{-(-1)^n-(-1)}{n}\quad + \quad 0\right)$ car $\cos(n\pi) = (-1)^n$

\fbox{$b_n=\dfrac{1-(-1)^n}{n\pi}$}}

\item Expliciter $S_5(t) = a_0 + \sum\limits_{n=1}^{5} a_n\cos n\omega t + b_n\sin n\omega t$

\def\taille{\vrule height 15pt depth 10pt width 0pt }

{\red    \begin{tabular}{*{7}{|>{\centering}p{1cm}}|}
    \hline
    \taille $n$ & $0$ & $1$ & $2$ &$3$ &$4$ & $5$\cr
    \hline
    \taille $a_n$ & $\frac12$ & $0$ & $0$ & $0$ & $0$ & $0$ \cr
    \hline
    \taille $b_n$ & $\emptyset$ & $\frac{2}{\pi}$&0&$\frac{2}{3\pi}$&0&$\frac{2}{5\pi}$\cr
    \hline
    \end{tabular}
}
\bigskip

donc \fcolorbox{blue}{white}{\red $S_5(t) =\dfrac{1}{2}+\frac{2}{\pi}\sin t+\frac{2}{3\pi}\sin (3t)+\frac{2}{5\pi}\sin (5t)$}

\vskip 1cm

Le graphe est alors le suivant :

\psset{xunit=1.0cm,yunit=1.0cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-1.519689916053089,-0.7402953628565263)(10.806359958634163,1.793694332380206)
\multips(0,0)(0,1.0){3}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(-1.519689916053089,0)(10.806359958634163,0)}
\multips(-1,0)(1.0,0){13}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-0.7402953628565263)(0,1.793694332380206)}
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt 0,subticks=2]{->}(0,0)(-1.519689916053089,-0.7402953628565263)(10.806359958634163,1.793694332380206)
\psplot[linewidth=1.2pt,linecolor=red,plotpoints=200]{-1.519689916053089}{10.806359958634163}{1.0/2.0+2.0/PI*SIN(x)+2.0/(3.0*PI)*SIN(3.0*x)+2.0/(5.0*PI)*SIN(5.0*x)}
\begin{scriptsize}
\rput[bl](-3.7097810097934083,0.8343982334691573){\red{$f$}}
\end{scriptsize}
\end{pspicture*}

\end{enumerate}


\end{document}
