\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) = t$ sur $[0;\frac{\pi}{2}[$, \quad  $f(t) = \frac{\pi}{2}$ sur $[\frac{\pi}{2} ; \pi]$; $f$ est paire; $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.,0.)(1.57,1.57)
\psline[linecolor=red](1.57,1.57)(3.14,1.57)
\psline[linecolor=red](-1.57,1.57)(-3.14,1.57)
\psline[linecolor=red](0.,0.)(-1.57,1.57)
\psline[linecolor=red](3.14,1.57)(4.71,1.57)
\psline[linecolor=red](4.71,1.57)(6.28,0.)
\psline[linecolor=red](6.28,0.)(7.85,1.57)
\psline[linecolor=red](7.85,1.57)(9.42,1.57)
\begin{scriptsize}
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](0.,0.)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](1.57,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](3.14,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](-1.57,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](-3.14,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](0.,0.)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](-1.57,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](4.71,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](6.28,0.)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](7.85,1.57)
\psdots[dotstyle=*,dotsize=1pt,linecolor=red](9.42,1.57)
\end{scriptsize}
\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 2 \times \int_{0}^{+\pi} f(t)dt$

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

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

\medskip

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

\medskip

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

\medskip

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

$a_0=\dfrac{1}{\pi}\times \left( \dfrac{\pi^2}{8} + \frac{\pi}{2}\times \frac{\pi}{2} \right)$

$a_0=\dfrac{1}{\pi}\times \dfrac{3\pi^2}{8}$

\fbox{$a_0=\dfrac{3\pi}{8}$}
}

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

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

$V_{eff}^2=\dfrac{2}{2\pi}\times 2 \times \int_{0}^{+\pi} f^2(t)dt$\qquad  car $f^2$ est paire

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

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

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

$V_{eff}^2=\dfrac{2}{\pi}\times \left( \left[\dfrac{t^3}{3}\right]_{0}^{\frac{\pi^2}{4}}\quad + \quad\frac{\pi^2}{4} [t]_{\frac{\pi}{2}}^{\pi} \right)$

$V_{eff}^2=\dfrac{2}{\pi}\times \left( \left(\dfrac{\pi^3}{24}\right)-0\quad + \quad\frac{\pi^2}{4} \left(\pi - \frac{\pi}{2}\right) \right)$

$V_{eff}^2=\dfrac{2}{\pi}\times \left( \dfrac{\pi^3}{24} + \frac{\pi^3}{8} \right)$

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

\fbox{$V_{eff}^2=\dfrac{\pi^2}{3}$}

}

\end{minipage}

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

{\red Puisque la fonction est paire, les coefficients $b_n$ sont nuls

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

$a_n = \dfrac{2}{2\pi}\times 2 \times \int_0^{\pi} f(t) \cos nt dt$ car $f$ est une fonction paire

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

$a_n = \dfrac{2}{2\pi}\times 2 \times \left(\int_0^{\frac{\pi}{2}} t \cos nt dt + \int_{\frac{\pi}{2}}^{\pi} \frac{\pi}{2} \cos nt dt\right)$ car $f(t) $ sur $[0;\frac{\pi}{2}]$ et $f(t) = \dfrac{\pi}{2}$ sur $[\frac{\pi}{2};\pi]$

\bigskip

Intégrons $\int_0^{\frac{\pi}{2}} t \cos nt dt$ par parties

On pose $u(t) = t$ \quad et \quad $v'(t) = \cos nt$

On calcule $u'(t) = 1$ \quad et \quad $v(t) = \dfrac{\sin nt}{n}$

On obtient : $\int_0^{\frac{\pi}{2}} t \cos nt dt = \left[t\times \dfrac{\sin nt}{n}\right]_0^{\frac{\pi}{2}}\quad  - \quad \int_0^{\frac{\pi}{2}}1\times \dfrac{\sin nt}{n} dt $

donc $\int_0^{\frac{\pi}{2}} t \cos nt dt = \left(\frac{\pi}{2}\times \dfrac{\sin n\frac{\pi}{2}}{n}\quad - \quad 0\right)\quad  - \quad \frac{1}{n}\int_0^{\frac{\pi}{2}}\sin nt dt $

puis $\int_0^{\frac{\pi}{2}} t \cos nt dt = \frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n}\left[\dfrac{-\cos nt}{n}\right]_0^{\frac{\pi}{2}} $

