polynomials

../_images/sphx_glr_polynomials.svg
\documentclass[]{standalone}

\usepackage[]{graphicx}

\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\tikzset{>=latex}
\usetikzlibrary{arrows,arrows.meta}
\usepackage{steinmetz}
\newcommand*{\equal}{=}

\usepackage{tikz-3dplot}
\usetikzlibrary{decorations.markings}

\tikzset{->-/.style={decoration={
  markings,
  mark=at position #1 with {\arrow{>}}},postaction={decorate}}}

\begin{document}
    \begin{tikzpicture}
    \begin{axis}[
    width=10cm,
    xmin=-5,xmax=5,
    ymin=-5,ymax=5,
    grid=both,
    %grid style={line width=.1pt, draw=gray!10},
    major grid style={line width=.2pt,draw=gray!50},
    axis lines=middle,
    %minor tick num=5,
    xtick = {-5,-4,-3,-2,-1,0,1,2,3,4,5},
    ytick = {-5,-4,-3,-2,-1,0,1,2,3,4,5},
    enlargelimits={abs=0.5},
    %axis line style={latex-latex},
    %ticklabel style={font=\tiny,fill=white},
    ticklabel style={font=\tiny},
    xlabel={$x$},
    ylabel={$f(x)$},
    xlabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=north},
    ylabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=west},
    ]
    \draw (axis cs:0,0) node[below=3pt,right=-3pt] {\tiny$0$};
    \addplot[domain=-2.7:2.7,samples=10] {2*x} node[below=5pt,right]{$2x$};
    \addplot[domain=-5:5,samples=10] {x/2} node[below]{$x/2$};
    \addplot[domain=-2.5:2.5,samples=100]  {x^2} node[very near start ,above right]{$x^2$};
    %\addplot[domain=-5:5,samples=100]  {-(x-2)^2} node[very near start,right]{$-(x-2)^2$};  
    %\addplot[domain=0:5,samples=100]  {8*x/(x+1)^2} node[very near end,below]{$\frac{8x}{(x+1)^2}$};    
    \end{axis}
    \end{tikzpicture}    

\end{document}