Find the average value of the function $f(x)=1+x^2$ on the interval $[-1,2]$.
With $a=-1$ and $b=2$ we have
$$
\begin{aligned}
f_{\text {ave }} & =\frac{1}{b-a} \int_a^b f(x) d x=\frac{1}{2-(-1)} \int_{-1}^2\left(1+x^2\right) d x \\
& =\frac{1}{3}\left[x+\frac{x^3}{3}\right]_{-1}^2=2
\end{aligned}
$$