\documentclass[convert=true,convert={convertexe={convert},density=1200,outext=.png}]{standalone}

\input{figsDefs.tex}

\begin{document}
	
\begin{tikzpicture}%
	% trajectoire f=1./48.*(-2*x*x*x-9*x*x+107)
	% deriv\'{e}e fp=1./48.*(-6*x*x-18*x)
	\shorthandoff{:}
	\draw[-,blue,thick] plot[id=temp,smooth,domain=-2.5:3.2,samples=30] function{1./48.*(-2*x*x*x-9*x*x+107)} node[left=3pt] {$\Gamma$};
	\draw[-,absCol,thick] plot[id=temp,smooth,domain=0.3:2,samples=30] function{1./48.*(-2*x*x*x-9*x*x+107)};
	\draw[-,gray!40,thick] plot[id=temp,smooth,domain=2:2.5,samples=30] function{1./48.*(-2*x*x*x-9*x*x+107)};
	\shorthandon{:}
	% point O
	\pgfmathsetmacro{\valX}{2};
	\pgfmathsetmacro{\valY}{1./48.*(-2*\valX*\valX*\valX-9*\valX*\valX+107)};
	\path (\valX,\valY) node[shape=coordinate] (O) {};
	\draw[blue,fill] (O) circle (0.05) node[right] {$O$};%
	% point P
	\pgfmathsetmacro{\valX}{0.3};
	\pgfmathsetmacro{\valY}{1./48.*(-2*\valX*\valX*\valX-9*\valX*\valX+107)};
	\path (\valX,\valY) node[shape=coordinate] (P) {};
	\draw[absCol] (2.25,1.65) node {$s>0$};;
	% tangente
	\pgfmathsetmacro{\valPente}{1./48.*(-6*\valX*\valX-18*\valX)};
	\pgfmathsetmacro{\invLong}{1/sqrt(\valPente*\valPente+1)};
	
	\draw[dashed,dirCol] (P) -- +($-3*\invLong*(1,\valPente)$) node[above,sloped,pos=0.7] {tangente};%
	\draw[dashed,dirCol] (P) -- +($+1.5*\invLong*(1,\valPente)$) node[above,pos=0.8] {};%
	
	\draw[dashed,dirCol] (P) -- +($-3*\invLong*(-\valPente,1)$) node[above,sloped,pos=0.7] {normale};%
	\draw[dashed,dirCol] (P) -- +($+1.5*\invLong*(-\valPente,1)$) node[above,pos=0.8] {};%
	
	\draw[->,>=latex,repCol] (P) -- +($-\invLong*(1,\valPente)$) node[above,pos=0.8] {$\vec{e}_t$};%
	\draw[->,>=latex,repCol] (P) -- +($-\invLong*(-\valPente,1)$) node[right,pos=0.8] {$\vec{e}_n$};%
	
	
	
	\draw[fill] (P) circle (0.05) node[above right] {$P$};%
	% point Q
	\pgfmathsetmacro{\valX}{2.5};
	\pgfmathsetmacro{\valY}{1./48.*(-2*\valX*\valX*\valX-9*\valX*\valX+107)};
	\path (\valX,\valY) node[shape=coordinate] (Q) {};
	\draw[gray!40] (1.6,0.5) node {$s_Q<0$};;
	\draw[gray!40,fill] (Q) circle (0.05) node[right] {$Q$};%
	% sens positif
	\shorthandoff{:}
	\draw[-,scale=1.5] plot[id=temp,smooth,domain=1:2,samples=30] function{1./48.*(-2*x*x*x-9*x*x+107)};
	\shorthandon{:}
	\pgfmathsetmacro{\valX}{1};
	\pgfmathsetmacro{\valY}{1./48.*(-2*\valX*\valX*\valX-9*\valX*\valX+107)};
	\path[scale=1.5] (\valX,\valY) node[shape=coordinate] (S) {};
	\pgfmathsetmacro{\valPente}{1./48.*(-6*\valX*\valX-18*\valX)};
	\draw[->,>=latex] (S) -- +($-0.1*(1,\valPente)$) node[above right,pos=0.8]{$+$: sens positif};%
	\draw[] (2.9,2.9) node {(choix)};;
	
\end{tikzpicture}%

\end{document}