
%\documentclass{book} %DÉSACTIVER POUR A5
\documentclass[a5paper]{book} %ACTIVER POUR A5

%########
% Packages #
%########

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}

%######Affichage des maths
\DecimalMathComma %pour ne plus avoir d'espace après la virgule dans l'écriture décimale des nombres

\usepackage{amsmath}
\usepackage{amssymb,amsthm}
\usepackage{mathrsfs}
\usepackage{amsopn}

\usepackage[np]{numprint}%écriture des nombres avec des espaces et en écriture scientifique

\usepackage{dsfont} %Pour faire le 1 double barre de la fonction caractéristque dans un enironnement maths. \mathds{1}
%\usepackage{bbold} %Double barre mais en petit pour tout les nombres dans un environnement maths.\mathbb{1}

%######Graphique
\usepackage[dvipsnames]{xcolor}
\usepackage{graphicx}
\usepackage{pgf}
\usepackage{tikz}
\usepackage{tkz-tab}
\usetikzlibrary{shapes,arrows}

\usepackage{geometry} 
\geometry{hmargin={0.75cm,1cm},vmargin={0.5cm,1.25cm},twoside}

%######Tableau
\usepackage{array} %pour centrer dans un tableau
\usepackage{colortbl} %pour colorier les cellules lignes colonnes d'un tableau: \rowcolor{}, \columncolor{}, \cellcolor{purple!25}
\usepackage{tabularx} %quelques amélioraions de l'environnement tabular
\usepackage{diagbox} %Pour faire une diagonale dans une case d'un tableau: \diagbox{bas gauche}{haut droit}
\usepackage{multirow} %fusionner des cellules horizontalement

%######Hyperliens dans les pdf

\usepackage[colorlinks=true,linkcolor=violet,urlcolor=violet]{hyperref}% Pour créer des liens à l'intérieur du pdf: \hyperlink{label}{texte du lien} permettra d'atteindre la cible identifiée par \hypertarget{label}{texte de la cible}. Les textes du lien et de la cible peuvent être vides.

%######Des symboles et images

\usepackage{marvosym} %Image de téléphone protable avec la commande \Mobilefone

\usepackage{fdsymbol} %Notamment le cœur plein: \varheartsuit

\usepackage{eurosym}%pour afficher le symbole euro

\usepackage{utfsym}%symbole stylo
%######Vrac

