\documentclass[10pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[frenchb]{babel}
\usepackage{fourier}
\usepackage{amsmath,amssymb}
\usepackage{pifont}

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

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

\usepackage{fancyhdr}
\usepackage[np]{numprint}
\usepackage{pstricks-add,pst-eucl}

\begin{document}\everymath{\displaystyle}
\setlength\parindent{0mm}

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

\begin{enumerate}

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

\psset{xunit=0.5cm,yunit=0.5cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-11.5,-4)(11.8,4)
\multips(0,-3)(0,1.0){7}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(-11.5,0)(11.5,0)}
\multips(-12,0)(1.0,0){30}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-3.7)(0,3.7)}
\psaxes[labelFontSize=\scriptstyle,trigLabels=true,trigLabelBase=2,dx=\psPiH,xunit=\psPi,yAxis=true,Dx=1.,Dy=1.,ticksize=-2pt 0,subticks=2]{->}(0,0)(-11.5,-3.7)(3.7,3.7)
\psline[linecolor=red](-3.14,-3.14)(3.14,3.14)
\psline[linecolor=red](3.14,3.14)(6.28,3.14)
\psline[linecolor=red,linestyle=dotted](6.28,3.14)(6.28,-3.14)
\psline[linecolor=red](6.28,-3.14)(9.42,-3.14)
\psline[linecolor=red](9.42,-3.14)(12.42,0)
\psline[linecolor=red](-3.14,-3.14)(-6.28,-3.14)
\psline[linecolor=red,linestyle=dotted](-6.28,-3.14)(-6.28,3.14)
\psline[linecolor=red](-6.28,3.14)(-9.28,+3.14)
\psline[linecolor=red](-9.28,+3.14)(-12.42,0)
\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$

or $f$ est impaire

\medskip

donc \fbox{$a_0=0$}
}

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

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

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

$V_{eff}^2=\dfrac{1}{\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{1}{\pi}\times \left(\int_{0}^{\frac{\pi}{2}} t^2 \text{d}t + \int_{\frac{\pi}{2}}^{\pi} \left(\frac{\pi}{2}\right)^2 \text{d}t\right)$\quad  car $f(t) = \left\{\begin{matrix} t &\text{ sur }[0;\frac{\pi}{2}]\cr \frac{\pi}{2}& \text{ sur }[\frac{\pi}{2};\pi]\end{matrix}\right.$

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

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

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

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

\fbox{$V_{eff}^2=\dfrac{\pi^2}{6}$}\bigskip ~

}

\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_{\pi}^{\pi} f(t) \cos nt \text{d}t$ car $f$ est une fonction $2\pi$-périodique

or $f$ est impaire et $\cos$ est paire donc le produit $f\times \cos $ est une fonction impaire.

donc \fbox{$a_n=0$}}

\bigskip

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

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

$b_n = \dfrac{1}{\pi}\times 2\times \int_{0}^{\pi} f(t) \sin nt \text{d}t$ car la fonction $f\times\cos$ est paire

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

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

\eject

Intégrons par parties

on pose $u(t) = t$\qquad et \quad $v'(t) = \sin(nt)$

On calcule $u(t) = t$\qquad et \quad $v(t) = \dfrac{-\cos(nt)}{n}$

On obtient :

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

$b_n = \dfrac{2}{\pi}\times \left(   \left(\dfrac{-\pi \cos n\frac{\pi}{2}}{2n} - 0\right)  -  \left[\dfrac{-\sin nt}{n^2}\right]_0^{\frac{\pi}{2}} + \frac{\pi}{2}\times \left[\dfrac{-\cos nt}{n}\right]_{\frac{\pi}{2}}^{\pi} \right)$

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

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

$b_n = \dfrac{2}{\pi}\times \left(   \dfrac{\sin n\frac{\pi}{2}}{n^2} - \frac{\pi}{2}\times \dfrac{(-1)^n}{n}   \right)$

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

\bigskip