puis $\int_0^{\frac{\pi}{2}} t \cos nt dt = \frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n}\left(\dfrac{-\cos n\frac{\pi}{2}+1}{n}\right) $

donc $\int_0^{\frac{\pi}{2}} t \cos nt dt = \frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n^2}\left(1-\cos n\frac{\pi}{2}\right) $

\bigskip

Le calcul du coefficient devient alors

$a_n = \dfrac{2}{\pi}\times\left(\frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n^2}\left(1-\cos n\frac{\pi}{2}\right)\qquad  + \qquad \dfrac{\pi}{2}\int_{\frac{\pi}{2}}^{\pi}  \cos nt dt\right)$

C'est à dire $a_n = \dfrac{2}{\pi}\times\left(\frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n^2}\left(1-\cos n\frac{\pi}{2}\right)\qquad  + \qquad \dfrac{\pi}{2}\left[\dfrac{\sin nt}{n} dt\right]_{\frac{\pi}{2}}^{\pi}\right)$

$a_n = \dfrac{2}{\pi}\times\left(\frac{\pi}{2n}\times \sin n\frac{\pi}{2}\quad-\quad\frac{1}{n^2}\left(1-\cos n\frac{\pi}{2}\right)\qquad  + \qquad \dfrac{\pi}{2n}\left(0-\sin n\dfrac{\pi}{2}\right)\right)$

Et en simplifiant :

$a_n = \dfrac{2}{\pi}\times\left(\underline{ \frac{\pi}{2n}\times \sin n\frac{\pi}{2}}\quad-\quad\frac{1}{n^2}\left(1-\cos n\frac{\pi}{2}\right)\qquad  - \qquad \underline{ \dfrac{\pi}{2n}\sin n\dfrac{\pi}{2}}\right)$

\bigskip

On obtient finalement $a_n =\dfrac{2}{\pi}\times\left(\frac{1}{n^2}\left(\cos n\frac{\pi}{2}-1\right)\right)$

\fbox{$a_n =\frac{2}{\pi n^2}\left(\cos n\frac{\pi}{2}-1\right)$}

}

\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$ & $\dfrac{3\pi}{8}$ & $-\frac{2}{\pi}$ & $-\frac{1}{\pi}$ &$-\frac{2}{9\pi}$ &$0$ & $-\frac{2}{25\pi}$\cr
    \hline
    \taille $b_n$ & $\emptyset$ & 0&0&0&0&0\cr
    \hline
    \end{tabular}

\bigskip

donc \fcolorbox{blue}{white}{$S_5(t) =\dfrac{3\pi}{8}-\frac{2}{\pi}\cos t-\frac{1}{\pi}\cos (2t)-\frac{2}{9\pi}\cos (3t)-\frac{2}{25\pi}\cos(5t)$}

}

\vskip 1cm

{\red Le graphe des deux fonction $f$ et $S_5$ donne : }

\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.42,-0.78)(12.7,2.62)
\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.42,0)(15.58,0)}
\multips(-3,0)(1.0,0){20}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-0.78)(0,2.62)}
\psaxes[labelFontSize=\scriptstyle,xAxis=true,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt 0,subticks=2]{->}(0,0)(-3.42,-0.78)(12.7,2.62)
\psplot[linewidth=1.2pt,linecolor=red,plotpoints=200]{-3.42}{13}{3.0*PI/8.0-2.0/PI*COS(x)-1.0/PI*COS(2.0*x)-2.0/(9.0*PI)*COS(3.0*x)-2.0/(25.0*PI)*COS(5.0*x)}
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](0.,0.)(1.57,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](1.57,1.57)(3.14,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](-1.57,1.57)(-3.14,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](0.,0.)(-1.57,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](3.14,1.57)(4.71,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](4.71,1.57)(6.28,0.)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](6.28,0.)(7.85,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](7.85,1.57)(9.42,1.57)
\psline[linecolor=blue,linewidth=1pt,linestyle=dashed](1.5,0.5)(2.5,0.5)
\psline[linecolor=red,linewidth=1pt](1.5,0.8)(2.5,0.8)
\begin{scriptsize}
\rput[bl](2.7,0.4){\blue{$f$}}
\rput[bl](2.7,0.7){\red{$S_5$}}
\end{scriptsize}
\end{pspicture*}

\end{enumerate}


\end{document}
