« home

Concave Functions

Tags

mathphysicsstatistical physics

$x \ln(x)$ is convex and $x - 1$ is its tangent, so $x \ln(x) \geq x - 1 \enskip \forall x$.


Concave Functions

  Edit

Overleaf Logo Open in Overleaf

  Download

PNG PNG (HD) PDF SVG TeX

  Code

concave-functions.tex (27 lines)

\documentclass{standalone}

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
  \begin{axis}[
      domain=0:1,
      xlabel=$x$,
      smooth,
      thick,
      axis lines=left,
      every tick/.style={thick},
      legend style={cells={anchor=west}},
      legend pos=north west]

    \addplot[color=blue]{x};

    \addplot[color=red]{-x*ln(x)};

    \legend{$x$,$-x \, \ln(x)$}

  \end{axis}
\end{tikzpicture}
\end{document}