\usepackage{enumerate}%énumération avec des lettres
\usepackage{tasks}%Pour avoir une liste en ligne utiliser \begin{tasks}(2) (pour deux colonnes) et non pas enumerate puis \task et non pas \item 
	\settasks{
		% the next two should be set to the same value so labels are aligned to the
		% left
		%label-width = 1em ,
		%item-indent = 1em ,
		%before-skip = 0pt%-\parskip , % undo paragraph skip
		%after-skip =0pt% -\parskip , % undo paragraph skip
		after-item-skip = -1pt%-\parskip % undo paragraph skip
	}
	
	\usepackage{stmaryrd}%pour faire des "intervalles" d'entiers \llbracket et \rrbracket
	
	\usepackage{xlop}%poser les calculs en colonne: \opdiv[displayintermediary=nonzero,voperation=top,shiftdecimalsep=none]{27}{45}
	\opset{decimalsepsymbol={,}}
	
	\usepackage{verbatim}%pour utiliser commande \exclure et normalement pour faire l'affichage tel quel sans compiler le texte. 
	%\usepackage{alltt}%Pour utiliser une commande latex dans un environnement verbatim il faut utiliser: alltt
	%Pour écrire juste suelques mots en verbatim au milieu d'un phrase: \verb|quelques mots|
	
	\usepackage{fancyhdr}
	
	%######Algo
	
	\usepackage{listings} % \begin{lstlisting} \end{lstlisting} affiche du code comme le fait le langage choisi. \lstset{language=Pascal} \lstset{language=Python} pour choisir le langage dans le document avant chaque programme ou avant le \begin{document} pour l'appliquer à tout le document. 
		%\lstset{} permet d'indiquer toutes les options. Pas de caractère accentué (option lourdingue à rajouter) qui vont s'ppliquer pour toute la suite du document: \lstset{language=Python}
		%Il espossible d'inclure un code python d'un fichier extérieur \lstinputlisting{source_filename.py}.
		%Il est possible de définir une présentation personnalisé par un ensemble de configuration enregistré dans un fichier de style
		\lstdefinestyle{pythonstyle}{
			language=Python,
			backgroundcolor=\color{gray!30},   
			commentstyle=\color{Plum},
			keywordstyle=\color{blue},
			numberstyle=\tiny\color{black},
			stringstyle=\color{ForestGreen},
			basicstyle=\ttfamily\color{black},
			breakatwhitespace=false,         
			breaklines=true,                 
			captionpos=b,                    
			keepspaces=true,                 
			numbers=none,                   
			numbersep=5pt,                  
			showspaces=false,                
			showstringspaces=false,
			showtabs=false,                  
			tabsize=1
		}
		\lstset{style=pythonstyle}
		
		\lstdefinestyle{bashstyle}{
			language=bash,
			backgroundcolor=\color{black},   
			commentstyle=\color{white},
			keywordstyle=\color{magenta},
			numberstyle=\tiny\color{black},
			stringstyle=\color{white},
			basicstyle=\ttfamily\footnotesize\color{white},
			breakatwhitespace=false,         
			breaklines=true,                 
			captionpos=b,                    
			keepspaces=true,                
			numbers=left,                    
			numbersep=5pt,                  
			showspaces=false,                
			showstringspaces=false,
			showtabs=false,                  
			tabsize=1
		}
		%\lstset{style=bashstyle}
		
		\usepackage[french]{algorithm2e}%pseudocode
		
		\usepackage{scratch3}
		
		%############### Formule developpée molécule chimie
		
		\usepackage{chemfig}
		
		%#####################
		% Commande et environnement #
		%#####################
		
		\theoremstyle{plain}
		
		%Pour redéfinir les commande section (changer la couleur centrer):
		\usepackage{titlesec}
		\titleformat{\section}[block]{\color{blue}\Large\bfseries\filcenter}{ Partie \thesection.}{1em}{}
		\titleformat{\subsection}[hang]{\color{purple}\large\bfseries}{\thesubsection}{1em}{}
		\titleformat{\subsubsection}[hang]{\color{RoyalBlue} \bfseries}{\thesubsubsection}{1em}{}
		\titleformat{\paragraph}[hang]{}{}{1em}{}
		
		\renewcommand{\thesection}{\arabic{section}}
		\renewcommand{\thesubsection}{\color{purple}\Roman{subsection}}
		\renewcommand{\thesubsubsection}{\color{RoyalBlue}\arabic{subsubsection}}
		
		\newenvironment{correction}{\color{Brown} \footnotesize}{}
		
		\newenvironment{sujet}{}{}
		
		%environnement bareme
		\newenvironment{bareme}{\color{RoyalBlue}\footnotesize \hfill }{\footnotesize \emph{~points}}
		
		%environnement détais du barème
		\newenvironment{details}{\color{RoyalBlue}\noindent ~\\}{~\\}
		
		%environnement notabene
		\newenvironment{notabene}{\color{PineGreen}\noindent ~\\}{~\\}
		
		%environnement exemples
		\newenvironment{exemples}{\color{blue} \noindent Exemples.\vspace{-0.1cm}}{}
		
		%environnement remarques
		\newenvironment{remarques}{\noindent {\color{BlueViolet}Remarques.\vspace{-0.1cm}}\color{BlueViolet}}{}
		
		\newenvironment{lecon}{\color{CadetBlue}}{}
		
		
		%Pour redéfinir les environnements exercices et autres avec de la couleur
		\newsavebox{\selvestebox}
		\newenvironment{colbox}[1]
		{\newcommand\colboxcolor{#1}%
			\begin{lrbox}{\selvestebox}%
				\begin{minipage}{\dimexpr\columnwidth-2\fboxsep\relax}}
				{\end{minipage}\end{lrbox}%
			\begin{center}
				\colorbox{\colboxcolor}{\usebox{\selvestebox}}
		\end{center}}
		
		%environnement exercice
		\newcounter{Exercice}
		\setcounter{Exercice}{1}
		\newcounter{Exercicecorrection}
		%\newenvironment{exercice}{\setcounter{Exercicecorrection}{\theExercice} {\noindent\color{Black}EXERCICE \theExercice.} \addtocounter{Exercice}{1} \color{Black}}%Pour numéroter comme exercices
		\newenvironment{exercice}{{\noindent\color{Black}EXERCICE \theExercice.} \addtocounter{Exercice}{1} \color{Black}}%Pour numéroter indépendamment exercicecorrection
		
		%environnement exercicecorrection
		%\newenvironment{exercicecorrection}{\noindent\color{Brown}Exercice \theExercicecorrection. \footnotesize}%Pour numéroter comme exercices
		
		\setcounter{Exercicecorrection}{1}\newenvironment{exercicecorrection}{{\noindent\color{Brown}Exercice \theExercicecorrection.}  \addtocounter{Exercicecorrection}{1} \footnotesize \color{Brown}}%pour numeroter indépendamment exercicesxorection
		
		%environnement definition
		\newcounter{Definition}
		\setcounter{Definition}{1}
		\newenvironment{definition}{\textbf{\color{Orange}Définition \theDefinition.} \addtocounter{Definition}{1} \color{Orange} }{}
		
		\newcounter{Theoreme}
		\setcounter{Theoreme}{1}
		\newenvironment{theoreme}{\textbf{\color{purple}Théorème \theTheoreme.} \addtocounter{Theoreme}{1}\color{purple}}{}
		
		%environnement proposition
		\newcounter{Proposition}
		\setcounter{Proposition}{1}
		\newenvironment{proposition}{\textbf{\color{purple}Proposition \theProposition.} \addtocounter{Proposition}{1}\color{purple}}{}
		
		%environnement démonstration
		\newcounter{Demonstration}
		\setcounter{Demonstration}{1}
		\newenvironment{preuve}{\noindent{\textbf{\color{PineGreen} Démonstration}.} \addtocounter{Demonstration}{1} \color{PineGreen}}
		
		%environnement conclusion encadré et coloré
		\newenvironment{conclusion}
		{\color{PineGreen}\begin{tabular}{|c|}\hline \\ \begin{minipage}{0.85\linewidth} \begin{center} }
					{\end{center} \end{minipage} \\ \\ \hline \end{tabular} }
		
		%Commande pour l'objectif et l'écrire en vert
		\newcommand{\objectif}[1]{{\color{PineGreen}#1}}
		
		%########################
		%Test conditionnel pour l'affichage    #
		%########################
		\newif\ifs
		%\strue%affiche la boite à trous
		\sfalse%affiche la réponse
		
		%Pour faire une case à trou complétable sur le pdf
		\newcounter{Trous}
		\setcounter{Trous}{1}
		\newcommand{\trous}[2][3cm]{
			\ifs
			\begin{Form}
				\TextField[name=\theTrous ,bordercolor=,borderwidth=0, backgroundcolor=gray!20, align=1,  width=#1 ,height=0.2cm, bordersep=0,color=black] {}
			\end{Form}
			\xspace
			\else
			#2
			\fi
			\addtocounter{Trous}{1}
		}
		
		%Un bug apparu en faisant la mise à jour de pi: les listes tasks ne se colorie plus et restent noir malgrer les commande. La solution est ce truc:
		\ExplSyntaxOn\makeatletter
		%patch needed to get a around a problem in the l3-drivers
		\AtBeginDocument{
			\cs_set_protected_nopar:Npn \color_ensure_current:
			{\set@color}
		}
		\ExplSyntaxOff\makeatother 
		
		%#########################
		%en tête puis pied de page
		%#########################
		
		\pagestyle{empty}
		\pagestyle{fancy} 
		\renewcommand{\headrulewidth}{0pt}%Pas de ligne horizontale en haut
		\lhead[]{}%entre crochets pages paires entre accolades pages impaires
		\chead[\small ]{}% l left, c center, r right
		\rhead[]{}
		\lfoot[]{}
		\cfoot[\footnotesize \thepage ]{\footnotesize \thepage }
		\rfoot[]{}
		
		%############################
		%les environnements qu'on affiche ou pas  #
		%############################
		
		\newcommand{\exclure}[1]{\renewenvironment{#1}{\begingroup\comment}{\endcomment\endgroup\ignorespaces}}
		
		%Pour abrege
		%\exclure{preuve} \exclure{exemples} \exclure{remarques} \exclure{exercicecorrection} \exclure{notabene} \exclure{details} \exclure{bareme} \exclure{sujet} \exclure{correction}\exclure{culturegenerale}
		
		%Pour cours intégrale
		\exclure{details} \exclure{bareme} \exclure{sujet} \exclure{notabene}%\exclure{exercicecorrection}
		
		%Pour les exercices uniquement.
		%\exclure{exemples} \exclure{remarques} \exclure{proposition} \exclure{theoreme} \exclure{preuve} \exclure{definition} \exclure{lecon} \exclure{notabene} \exclure{details} \exclure{sujet} \exclure{correction} %\exclure{exercicecorrection}
		
		%Pour les correction d'exercices uniquement.
		%\exclure{exemples} \exclure{remarques}  \exclure{proposition} \exclure{theoreme} \exclure{preuve} \exclure{definition} \exclure{lecon} \exclure{notabene} \exclure{details} \exclure{sujet} \exclure{correction}
		
		%Pour devoir surveillé sujet
		%\exclure{preuve} \exclure{exemples} \exclure{remarques} \exclure{proposition} \exclure{theoreme} \exclure{definition} \exclure{lecon} \exclure{exercicecorrection} \exclure{notabene} \exclure{details} \exclure{correction}
		
		%Pour devoir surveillé correction
		%\exclure{preuve} \exclure{exemples} \exclure{remarques} \exclure{proposition} \exclure{theoreme} \exclure{definition} \exclure{lecon} \exclure{exercicecorrection} \exclure{notabene} \exclure{sujet}
		
		%Pour devoir surveillé intégrale
		%\exclure{preuve} \exclure{exemples} \exclure{remarques} \exclure{proposition} \exclure{theoreme} \exclure{definition} \exclure{lecon} \exclure{exercicecorrection} \exclure{notabene}
		
		%###############################
		%#Double numérotation des pages#
		%###############################
		%\pagenumbering{roman} %À mettre juste avant \begin{document}. DOnc simplement décommenter.
			%\pagenumbering{arabic} %À copier décommenté 
			
			\begin{document}
\small

\subsection*{Factoriser une expression polynomiale.}

\subsubsection{La boîte à outils.}

\begin{lecon}	
	\emph{\color{purple}Factoriser} c'est écrire une expression algébrique sous forme d'un produit. Toute expression polynomiale est factorisable puisque: $P(X)=1\times P(X)$ (factorisation triviale). En général, l'objectif est de factoriser plus qu'une constante. La factorisation est utile dans les situations suivantes: simplifier un quotient, résoudre des équations et pour résoudre des inéquations.
	
	La factorisation n'est pas évidente (mécanique) mais souvent astucieuse contrairement au développement. Il s'agit de reconnaître dans l'expression algébrique les formules classiques de la proposition suivante.
\end{lecon}

\begin{proposition}
	Quels que soient les nombres $a$, $b$ et $c$ réels.
	\begin{enumerate}[(i)]
		\setlength{\parskip}{0pt}
		\setlength{\itemsep}{0pt}
		\item $ab+ac=a(b+c)$ facteur commun.
		\item $a^2+2ab+b^2=(a+b)^2$ identité remarquable.
		\item $a^2-2ab+b^2=(a-b)^2$ identité remarquable.
		\item $a^2-b^2=(a-b)(a+b)$ identité remarquable.
	\end{enumerate}	
\end{proposition}

\begin{preuve}	
	Les trois dernières égalités se déduisent de la première qui est en fait la distributivité de la multiplication sur l'addition.	
\end{preuve}

\begin{exercice}
	Recopiez et complétez
	\begin{tasks}(3)
		\task $(2x+\dots)^2=4x^2+\dots+9$
		\task $(x-\dots)^2=x^2-6x+\dots$
		\task $(\dots +3)^2=\dots +24t+9$
		\task $(x-\dots)^2=x^2-x+\dots$
		\task $(x\dots )^2=x^2+\dots +16$
		\task $(x\dots)^2=x^2-8x+\dots$
		\task $(\dots +3)^2=\dots +t+9$
		\task $(\dots -4)^2=\dots -4x+\dots$
	\end{tasks}
\end{exercice}

\begin{lecon}	
	Il n'y a pas d'algorithme pour factoriser une expression mais vous pourrez essayer (sans garantie de réussite) dans l'ordre:	
	\begin{enumerate}[\color{orange}1.]
		\setlength{\parskip}{0pt}
		\setlength{\itemsep}{0pt}		
		\item de chercher un {\color{orange}facteur commun}:		
		\begin{enumerate}[*]
			\setlength{\parskip}{0pt}
			\setlength{\itemsep}{0pt}
			\item Identifier les termes de la somme (ou différence).
			\item Écrire chacun des termes sous forme d'un produit.
			\item Identifier un facteur commun à tous les termes.
		\end{enumerate}		
		\item  d'utiliser une {\color{orange}identité remarquable} (s'il y a une expression avec du carré),		
		\item de {\color{orange}factoriser une partie} de l'expression pour faire apparaître un facteur commun ou une identité remarquable,		
		\item et enfin de {\color{orange}développer} en espérant pouvoir ensuite factoriser.		
	\end{enumerate}	
\end{lecon}

\begin{exemples}	
	\begin{enumerate}
		\setlength{\parskip}{0pt}
		\setlength{\itemsep}{0pt}
		\item \objectif{Factorisons $A(x)=3x+4xy$.}
		
		{\color{orange}Ce n'est pas un produit (sinon c'est déjà factorisé) mais une somme de deux termes $3x$ et $4xy$. Première étapes nous recherchons si possible un facteur commun (ce qui implique qu'il y a des produits: $3x=3 \times x$ et $4xy=4 \times x \times y$) dans les deux termes $3x$ et $4xy$. Il y a un facteur commun c'est $x$.}			
		\begin{align*}
			A(x) &= 3 {\color{WildStrawberry} x} +4{\color{WildStrawberry} x}y\\
			&= {\color{WildStrawberry} x} (3+4y)
		\end{align*}
		\begin{conclusion}
			$A(x)=x(3+4y)$.
		\end{conclusion}
		\item Factorisons $B(x)= x^2-7$.
		
		{\color{orange}C'est bien un somme de $x^2$ et de $-7$. Étape 1: recherche d'un facteur commun, mais il n'y en a clairement pas entre $x^2$ et $7$. Passons à la deuxième étape recherche d'une identité remarquable. Il y en a bien une ici: $a^2-b^2=(a-b)(a+b)$.}			
		\begin{align*}
			B(x) &= x^2-7\\
			&= x^2- \sqrt{7}^2\\
			&= (x-\sqrt{7})(x+\sqrt{7})
		\end{align*}	
		\item Factorisons $C(x)=3x^3+ (x-1)^2-(x+1)^2$.
		
		{\color{orange}Nous avons ici une somme de trois termes $3x^3$, $(x-1)^2$ et $(x+1)^2$. Il ne faut surtout pas développer! C'est le contraire de notre objectif. Les deux premières étapes (facteur commun puis identité remarquable) échouent lamentablement. Passons à la troisième étape recherche d'une factorisation partielle.}			
		\begin{align*}
			C(x) &= 3x^3 + {\color{WildStrawberry}(x-1)^2-(x+1)^2}\\
			\intertext{\color{orange}Nous reconnaissons une identité remarquable $a^2-b^2=(a-b)(a+b)$}
			C(x) &= 3x^3 + {\color{WildStrawberry}\left[ (x-1)-(x+1) \right] \times \left[ (x-1)+ (x+1) \right]}\\
			&= 3x^3 + {\color{WildStrawberry}(-2) \times 2x}\\
			&= 3x^3-4x\\
			\intertext{\color{orange}Nous reprenons toute la factorisation depuis le début et ici nous remarquons un facteur commun.}
			C(x) &= x(3x^2-4)
		\end{align*}		
	\end{enumerate}	
\end{exemples}

\begin{exercice}
	Factorisez les expressions suivantes.
	\begin{tasks}(4)
		\task $2x+2y$
		\task $7y-7x$
		\task $bc+2b$
		\task $91z-13t$
		\task $xa+ay$
		\task $x^2+xy$
		\task $a^3+a^2$
		\task $ab+a$
	\end{tasks}	
\end{exercice}

\begin{exercice}
	Factorisez les expressions suivantes.
	\begin{tasks}(2)
		\task $(x-2)(x+3)+(5-x)(2-x)$
		\task $(x-3)(x+1)-3(3-x)^2$
		\task $x^2+6x+9$
		\task $25x^2-40x+16$
		\task $x^2-1$
		\task $x^2+2x+1$
		\task $x^2-2x+1$
		\task $(x+1)(x+2)-5(x^2+4x+4)$
	\end{tasks}	
\end{exercice}

\subsubsection{Exercices.}

\begin{exercice}
	Factorisez les expressions données.	
	\begin{tasks}(3)
		\task $2x(x-1)+3x$
		\task $(x+1)(x+2)+5(x+2)$
		\task $3x^2+9x$
		\task $x^2-6x$
		\task $8x^2-5x$
		\task $3x+4xy$
		\task $3x^2+x$
		\task $(2x+1)^2-(2x+1)(x+3)$
		\task $3x(x-5)-x$
		\task $xy+xz$
	\end{tasks}
\end{exercice}

\begin{exercice}
	Factorisez les expressions données.	
	\begin{tasks}(3)
		\task $x^2(x+4)-2x(x+4)$
		\task $(x-3)^2-2(x-3)(2x-1)$
		\task $5x^2-6x$
		\task $3xy+x$
		\task $2(x+1)^2-3(x+1)$
		\task $(x+1)^2+x+1$
		\task $x^2+2x+1$
		\task $(2x-5)^2-x^2$
		\task $9x^2+12x+4$
		\task $(2x-1)^2-(x-3)^2$
	\end{tasks}
\end{exercice}

\begin{notabene}	
	Les exercices qui suivent permettent de montrer des exemples d'utilisation de la factorisation dans différentes situations.	
\end{notabene}

\begin{exercice}
	Résolvez l'équation: $(E)\quad x^2=6x-9$.	
\end{exercice}

\begin{exercice}
	Étant donnée la fonction $f:\left\{\begin{array}{rcl}
		\mathbb{R}\setminus \{ 1 \} & \rightarrow & \mathbb{R} \\  x & \mapsto & \frac{x^2-1}{x-1} \end{array} \right.$ simplifiez son expression.	
\end{exercice}

\begin{exercice}
	Soit $f$ la fonction définie sur $[2\ ;\ +\infty [$ par: $f(x)=\sqrt{1+\sqrt{x^4-4x^3+4x^2}}$. Exprimez $f(x)$ de façon plus simple.
\end{exercice}

\begin{exercice}
	
	\noindent 
	\begin{tabular}{m{6cm}m{0.5cm}m{4cm}}		
		Sur un segment $[AE]$ est placé un point $M$ mobile. Un rectangle $ABCM$ et un triangle isocèle rectangle en $M$, $MED$, sont construits comme sur la figure ci-contre.		
		\begin{enumerate}[1.]
			\setlength{\parskip}{0pt}
			\setlength{\itemsep}{0pt}
			\item Calculez l'aire $f(x)$ de $MED$.
			\item Calculez l'aire $g(x)$ de $ABCM$.
			\item Trouvez pour quelle(s) valeur(s) de $x$ les aires du rectangle et du triangle sont égales.
		\end{enumerate}		
		& &
		\begin{center}
			\begin{tikzpicture}[scale=0.6]
				\def\x{3};
				\coordinate (A) at (0,0);
				\coordinate (B) at (0,-2);
				\coordinate (C) at (\x,-2);
				\coordinate (D) at (\x,{5-\x});
				\coordinate (E) at (5,0);
				\coordinate (M) at (\x,0);
				\draw (A)node[above left]{$A$};
				\draw (B)node[below left]{$B$};
				\draw (C)node[below right]{$C$};
				\draw (D)node[above]{$D$};
				\draw (E)node[right]{$E$};
				\draw (M)node[below right]{$M$};
				\draw[blue, thick](A)--(B)--(C)--(D)--(E)--(A);
				\draw[black,<->,>=latex](0,0.5)--(\x,0.5)node[above,midway]{$x$};
				\draw[black,<->,>=latex](-0.5,0)--(-0.5,-2)node[left,midway]{$2$};
				\draw[black,<->,>=latex](0,-2.5)--(5,-2.5)node[below,midway]{$5$};
				\fill[color=orange , opacity=0.5] (A)--(B)--(C)--(M)--cycle;	
				\fill[color=violet , opacity=0.5] (M)--(D)--(E)--cycle;
				\draw ({\x /2},-1)node[fill=white]{$g(x)$};
				\draw ({\x + (5-\x )/3},0.5)node[fill=white]{$f(x)$};
			\end{tikzpicture}
		\end{center}
		\\		
	\end{tabular}	
\end{exercice}

\begin{exercice}
	Factorisez les expressions données.
	\begin{tasks}(3)
		\task $(2x+1)^2-(1-x)^2$
		\task $x^2-20x+100$
		\task $25-(x+1)^2$
		\task $4x^2+4+8x$
		\task $16(x+1)^2-25x^2$
		\task $16x^2-81$
		\task $b^2-3b+\frac{9}{4}$
		\task $(a-1)^2-2$
		\task $x^2-4+(x-2)(x+1)$
		\task $3x^2-12x+12$
	\end{tasks}
\end{exercice}

\begin{exercice}
	Factorisez les expressions données.
	\begin{tasks}(3)
		\task $x^2+3x+(x+3)^2$
		\task $(x+1)(x+2)-(3x+6)$
		\task $2x(x+3)+4x+12$
		\task $(x-3)(3x-4)-3x+4$
		\task $xy-xz-y(y-z)$
		\task $-x^2+8x-16$
		\task $7x^2-14x$
		\task $16x^2-81$
		\task $2a^2b-b$
		\task $4x^2-4x+1$
	\end{tasks}
\end{exercice}

\begin{exercice}
	Factorisez les expressions données.
	\begin{tasks}(3)
		\task $2(x-1)^2+3x-3$
		\task $2x^2+8x+8$
		\task $x^2-16+(x-4)^2$
		\task $5x^2-125$
		\task $4x^2-12x+9$
		\task $7x^2-28$
		\task $(2x-3)^2-(5x+2)^2$
		\task $(x-5)^2-2(x-5)(x-3)$
		\task $2x^2+7x$
		\task $x^2+26x+169$
		\task $(9x^2-25)+(6x+10)$
		\task $x^2-4x+4-(x-2)(7-x)$
	\end{tasks}	
\end{exercice}

\subsubsection{Corrections.}

\begin{exercicecorrection}	
	\begin{tasks}(3)
		\task $(2x+3)^2=4x^2+12x+9$
		\task $(x-3)^2=x^2-6x+9$
		\task $(4t +3)^2=16t^2 +24t+9$
		\task $\left(x-\frac{1}{2} \right)^2=x^2-x+\frac{1}{4}$
		\task $(x+4)^2=x^2+8x+16$
		\task $(x-4)^2=x^2-8x+16$
		\task $\left( \frac{1}{6}t +3 \right)^2=\frac{1}{36} t^2 +t+9$
		\task $\left( \frac{1}{2} x -4 \right)^2=\frac{1}{4}x^2 -4x+16$
	\end{tasks}	
\end{exercicecorrection}

\begin{exercicecorrection}	
	\begin{tasks}(3)
		\task $2x+2y=2(x+y)$
		\task $7y-7x=7(y-x)$
		\task $bc+2b=b(c+2)$
		\task $91z-13t=13(7z-1)$
		\task $xa+ay=a(x+y)$
		\task $x^2+xy=x(x+y)$
		\task $a^3+a^2=a^2(a+1)$
		\task $ab+a=a(b+1)$
	\end{tasks}	
\end{exercicecorrection}

\begin{exercicecorrection}	
	\begin{tasks}(2)
		\task $(x-2)(x+3)+(5-x)(2-x)=(x-2)(2x-2)$
		\task $(x-3)(x+1)-3(3-x)^2=(x-3)(-2x+4)$
		\task $x^2+6x+9=(x+3)^2$
		\task $25x^2-40x+16(5x-4)^2$
		\task $x^2-1=(x-1)(x+1)$
		\task $x^2+2x+1=(x+1)^2$
		\task $x^2-2x+1=(x-1)^2$
		\task $(x+1)(x+2)-5(x^2+4x+4)=(x+1)(-4x-7)$
	\end{tasks}	
\end{exercicecorrection}

\begin{exercicecorrection}
	\begin{tasks}(2)
		\task $2x(x-1)+3x=x(2x+1)$
		\task $(x+1)(x+2)+5(x+2)=(x+2)(x+6)$
		\task $3x^2+9x=3x(x+3)$
		\task $x^2-6x=x(x-6)$
		\task $8x^2-5x=x(8x-5)$
		\task $3x+4xy=x(3+4y)$
		\task $3x^2+x=x(3x+1)$
		\task $(2x+1)^2-(2x+1)(x+3)=(2x+1)(x-2)$
		\task $3x(x-5)-x=x(3x-16)$
		\task $xy+xz=x(y+z)$
	\end{tasks}
\end{exercicecorrection}

\begin{exercicecorrection}
	\begin{tasks}(2)
		\task $x^2(x+4)-2x(x+4)=x(x+4)(x-2)$
		\task $(x-3)^2-2(x-3)(2x-1)=(x-3)(-3x-1)$
		\task $5x^2-6x=x(5x-6)$
		\task $3xy+x=x(3y+1)$
		\task $2(x+1)^2-3(x+1)=(x+1)(2x-1)$
		\task $(x+1)^2+x+1=(x+1)(x+2)$
		\task $x^2+2x+1=(x+1)^2$
		\task $(2x-5)^2-x^2=(x-5)(3x-5)$
		\task $9x^2+12x+4=(3x+2)^2$
		\task $(2x-1)^2-(x-3)^2=(x+2)(3x-4)$
	\end{tasks}
\end{exercicecorrection}

\begin{exercicecorrection}
	\usym{1F589}\objectif{Résolvons l'équation $(E)$.}
	
	{\color{orange}Très souvent pour résoudre une équation qui n'est pas linéaire en mathématique nous essayerons de ramener l'équation à une équation produit-nul (donc égale à 0).}
	
	{\color{orange}Nous nous ramenons à une équation produit:}	
	\begin{align*}
		(E) &\Leftrightarrow x^2-(6x-9)=6x-9-(6x-9)\\
		&\Leftrightarrow x^2-6x+9 = 0\\
		&\Leftrightarrow x^2-2\times 3\times x+3^3=0\\
		&\Leftrightarrow (x-3)^2=0\\
		\intertext{\color{orange}Résolvons l'équation produit:}
		&\Leftrightarrow x-3=0 \text{ ou } x-3=0 \\
		&\Leftrightarrow x=\trous[1cm]{3}
	\end{align*}	
	\begin{conclusion}		
		L'ensemble des solutions de l' équation $(E)$ est: $\mathcal{S}=\{ 3 \}$.		
	\end{conclusion}
	
	{\color{orange}Nous verrons plus tard dans l'année que pour résoudre une inéquation nous nous ramèneront à une inéquation produit en factorisant.}	
\end{exercicecorrection}

\begin{exercicecorrection}	
	Soit $x\in \mathbb{R}\setminus \{ 1\}$.
	
	{\color{orange}Pour simplifier une fraction il faut faire apparaître un facteur commun au numérateur et au dénominateur. Ils faut donc les factoriser. Ici on observe une identité remarquable.} $\frac{x^2-1}{x-1} = \frac{x^2-1^2}{x-1} =\frac{(x-1)\times (x+1)}{1\times (x-1)} = x+1$.
\end{exercicecorrection}

\begin{exercicecorrection}
	\usym{1F589}\objectif{Simplifions l'expression de $f$.}
	
	Soit $x \in [2; +\infty[$.	
	$x^4-4x^3+4x^2 = x^2 (x^2-4x+4)= x^2(x-2)^2$. Puisque $x\ge 2$, $\sqrt{x^2(x-2)^2}= x(x-2)$. Et donc: $f(x) = \sqrt{1+x(x-2)} =\sqrt{x^2-2x+1} = \sqrt{(x-1)^2}$. 
	
	\begin{conclusion}		
		Quelque soit $x\in [2; + \infty[$, $f(x)=x-1$.
	\end{conclusion}	
\end{exercicecorrection}

\begin{exercicecorrection}
	\usym{1F589}
	\begin{enumerate}
		\setlength{\parskip}{0pt}
		\setlength{\itemsep}{0pt}
		\item \objectif{Déterminons une formulation algébrique de $f$.}
		
		Remarquons tout d'abord que \[ \left. \begin{array}{r} M \in [AE] \\ AE=5\\ x=AE \end{array} \right\} \Rightarrow x \in [0;5]. \]
		
		Autrement dit le domaine de définition de $f$ est $\mathscr{D}_f=[0;5]$.
		
		Soit $x\in [0;5]$.
		
		$MED$ étant rectangle en $M$:		
		\begin{align*}
			f(x) &= \frac{1}{2} \times ME \times MD\\
			\intertext{Puisque $MED$ est isocèle en $M$:}
			f(x) &= \frac{1}{2} ME^2\\
			\intertext{Enfin, puisque $M \in [AE]$:}
			f(x) &= \frac{1}{2} (5-x)^2
		\end{align*}		
		\begin{conclusion}			
			Pour tout $x \in [0;5]$: $f(x)= \frac{1}{2}(x-5)^2$.			
		\end{conclusion}		
		\item \objectif{Déterminons une formulation algébrique de $g$.}
		
		Soit $x \in [0;5]$.
		
		$ABCM$ est un rectangle donc		
		\begin{align*}
			g(x) &= AB \times BC\\
			&= 5 \times x
		\end{align*}		
		\begin{conclusion}			
			Pour tout $x \in [0;5]$: $g(x)=5x$			
		\end{conclusion}		
		\item {\color{orange}Je réinterprète la question en la traduisant par une équation:}
		
		\objectif{Résolvons dans $[0;5]$ l'équation: $f(x)=g(x)$.}
		
		Soit $x \in [0;5]$.		
		\begin{align*}
			f(x) &= g(x)\\
			\intertext{équivaut successivement à}
			\frac{1}{2}(5-x)^2 &= 2x\\
			\intertext{\color{orange}Un peu de méthode. Il ne s'agit visiblement pas d'une équation linéaire (un $x$ est élevé au carré), il faut donc faire apparaître une équation produit-nul. Si on veut un produit il faut donc factoriser.}
			\frac{1}{2}(5-x)^2 {\color{WildStrawberry}-2x} &= 2x {\color{WildStrawberry}-2x}\\
			\frac{1}{2} (5-x)^2 -2x &= 0\\
			\intertext{\color{orange}Rappelons que nous essayons d'abord de trouver un facteur commun, sinon une identité remarquable ou encore une factorisation partielle. Mais rien de tout ceci ne semble fonctionner. Développons tout avant d'essayer à nouveau de factoriser.}
			\frac{1}{2} \left( 5^2-2 \times 5 \times x +x^2 \right) -2x &= 0\\
			\frac{1}{2} \left( 25-10x+x^2 \right)-2x &= 0\\
			\frac{1}{2}x^2-7x+\frac{25}{2} &= 0
		\end{align*}		
		{\color{orange}À partir de là nous bloquons. Nous ne voyons pas comment factoriser. Ceci dit nous pouvons néanmoins conjecturer l'ensemble des solutions avec la calculatrice.}
		
		Représentons graphiquement les courbes représentatives des fonctions $f$ et $g$ avec la calculatrice.
		
		Il semblerait que les aires soient égalent pour une unique valeur de $x$ qui est approximativement de $2,12$.
		
		{\color{orange}La méthode générale de résolution de ce type d'équation (équation polynomiale de degré deux) est au programme de première.}		
	\end{enumerate}	
\end{exercicecorrection}

\begin{exercicecorrection}
	\begin{tasks}(2)
		\task $(2x+1)^2-(1-x)^2=3x(x+2)$
		\task $x^2-20x+100=(x-10)^2$
		\task $25-(x+1)^2=(-x+4)(x+6)$
		\task $4x^2+4+8x=4(x+1)^2$
		\task $16(x+1)^2-25x^2=(-x+4)(9x+4)$
		\task $16x^2-81=(4x-9)(4x+9)$
		\task $b^2-3b+\frac{9}{4}=\left( b-\frac{3}{2} \right)^2$
		\task $(a-1)^2-2=(a-1-\sqrt{2} )(a-1+\sqrt{2})$
		\task $x^2-4+(x-2)(x+1)=(x-2)(2x+3)$
		\task $3x^2-12x+12=3(x-2)^2$
	\end{tasks}
\end{exercicecorrection}

\begin{exercicecorrection}
	\begin{tasks}(2)
		\task $x^2+3x+(x+3)^2=(x+3)(2x+3)$
		\task $(x+1)(x+2)-(3x+6)=(x-2)(x+2)$
		\task $2x(x+3)+4x+12=2(x+3)(x+2)$
		\task $(x-3)(3x-4)-3x+4=(3x-4)(x-4)$
		\task $xy-xz-y(y-z)=(x-y)(y-z)$
		\task $-x^2+8x-16=-(x-4)^2$
		\task $7x^2-14x=7x(x-2)$
		\task $16x^2-81=(4x-9)(4x+9)$
		\task $2a^2b-b=(2a^2-1)b$
		\task $4x^2-4x+1=4 \left( x-\frac{1}{2} \right)^2$
	\end{tasks}
\end{exercicecorrection}

\begin{exercicecorrection}
	\begin{tasks}(2)
		\task $2(x-1)^2+3x-3=(x-1)(2x+1)$
		\task $2x^2+8x+8=2(x+2)^2$
		\task $x^2-16+(x-4)^2=2x(x-4)$
		\task $5x^2-125=5(x-5)(x+5)$
		\task $4x^2-12x+9=4(x-3)^2$
		\task $7x^2-28=7(x-2)(x+2)$
		\task $(2x-3)^2-(5x+2)^2=(-3x-5)(7x-1)$
		\task $(x-5)^2-2(x-5)(x-3)=(x-5)(-x+1)$
		\task $2x^2+7x=x(2x+7)$
		\task $x^2+26x+169=(x+13)^2$
		\task $(9x^2-25)+(6x+10)=3(3x+5)(x-1)$
		\task $x^2-4x+4-(x-2)(7-x)=(x-2)(2x-9)$
	\end{tasks}	
\end{exercicecorrection}

\end{document}

\section{Modèles.}

\setlength{\parskip}{0pt}
\setlength{\itemsep}{0pt}

\subsection{Graphique}

\begin{center}
	\begin{tikzpicture}[xscale=1,yscale=1]
	\def\xY{-0.5};
	\def\yY{-0.5};
	\def\xZ{8.5};
	\def\yZ{7};
	\coordinate (Y) at (\xY,\yY);
	\coordinate (Z) at (\xZ,\yZ);
	\draw[xstep=0.1cm, ystep=0.1cm, line width=0.01cm,gray!50!white] (Y) grid (Z);
	\draw[xstep=1cm, ystep=1cm, line width=0.02cm,black!70!white] (Y) grid (Z);
	\draw (0,0)node[below left]{\small $0$};
	\foreach \x in {1, 2} \draw[thick](\x,0.1cm)--(\x,-0.1cm) node[below left]{\footnotesize  \pgfmathparse{\x }\pgfmathprintnumber{\pgfmathresult}};
	\foreach \y in {1,2} \draw[thick](0.1cm,\y)--(-0.1cm,\y) node[below left]{\footnotesize  \pgfmathparse{\y }\pgfmathprintnumber{\pgfmathresult}};
	\draw[ ->,very thick] (\xY, 0) -- (\xZ, 0) node[right]{$x$};
	\draw[ ->,very thick] (0, \yY) -- (0, \yZ) node[above]{$y$};
	\draw[blue, thick][samples=100,domain=0:7] plot(\x,{(\x +1)^2/exp(\x )});
	\draw[blue] (3,2) node[fill=white] {$\mathcal{C}_B$};
	\fill[color=gray , opacity=0.25] (-0.5, {(-(2/9)*((-0.5)*2)*(2*(-0.5))+(4/3)*(2*(-0.5))+4)/2})
	-- plot [domain=-0.5:2] (\x,{(-(2/9)*(\x*2)*(2*\x)+(4/3)*(2*\x)+4)/2})
	-- (2, {(-(2/9)*(2*2)*(2*2)+(4/3)*(2*2)+4)/2})
	-- (2,0) 
	--(-0.5,0)
	-- cycle;
	\draw[blue, thick] plot[smooth] coordinates {(-3,-1)(-2.5,-0.65)};
	\end{tikzpicture}
\end{center}

Pour évaluer la fonction f en a avec tikz: \pgfmathparse{f(a)}\pgfmathresult

%Pour affecter la valeur a à la variable \x: \def\x{a}

\subsection{Graphique nouveau.}


\begin{center}
	
	\begin{tikzpicture}[xscale=1,yscale=1]
	%extremites du graphique
	\def\xcoinbasgauche{-2};
	\def\xcoinhautdroit{4};
	\def\ycoinbasgauche{-4};
	\def\ycoinhautdroit{4};
	%Les deux grilles
	\draw[xstep=0.5cm, ystep=0.5cm, line width=0.01cm,gray!40!white] ({\xcoinbasgauche},{\ycoinbasgauche}) grid ({\xcoinhautdroit},{\ycoinhautdroit});
	\draw[xstep=1cm, ystep=1cm, line width=0.02cm,black!60!white]({\xcoinbasgauche},{\ycoinbasgauche}) grid ({\xcoinhautdroit},{\ycoinhautdroit});
	%Les deux axes
	\draw[ ->,thick,black] (\xcoinbasgauche, 0) -- (\xcoinhautdroit, 0) node[right]{$x$};
	\draw[ ->, thick,black] (0, \ycoinbasgauche) -- (0, \ycoinhautdroit) node[above]{$y$};
	%repere orthonorme
	\coordinate (O) at ({0},{0});
	\draw (O) node[below left] {$O$};
	\draw (O) node {$\bullet$};
	\coordinate (I) at ({1},{0});
	\draw (I) node[below left] {$I$};
	\draw (I) node {$\bullet$};
	\coordinate (J) at ({0},{1});
	\draw (J) node[below left] {$J$};
	\draw (J) node {$\bullet$};
	%Graduations
	\foreach \x in {1, 2} \draw[thick](\x,0.1cm)--(\x,-0.1cm) node[below]{\footnotesize  \pgfmathparse{\x }\pgfmathprintnumber{\pgfmathresult}};
	\foreach \y in {1,2} \draw[thick](0.1cm,\y)--(-0.1cm,\y) node[left]{\footnotesize  \pgfmathparse{\y }\pgfmathprintnumber{\pgfmathresult}};
	%fonction
	\draw[orange, thick][samples=100,domain=-1.2:3.2] plot({\x},{\x*\x*\x-3*\x*\x+2});
	%Points
	\foreach \a/\b in { -1/-2, 0/2, 1/0, 2/-2, 3/2} {\draw [red, thick] ({\a},{\b}) node{$\times$};}
	%Tangentes horizontales
	\def\longueurtangente{0.7};
	\foreach \a/\b in { 0/2, 2/-2}{ \draw[blue, thick][>=latex, <->] ({-\longueurtangente+\a}, {\b}) -- ({\longueurtangente+\a},{\b});}
	%Ligne définie par des points
	\draw[orange, thick] plot[smooth] coordinates {(-1,-1)(1,2)};
	\end{tikzpicture}
	
\end{center}

\subsection{Rectangle en coin.}

\begin{tikzpicture}
	\def\xangledroit{0};
	\def\yangledroit{0};
	\def\longueurangledroit{0.5};
	\draw[fill=green!30,rotate around={{20}:({\xangledroit},{\yangledroit})}] ({\xangledroit},{\yangledroit}) rectangle ({\xangledroit+\longueurangledroit},{\yangledroit+\longueurangledroit});
\end{tikzpicture}

ou bien avec matrice rotation plus translation ici 45 degres et translation de vecteur (1,1).
\begin{tikzpicture}
		\def\code{0.2};
		\draw [cm={cos(-45) ,-sin(-45) ,sin(-45) ,cos(-45) ,(1,1)}]  ({-\code},{0}) -- ({0-\code},{0+\code}) -- (0,{0+\code});
\end{tikzpicture}

\subsection{Pavé droit.}

\begin{center}
	
	\begin{tikzpicture}
	\def\longueur{5};
	\def\hauteur{3};
	\def\profondeur{2};
	\def\angledefuite{30};
	\def\coefficientmultiplicateur{0.8};
	\def\xA{0};
	\def\yA{0};
	%Création des points du bas.
	\coordinate (A) at ({\xA},{\yA});
	\coordinate (B) at ({\xA+\longueur},{\yA});
	\coordinate (C) at ({\xA+\longueur+\profondeur*cos(\angledefuite)},{\yA+\profondeur*sin(\angledefuite)});
	\coordinate (D) at ({\xA+\profondeur*cos(\angledefuite)},{\yA+\profondeur*sin(\angledefuite)});
	%Création des points du haut
	\coordinate (E) at ({\xA},{\yA+\hauteur});
	\coordinate (F) at ({\xA+\longueur},{\yA+\hauteur});
	\coordinate (G) at ({\xA+\longueur+\profondeur*cos(\angledefuite)},{\yA+\profondeur*sin(\angledefuite)+\hauteur});
	\coordinate (H) at ({\xA+\profondeur*cos(\angledefuite)},{\yA+\profondeur*sin(\angledefuite)+\hauteur});
	%Nom des points du bas dans le sens direct
	\draw (A) node [below left] {$A$};
	\draw (B) node [below right] {$B$};
	\draw (C) node [below right] {$C$};
	\draw (D) node [above left] {$D$};
	\draw (E) node [above left] {$E$};
	\draw (F) node [above] {$F$};
	\draw (G) node [above right] {$G$};
	\draw (H) node [above left] {$H$};
	%Les arêtes du bas
	\draw [] (A) -- (B);
	\draw [] (B) -- (C);
	\draw [dashed] (C) -- (D);
	\draw [dashed] (D) -- (A);
	%Les arêtes verticales
	\draw [] (A) -- (E);
	\draw [] (B) -- (F);
	\draw [] (C) -- (G);
	\draw [dashed] (D) -- (H);
	%Les arête du haut
	\draw [] (E) -- (F);
	\draw [] (F) -- (G);
	\draw [] (G) -- (H);
	\draw [] (H) -- (E);
	\end{tikzpicture}
	
\end{center}

\subsection{Dessin.}

\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (5,-1);
\coordinate (F) at (6,0);
\coordinate (C) at (7,1);
\coordinate (D) at (2,2);
\coordinate (O) at (3.5,0.5);
\coordinate (S) at (3.5,6);
\coordinate (J) at (3.5,3.5);
\coordinate (K) at (3,4.666);
\draw (A) node {$\bullet$};
\draw (B)node {$\bullet$};
\draw (F)node {$\bullet$};
\draw (C)node {$\bullet$};
\draw (D)node {$\bullet$};
\draw (O)node {$\bullet$};
\draw (S)node {$\bullet$};
\draw (J)node {$\bullet$};
\draw (K)node {$\bullet$};
\draw (A)node[below]{$A$};
\draw (B)node[below right]{$B$};
\draw (F)node[right]{$F$};
\draw (C)node[right]{$C$};
\draw (D)node[above right]{$D$};
\draw (O)node[above right]{$O$};
\draw (S)node[above]{$S$};
\draw (J)node[above right]{$J$};
\draw (K)node[below right]{$K$};
\draw[blue, thick](A)--(B)--(C);
\draw[blue, thick,dashed](A)--(D)--(C);
\draw[blue, thick](A)--(S);
\draw[blue, thick](B)--(S);
\draw[blue, thick](C)--(S);
\draw[blue, thick,dashed](D)--(S);
\draw[blue, thick,dashed](O)--(S);
\draw[blue, thick](F)--(S);
\draw[blue, thick,dashed](A)--(C);
\draw[blue, thick,dashed](D)--(B);
\draw[blue, thick,dashed](B)--(J)--(C);
\fill[color=gray , opacity=0.05] (A)--(B)--(C)--(D)--cycle;	
\fill[color=gray , opacity=0.1] (B)--(C)--(S)--cycle;
\fill[color=gray , opacity=0.15] (A)--(D)--(C)--(S)--cycle;
\fill[color=gray , opacity=0.20] (B)--(C)--(J)--cycle;			
\end{tikzpicture}

\subsection{Arbre nouveau 2 niveau.}

\begin{center}
	\begin{tikzpicture}[xscale=1,yscale=1]
	%Écarts entre entre racine et premier niveau
	\def\xA{2};
	%Nombre de nœuds du premiers niveau
	\def\noA{2};
	%Nombre de nœuds du deuxième niveau
	\def\noB{6};
	%Nombre de nœuds par embranchement du deuxième niveau
	\def\noBe{3};
	%Écarts entre nœuds du deuxième niveau
	\def\xB{2+\xA};
	\def\yB{1};
	%Racine
	\coordinate (O) at ({0},{-\yB/2});
	%Pour ne pas écrire les mots above et below
	\def\posA{above};
	\def\posB{below};
	%Position des nœuds du premier niveau
	%Dessin des nœuds branches du premier niveau 
	\foreach \nA/\A/\numero/\contenu/\ponderation/\position in {
		nA1/A1/1/$2^0$/$\np{1}$/\posA,
		nA2/A2/2/$2^1$/$\np{2}$/\posB
	}{
		\coordinate (\A) at ({\xA},{\noB*\yB-(\noBe+1)/2*\yB-\noB*\yB/2-(\numero-1)*\yB*\noBe});
		\draw node (\nA) at (\A) {\contenu};
		\draw (O)--(\nA) node[midway, sloped, \position] {\ponderation};
	};
	%Position des nœuds, dessin des nœuds et des branches du deuxième niveau
	\foreach \nA/\nB/\B/\numero/\contenu/\ponderation/\position in {
		nA1/nB1/B1/1/$3^0$/$\np{1}$/\posA,
		nA1/nB2/B2/2/$3^1$/$\np{2}$/\posB,
		nA1/nB3/B3/3/$3^2$/$\np{1}$/\posA,
		nA2/nB4/B4/4/$3^0$/$\np{2}$/\posB,
		nA2/nB5/B5/5/$3^1$/$\np{1}$/\posA,
		nA2/nB6/B6/6/$3^2$/$\np{2}$/\posB
	}{
		\coordinate (\B) at ({\xB},{(\noB-\numero)*\yB-\noB*\yB/2});
		\draw node (\nB) at (\B) {\contenu};
		\draw (\nA)--(\nB) node[midway, sloped, \position] {\ponderation};
	};
	\end{tikzpicture}
\end{center}

\subsection{Arbre nouveau 3 niveaux.}

\begin{center}
	\begin{tikzpicture}[xscale=1,yscale=1]
	%Écarts entre entre racine et premier niveau
	\def\xA{2};
	%Nombre de nœuds du premiers niveau
	\def\noA{3};
	%Nombre de nœuds du deuxième niveau
	\def\noB{6};
	%Nombre de nœuds par embranchement du deuxième niveau
	\def\noBe{2};
	%Écarts entre nœuds du deuxième niveau
	\def\xB{2+\xA};
	\def\yB{1};
	%Nombre de nœuds du troisième niveau
	\def\noC{12};
	%Nombre de nœuds par embranchement du troisième niveau
	\def\noCe{2};
	%Écarts entre nœuds du troisième niveau
	\def\xC{2+\xB};
	\def\yC{1};
	%Racine
	\coordinate (O) at ({0},{-\yB/2});
	%Pour ne pas écrire les mots above et below
	\def\posA{above};
	\def\posB{below};
	%Position des nœuds du premier niveau
	%Dessin des nœuds branches du premier niveau 
	\foreach \nA/\A/\numero/\contenu/\ponderation/\position in {
		nA1/A1/1/$2^0$/$\np{1}$/\posA,
		nA2/A2/2/$2^1$/$\np{1}$/\posA,
		nA3/A3/3/$2^2$/$\np{1}$/\posB
	}{
		\coordinate (\A) at ({\xA},{\noC*\yC-(\noCe*\noBe+1)/2*\yC-\noC*\yC/2-(\numero-1)*\yC*\noBe*\noCe});
		\draw node (\nA) at (\A) {\contenu};
		\draw (O)--(\nA) node[midway, sloped, \position] {\ponderation};
	};
	%Position des nœuds, dessin des nœuds et des branches du deuxième niveau
	\foreach \nA/\nB/\B/\numero/\contenu/\ponderation/\position in {
		nA1/nB1/B1/1/$3^0$/$\np{1}$/\posA,
		nA1/nB2/B2/2/$3^1$/$\np{1}$/\posB,
		nA2/nB3/B3/3/$3^0$/$\np{1}$/\posA,
		nA2/nB4/B4/4/$3^1$/$\np{1}$/\posB,
		nA3/nB5/B5/5/$3^0$/$\np{1}$/\posA,
		nA3/nB6/B6/6/$3^1$/$\np{1}$/\posB
	}{
		\coordinate (\B) at ({\xB},{\noC*\yC-(\noCe+1)/2*\yC-\noC*\yC/2-(\numero-1)*\yC*\noCe});
		\draw node (\nB) at (\B) {\contenu};
		\draw (\nA)--(\nB) node[midway, sloped, \position] {\ponderation};
	};
	
	%Position des nœuds, dessin des nœuds et des branches du troisième niveau
	\foreach \nB/\nC/\C/\numero/\contenu/\ponderation/\position in {
		nB1/nC1/C1/1/$5^0$/$\np{1}$/\posA,
		nB1/nC2/C2/2/$5^0$/$\np{1}$/\posA,
		nB2/nC3/C3/3/$5^1$/$\np{1}$/\posA,
		nB2/nC4/C4/4/$5^1$/$\np{1}$/\posA,
		nB3/nC5/C5/5/$5^0$/$\np{1}$/\posA,
		nB3/nC6/C6/6/$5^0$/$\np{1}$/\posA,
		nB4/nC7/C7/7/$5^1$/$\np{1}$/\posA,
		nB4/nC8/C8/8/$5^1$/$\np{1}$/\posA,
		nB5/nC9/C9/9/$5^0$/$\np{1}$/\posA,
		nB5/nC10/C10/10/$5^0$/$\np{1}$/\posA,
		nB6/nC11/C11/11/$5^1$/$\np{1}$/\posA,
		nB6/nC12/C12/12/$5^1$/$\np{1}$/\posA
	}{
		\coordinate (\C) at ({\xC},{(\noC-\numero)*\yC-\noC*\yC/2});
		\draw node (\nC) at (\C) {\contenu};
		\draw (\nB)--(\nC) node[midway, sloped, \position] {\ponderation};
	};
	\end{tikzpicture}
\end{center}

\subsection{Arbre.}

\begin{center}
	\begin{tikzpicture}[xscale=1,yscale=1]
	\coordinate (A1) at (4,3);
	\coordinate (A2) at (4,1);
	\coordinate (A3) at (4,-1);
	\coordinate (A4) at (4,-3);
	\coordinate (B1) at (2,2);
	\coordinate (B2) at (2,-2);
	\coordinate (C1) at (0,0);
	\draw node (A11) at (A1) {$1$};	
	\draw node (A12) at (A2) {$2$};
	\draw node (A13) at (A3) {$3$};
	\draw node (A14) at (A4) {$4$};
	\draw node (B11) at (B1) {$1$};
	\draw node (B12) at (B2) {$2$};
	\draw (B11)--(A11)node[midway,sloped,above]{\color{blue}$0,5$};
	\draw (B11)--(A12)node[midway,sloped,below]{\color{blue}$0,5$};
	\draw (B12)--(A13)node[midway,sloped,above]{\color{blue}$0,25$};
	\draw (B12)--(A14)node[midway,sloped,below]{\color{blue}$0,25$};
	\draw (C1)--(B11)node[midway,sloped,above]{\color{blue}$\frac{3}{8}$};
	\draw (C1)--(B12)node[midway,sloped,below]{\color{blue}$\frac{5}{8}$};
	\end{tikzpicture}
\end{center}

\subsection{Arbre bis.}

\begin{center}
	
	\begin{tikzpicture}[scale=0.5]
	%Création des nœuds
	\foreach \A/\ord/\n in {A1/7/1, A2/5/7, A3/3/1, A4/1/7, A5/-1/1, A6/-3/7, A7/-5/1, A8/-7/7} \node (\A) at (8,\ord){\n};
	\foreach \B/\ord/\n in {B1/6/1, B2/2/3, B3/-2/1, B4/-6/3} \node (\B) at (4,\ord) {\n};
	\foreach \C/\ord/\n in {C1/4/1, C2/-4/2} \node (\C) at (0,\ord) {\n};
	\foreach \D/\ord/\n in {D1/7/1, D2/5/7, D3/3/3, D4/1/21, D5/-1/2, D6/-3/14, D7/-5/6, D8/-7/42} \node (\D) at (12,\ord){\n};
	%Branches entre les nœuds
	\foreach \B/\A in {B1/A1, B1/A2, B2/A3, B2/A4, B3/A5, B3/A6, B4/A7, B4/A8} \draw (\B) -- (\A);
	\foreach \C/\B in {C1/B1, C1/B2, C2/B3, C2/B4} \draw (\C) -- (\B);
	\foreach \C in {C1, C2} \draw (-4,0) -- (\C);
	\end{tikzpicture}
	
\end{center}

\subsection{Tab}

\begin{center}
	\begin{tikzpicture}
	\tkzTabInit[lgt=1.6 , espcl=1.6, deltacl=0.5]{$x$ /0.8, $f'$ /0.8, $f$ /1.6}
	{$-\infty$ ,$1$, $+\infty$}
	\tkzTabLine{,+,d,+,}%
	\tkzTabVar {+/ $\mathrm{e}$, -D+ / $0$ / $+\infty$, - / $\mathrm{e}$ / }
	\end{tikzpicture}
\end{center}

\subsection{Tab2.}

\begin{tikzpicture}
\tkzTabInit[lgt=1 , espcl=1.6]{$x$ /0.8, $C_M'$ /0.8, $C_M$ /2.4}
{$-\infty$ ,$-10$, $0$, $5$, $10$, $40$,  $+\infty$}
\tkzTabLine{,+,z,-,d,-,t,-,z,+,t,+,}%
\tkzTabVar {-/$-\infty$, +/$30$,-D+/$-\infty$ /$+\infty$,R/ /,-/$70$, R/ /, +/$+\infty$ }
\tkzTabVal[draw]{3}{5}{0.5}{}{$75$}
\tkzTabVal[draw]{5}{7}{0.5}{}{$\np{92,5}$}
\draw[fill=Red!80,opacity=0.2](M30) rectangle (M63);
\end{tikzpicture}

\subsection{Python}

\begin{center}
	\begin{minipage}{5cm}
		\lstset{emph={fonction}, emphstyle=\color{red},
			emph={[2]variable1,variable2}, emphstyle={[2]\color{orange}}}
		\begin{lstlisting}{style=pythonstyle}
		def fonction(variable1):
		variable2=3
		\end{lstlisting}
	\end{minipage}
\end{center}

\subsection{Bash}

%\begin{minipage}{5cm}
\begin{lstlisting}{style=bashstyle}
sudo apt update
sudo apt upgrade
\end{lstlisting}
\hfill {\tiny \href{http://unemainlavelautre.net/fichier.txt}{Pour copier-coller: clic droit, ouvrir dans une nouvelle fenêtre.}}
%\end{minipage}

\subsection{Pseudocode}

\begin{tabular}{|c|}
	\hline
	\begin{minipage}{8cm}
		\LinesNumbered
		\SetKw{entrer}{entrer}
		\SetKw{prend}{prend la valeur}
		\SetKw{afficher}{afficher}
		\begin{algorithm}[H]
			\SetAlgoLined
			\DontPrintSemicolon
			\entrer pi
			0\;
			\Tq{1}{
				2\;
				\eSi{3}{
					4\;
					5\;
				}{
					6\;
				}
			}
			
			\Pour{7}{
				\Si{8}{
					9\;
				}
			}
		\end{algorithm}
	\end{minipage}
	\\
	\hline
\end{tabular}

\subsection{Tabularx}

Pour center dans une seule cellule \hfill avant et après le texte suffisent

\noindent
\begin{tabularx}{\linewidth}{|m{2.5cm}|*{6}{>{\centering\arraybackslash}X|}}
	\hline
	Nombre affiché sur la face & 1 & 2 & 3 & 4 & 5 & 6
	\\
	\hline
\end{tabularx}

\subsection{Tableau sans une case et diagonale.}


\begin{tabular}{|*{7}{c|}}
	\cline{2-7} \multicolumn{1}{c|}{}& Moyenne & Minimum & Quartile 1 & Médiane &	Quartile 3 & Maximum
	\\
	\hline
	Série $T$ &	\backslashbox{$v_n$}{$u_n$}&	67&	70&	72&	74& 78
	\\
	\hline
	Série $P$ &&&&&& 
	\\
	\hline
\end{tabular}

\subsection{Tableau ligne colonne.}

\begin{tabular}{|*{11}{c|}}
	\hline
	\multirow{2}*{Fournisseur} & \multicolumn{8}{c|}{Critères} & \multirow{2}*{Note globale} & \multirow{2}*{Classement}
	\\
	\cline{2-9}
	& Sécurité &&&&&&&&&
	\\
	\hline
	&  &&&&&&&&&
	\\
	\hline
\end{tabular}\\

\subsection{Retrait dans la marge.}

\hspace*{-1cm}

\subsection{Note dans la marge}

\marginpar{\color{red}$\heartsuit$}

\subsection{Notation modulo.}

$3 \equiv 1 \mod{2}$

\subsection{Diapositive.}

%Pour afficher la page en paysage il faut modifier
%\usepackage[a5paper,landscape]{article} %ACTIVER POUR A5
%\geometry{hscale=0.9,vscale=0.9,centering} %ACTIVER POUR A5

\pagecolor{cyan!25}

\begin{center}
	
	\begin{tikzpicture}
	\coordinate (AA) at (-9,6.5);
	\node (AA) at (AA) {};
	\coordinate (BB) at (9,6.5);
	\node (BB) at (BB) {};
	\coordinate (CC) at (9,-6.5);
	\node (CC) at (CC) {};
	\coordinate (DD) at (-9,-6.5);
	\node (DD) at (DD) {};
	\draw (AA)--(BB)--(CC)--(DD)--(AA);
	\end{tikzpicture}
	
\end{center}

\subsection{Binomiale.}

\begin{enumerate}[*]
	\item Épreuve de Bernoulli.
	
	\begin{enumerate}[$\bullet$]
		\item Expérience: lancer un dé.
		\item Succès: \og Obtenir $6$ \fg{}.
		\item Probabilité de succès: $p=\frac{1}{6}$.
	\end{enumerate}
	
	\item Schéma de Bernoulli.
	
	L'épreuve de Bernoulli précédemment décrite est répétée à l'identique et de façon indépendante $n=3$ fois.
	
	\item Loi binomiale.
	
	$X$ compte le nombre de $6$ parmi les $3$ lancés, donc compte le nombre de succès donc: $X \hookrightarrow \mathscr{B}\left( 3, \frac{1}{6} \right)$.
	
\end{enumerate}

\subsection{Engrenages.}
\newcommand{\roue}[4]{% #1 = rayon, #2 = nombre de dents, #3 = X centre, #4 = Y centre
\foreach \i in {1,2,...,#2}
{
\pgfmathparse{360*(\i-1)/#2}\let\angle\pgfmathresult

\begin{scope}[shift={(#3,#4)}]
\pgfmathparse{#1*cos(90+360/(#2*4))}\let\Ax\pgfmathresult 
\pgfmathparse{#1*sin(90+360/(#2*4))}\let\Ay\pgfmathresult

\pgfmathparse{#1*cos(90-360/(#2*4))}\let\Bx\pgfmathresult
\pgfmathparse{#1*sin(90-360/(#2*4))}\let\By\pgfmathresult

\pgfmathparse{4*#1*cos(90+360/(#2*8))/3}\let\Cx\pgfmathresult
\pgfmathparse{4*#1*sin(90+360/(#2*8))/3}\let\Cy\pgfmathresult

\pgfmathparse{4*#1*cos(90-360/(#2*8))/3}\let\Dx\pgfmathresult
\pgfmathparse{4*#1*sin(90-360/(#2*8))/3}\let\Dy\pgfmathresult

\pgfmathparse{90-360/(#2*4)}\let\a\pgfmathresult
\pgfmathparse{90-1.5*360/(#2*2)}\let\b\pgfmathresult

\draw[rotate=\angle] (\Ax,\Ay) to[bend left=15] (\Cx,\Cy) -- (\Dx,\Dy) to[bend left=15] (\Bx,\By) arc (\a:\b:#1cm); 
\end{scope}
}
}

\begin{tikzpicture}
\roue{3}{20}{0}{0}
\roue{3}{16}{7.4}{2}
\end{tikzpicture}