approximation

../_images/sphx_glr_approximation.svg
\documentclass[]{standalone}
 
\usepackage[]{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\tikzset{>=latex}
\usetikzlibrary{arrows,arrows.meta}
\usepackage{steinmetz}
\newcommand*{\equal}{=}
\usepackage{subcaption}

\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=7cm,height=7cm,
    xmin=-2.5,xmax=2.5,
    ymin=-1,ymax=1,
    grid=both,
    major grid style={line width=.3pt,draw=gray!70},
    axis lines=middle,
    enlargelimits={abs=0.1},
    ticklabel style={font=\tiny},
    xlabel={$x$},
    ylabel={$y$},
    xlabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=north},
    ylabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=west},
    legend style={at={(1,0.2)}, nodes={scale=0.8, transform shape}},
    legend cell align={left},    
    title={$\sin{x} \simeq x,\   (x\to 0)$},
    ]
    \draw (axis cs:0,0) node[above=4pt,left=0pt] {\tiny$0$};
    \addplot[domain=-1:1,samples=2, red,very thick] {x};        
    \addplot[domain=-2.5:2.5,samples=100, ] {sin(x r)};    
    \legend{$y=x$,$y=\sin x $};
  \end{axis}
 \end{tikzpicture} 
\hspace{1cm}
 \begin{tikzpicture}
  \begin{axis}[
    width=7cm,height=7cm,
    xmin=-2.5,xmax=1,
    ymin=-1,ymax=1.5,
    grid=both,
    major grid style={line width=.3pt,draw=gray!70},
    axis lines=middle,
    enlargelimits={abs=0.2},
    ticklabel style={font=\tiny},
    xlabel={$x$},
    ylabel={$y$},
    xlabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=north},
    ylabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=west},
    legend cell align={left},    
    legend style={at={(0.45,1)}, nodes={scale=0.8, transform shape}},    
    title={$e^x - 1 \simeq x,\   (x\to 0)$},    
    ]
    \draw (axis cs:0,0) node[above=4pt,left=0pt] {\tiny$0$};
    \addplot[domain=-1:1,samples=2, red,very thick] {x};        
    \addplot[domain=-2.5:2.5,samples=100, ] {exp(x)-1};
    \legend{$\footnotesize{y=x}$,$\footnotesize{y=e^x -1}$}
  \end{axis}
 \end{tikzpicture} 
\hspace{1cm}
 \begin{tikzpicture}
  \begin{axis}[
    width=7cm,height=7cm,
    xmin=-1,xmax=2,
    ymin=-2,ymax=2,
    grid=both,
    major grid style={line width=.3pt,draw=gray!70},
    axis lines=middle,
    enlargelimits={abs=0.2},
    ticklabel style={font=\tiny},
    xlabel={$x$},
    ylabel={$y$},
    xlabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=north},
    ylabel style={font=\tiny, at={(ticklabel* cs:1)},anchor=west},
    legend cell align={left},    
    legend style={at={(1,0.2)}, nodes={scale=0.8, transform shape}},    
    title={$\log(x+1) \simeq x,\   (x\to 0)$},    
    ]
    \draw (axis cs:0,0) node[above=4pt,left=0pt] {\tiny$0$};
    \addplot[domain=-1:1,samples=2, red,very thick] {x};        
    \addplot[domain=-1:2.5,samples=100, ] {ln(x+1)};
    \legend{$y=x$,$y=\log(x+1)$}
  \end{axis}
 \end{tikzpicture} 


\end{document}