
\definecolor{gris}{rgb}{0.4,0.4,0.4}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
ymajorgrids=true,
xmajorgrids=true,
xmin=-3.5,
xmax=8.5,
ymin=-2.5,
ymax=4.5,
xtick={-4,-3,...,9},
ytick={-2,-1,...,5},]
\clip(-4.5,-2.5) rectangle (9.5,5.5);
     % courbe par contraintes manuelles 
\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=-3.0:-1.0),color=gris] plot (\x,{(0.06*(\x)^3+0.55*(\x)^2+-0.08*(\x)+0.43)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=-1.0:2.0),color=gris] plot (\x,{(0.03704*(\x)^3+0.11111*(\x)^2+-0.88889*(\x)+0.03704)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=2.0:5.0),color=gris] plot (\x,{(0.01481*(\x)^3+-0.02222*(\x)^2+-0.08889*(\x)+-0.85185)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=5.0:8.0),color=gris] plot (\x,{(-0.02222*(\x)^3+0.46667*(\x)^2+-2.2*(\x)+2.11111)/1.0}););

\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=-3.0:-1.0)] plot (\x,{(0.5275*(\x)^3+3.1075*(\x)^2+5.5725*(\x)+3.9925)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=-1.0:2.0)] plot (\x,{(-0.0437*(\x)^3+-0.09111*(\x)^2+0.88889*(\x)+1.9363)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=2.0:5.0)] plot (\x,{(-0.05556*(\x)^3+0.16667*(\x)^2+-0.0*(\x)+2.77778)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=5.0:6.52)] plot (\x,{(0.04556*(\x)^3+0.03508*(\x)^2+-6.26786*(\x)+24.76719)/1.0}););\draw [samples=50,rotate around={0.:(0.,0.)},xshift=0.cm,yshift=0.cm,line width=0.5pt,domain=6.52:8.0)] plot (\x,{(-0.30847*(\x)^3+7.39418*(\x)^2+-57.08041*(\x)+141.35297)/1.0}););

\draw [color=black] (-3.,4.)-- ++(-1.5pt,0 pt) -- ++(3.0pt,0 pt) ++(-1.5pt,-1.5pt) -- ++(0 pt,3.0pt);
\draw [color=black] (8.,3.)-- ++(-1.5pt,0 pt) -- ++(3.0pt,0 pt) ++(-1.5pt,-1.5pt) -- ++(0 pt,3.0pt);
\draw [color=black] (8.02,0.)-- ++(-1.5pt,0 pt) -- ++(3.0pt,0 pt) ++(-1.5pt,-1.5pt) -- ++(0 pt,3.0pt);
\draw [color=black] (-3.,1.)-- ++(-1.5pt,0 pt) -- ++(3.0pt,0 pt) ++(-1.5pt,-1.5pt) -- ++(0 pt,3.0pt);

\draw[color=gris] (-2,4) node {$y=f(x)$};
\draw[color=black] (-2.5,0.5) node {$y=g(x)$};
\end{axis}
\end{tikzpicture}