Si $n$ est pair alors $n=2p$ et $a_n = a_{2p} =\dfrac{2\sin p\pi}{(2p)^2\pi} - \dfrac{(-1)^{2p}}{2p} = 0-\dfrac{1}{2p} = \dfrac{-1}{n}$


Si $n$ est impair alors $n=2p+1$ et 

\hfill $a_n = a_{2p+1} =\dfrac{2\sin p\pi +\frac{\pi}{2}}{(2p+1)^2\pi} - \dfrac{(-1)^{2p+1}}{2p+1} = \dfrac{2(-1)^p}{(2p+1)^2\pi} + \dfrac{1}{2p+1} = \dfrac{2(-1)^p}{(2p+1)^2\pi}+ \dfrac{1}{2p+1}$

} %fin du rouge

\vskip 0.5cm

\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{1.5cm}}|}
    \hline
    \taille $n$ & $0$ & $1$ & $2$ &$3$ &$4$ & $5$\cr
    \hline
    \taille $a_n$ & $0$ & $0$ & $0$ & $0$ & $0$ & $0$ \cr
    \hline
    \taille $b_n$ & $\emptyset$ & $\frac{2}{\pi}+1$&$\frac{-1}{2}$&$\frac{-2}{9\pi}+\frac{1}{3}$&$\frac{-1}{4}$&$\frac{2}{25\pi}+\frac15$\cr
    \hline
    \end{tabular}
}
\bigskip

donc \fcolorbox{blue}{white}{\red $S_5(t) =\left(\frac{2}{\pi}+1\right)\sin t-\frac12 \sin(2t)+\left(\frac{-2}{9\pi}+\frac13\right)\sin (3t)-\frac14 \sin(4t)+\left(\frac{2}{25\pi}+\frac15\right)\sin (5t)$}

\vskip 1cm

Le graphe est alors le suivant :

\psset{xunit=0.5cm,yunit=0.5cm,algebraic=true,dimen=middle,dotstyle=o,dotsize=5pt 0,linewidth=0.8pt,arrowsize=3pt 2,arrowinset=0.25}
\begin{pspicture*}(-11.5,-4)(11.8,4)
\multips(0,-3)(0,1.0){7}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(-11.5,0)(11.5,0)}
\multips(-12,0)(1.0,0){30}{\psline[linestyle=dashed,linecap=1,dash=1.5pt 1.5pt,linewidth=0.4pt,linecolor=lightgray]{c-c}(0,-3.7)(0,3.7)}
\psaxes[labels=x,labelFontSize=\scriptstyle,trigLabels=true,trigLabelBase=2,dx=\psPiH,xunit=\psPi,Dx=1,Dy=\psPi,ticksize=-2pt 0,subticks=2]{->}(0,0)(-11.5,-3.7)(3.7,3.7)
\psplot[linewidth=1.2pt,linecolor=red,plotpoints=200]
{-11.5}{11.5}
{(2.0/PI+1)*SIN(x) -  1.0/2*SIN(2*x)+  (-2.0/(9.0*PI)+1.0/3)*SIN(3*x)-  1./4*SIN(4*x) +  (2.0/(25.0*PI)+1/5)*SIN(5*x)}
\psline[linecolor=blue,linestyle=dashed,linewidth=0.75pt](-1.5,-1.5)(1.5,1.5)
\psline[linecolor=blue,linestyle=dashed,linewidth=0.75pt](1.5,1.5)(3,1.5)
\psline[linecolor=blue,linestyle=dashed,linewidth=0.75pt](-1.5,-1.5)(-3,-1.5)
{\tiny\pstGeonode[dotscale=0.5,PosAngle=45,PointSymbol=*,PointName={-\frac{\pi}{2},\frac{\pi}{2},\pi}](0.2,-\psPiH){pi1}(0.2,
   \psPiH){pi2}(0,\psPi){pi}}
\end{pspicture*}


\end{enumerate}


\end{document}
