I have this code:
\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{animate}
\usepackage{calc}
\usepackage{fp}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{arrows}
\newcommand*{\xMin}{0}%
\newcommand*{\xMax}{20}%
\newcommand*{\yMin}{0}%
\newcommand*{\yMax}{10}%
\begin{document}
\begin{tikzpicture}[scale=1.5]
\foreach \i in {\xMin,...,\xMax} {
\draw [very thin,gray] (\i,\yMin) -- (\i,\yMax) node [below] at (\i,\yMin) {$\i$};
}
\foreach \i in {\yMin,...,\yMax} {
\draw [very thin,gray] (\xMin,\i) -- (\xMax,\i) node [left] at (\xMin,\i) {$\i$};
}
\draw[->, thick] (0,0)--(20,0) node[right] (X) {x};
\draw[->, thick] (0,0)--(0,10) node[above] (Y) {y};
\end{tikzpicture}
\end{document}
Trouble: I don't know a) how to create the curves and b) how to make the animation.
It should look like this at the end: https://en.wikipedia.org/wiki/Simpson%27s_rule#/media/File:Simpsonsrule2.gif
Hopefully you can help me. I know it is a major project, but I am stucked. If I get some help, I would maybe be able to write more code, but right now I am stucked.
Thank you so much in advance.

