11
$\begingroup$

Is there a continuous elementary function $f:[0,1]\to [0,\infty)$ such that for every $n$ the trapezoidal approximation to $\int_{0}^{1}f(x)\,dx$ with $n$ trapezoids is strictly better than the midpoint approximation with $n$ rectangles?

The point of this questions is that even though the midpoint approximation to an integral is generally better than the trapezoidal approximation, there is, for each $n$, a continuous function $f:[0,1]\to \mathbb{R}$ such that the trapezoidal approximation to $\int_{0}^{1}f(x)\,dx$ with $n$ trapezoids is better than the midpoint approximation with $n$ rectangles. See here for an example.

I added the restriction that $f$ be elementary so I can talk about the answer with my calculus students. I added the restriction that $f$ be non-negative for simplicity.

$\endgroup$
15
  • $\begingroup$ I can't help with your question, but I find it curious in your link the author claimed there was no antiderivitive of $\frac 1 x$. Strange. $\endgroup$
    – Alan
    Oct 6, 2014 at 15:37
  • $\begingroup$ What does the author mean when writing that "we have never come across a function whose derivative is $\frac1x$"? $\endgroup$ Oct 6, 2014 at 15:38
  • $\begingroup$ @Alan Actually he only claimed that they'd "never come across a function whose derivative is $\frac{1}{x}$". I suppose this means they've not defined the natural log yet. $\endgroup$ Oct 6, 2014 at 15:39
  • $\begingroup$ Hmm, so is it calculus limited to polynomials? Sounds like the precalculus was badly neglected in that class ;) $\endgroup$
    – MPW
    Oct 6, 2014 at 15:41
  • 2
    $\begingroup$ Here's one where at least midpoint isn't always better. In fact the choice of lowest error method fluctuates in an oscillatory way with n: f(x)=$\sqrt{|\tan(\pi x)|}$. $\endgroup$
    – SDiv
    Oct 9, 2014 at 14:58

1 Answer 1

5
$\begingroup$

Consider a function of the form $$ f(x) = \sum_{j=1}^\infty c_j \cos(2 \pi j x) $$ Then the errors $ME(n)$ and $TE(n)$ in midpoint and trapezoid rules are $$\eqalign{TE(n) &= \sum_{k=1}^\infty c_{kn} \cr ME(n) &= 2 TE(2n) - TE(n) = \sum_{k=1}^\infty (-1)^{k} c_{kn} \cr}$$ For example, let $c_j = (-1)^{d(j)} 2^{-j}$ where $d(j)$ is the $2$-adic order of $j$, i.e. $d(j) = d$ if $2^d$ divides $j$ but $2^{d+1}$ does not. Then if $d(n) = d$ we have $$ \eqalign{TE(n) &= (-1)^d \left(\sum_{k\; odd} 2^{-kn} - \sum_{k\; odd} 2^{-2kn} + \sum_{k \; odd} 2^{-4kn} + \ldots\right)\cr &= (-1)^d \left( \dfrac{2^{-n}}{1-4^{-n}} - \dfrac{2^{-2n}}{1-4^{-2n}} + \dfrac{2^{-4n}}{1-4^{-4n}} - \ldots \right)\cr } $$ while $$ ME(n) = (-1)^{d+1} \left( \dfrac{2^{-n}}{1-4^{-n}} + \dfrac{2^{-2n}}{1-4^{-2n}} - \dfrac{2^{-4n}}{1-4^{-4n}} + \ldots \right) $$ so $|ME(n)| > |TE(n)|$.

$\endgroup$
4
  • $\begingroup$ Thanks. This is great, but doesn't answer what I actually intended to ask. I've updated my question correspondingly. $\endgroup$ Oct 7, 2014 at 17:51
  • $\begingroup$ Hmm, well, it's not elementary, but it is the sum of a rapidly convergent series of elementary functions: $$ \sum_{j=0}^\infty \dfrac{(8^{2^j} - 2^{2^j}) \cos(2^{j+1} \pi x)}{16^{2^j} + 1 - 2 \cdot 4^{2^j} \cos(2^{j+2} \pi x)}$$ if I haven't made a mistake. $\endgroup$ Oct 7, 2014 at 21:49
  • $\begingroup$ Perhaps a proof exists which shows the function asked for must be fuzzy like this one in order for trapezoid to out-perform midpoint. $\endgroup$
    – SDiv
    Oct 10, 2014 at 13:46
  • $\begingroup$ What do you mean by fuzzy? $\endgroup$ Oct 12, 2014 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.