# Showing that the composite trapezoid rule is invariant to certain symmetry

I am trying to show that if $f$ holds certain symmetric properties than the composite trapezoid rule $$T(n) = (b-a)\frac{f(a)+f(b)}{2n} + \frac{b-a}{2} \sum_{k=1}^{n-1} f(x_k)$$ is invariant over the function. Here $x_k = a + (b-a)k/n$.

Proposition Given that $f$ is a continuous function on an interval $x\in[a,b]$ with $$f(x) + f(a+b-x)$$ Then we have

1. $T(1) = (b-a)[f(a)+f(b)]/2$

2. $\displaystyle \lim_{k \to \infty} T(k) = T(1)$

3. $T(k) = T(1) \ \forall \, k \in \mathbb{N}$

The first point is easy to show, and I think I was able to use a cheecky handwaving argument for the second \begin{align*} \lim_{n\to\infty} T(n) & = \lim_{n\to\infty} \frac{b-a}{n} \sum_{k=1}^{n-1} f\left(x_k\right) \\ & = \lim_{n\to\infty} \frac{b-a}{n} \sum_{k=1}^{(n-1)/2} f\left(x_k\right)+f(x_{n-k})\\ & = \lim_{n\to\infty} \frac{b-a}{n} \sum_{k=1}^{(n-1)/2} f(a) + f(b) \\ & = \lim_{n\to\infty} \frac{b-a}{n}\left( \frac{n-1}{2}\right)(f(a) + f(b))\\ & = (b-a)\left[\frac{f(a)+f(b)}{2}\right] \end{align*} Alas this only works if $n$ is even, otherwise you are left with a single term in the middle.. The same problem goes for 3, harder to prove when $n$ is odd. I also had some minor problems justifying why $f(x_k) +f(x_{n-k})$ is constant. Intuitively it makes sense but yeah, any help dealing with the middle term or proving this would be great.

Intuitively what it means that $f(x)+f(a+b-x)$ is constant is somewhat explained here. The question is similar to this question, but the class of functions satisfying $f(x)+f(a+b-c)$ is larger than the set of $C_{2\pi}$.

We have writing $C := f(a) + f(b)$ \begin{align*} \sum_{k=1}^{n-1} f(x_k) &= \frac 12\left( \sum_{k=1}^{n-1} f(x_k) + \sum_{k=1}^{n-1} f(x_{n-k})\right)\\ &= \frac 12 \sum_{k=1}^{n-1} \bigl(f(x_k) + f(x_{n-k})\bigr)\\ &= \frac{n-1}2 \cdot C \end{align*} Hence \begin{align*} T(n) &= \frac{b-a}{2n}\cdot C + \frac{b-a}n \cdot \frac{n-1}2 \cdot C\\ &= (b-a) \cdot C \cdot \left(\frac 1{2n} + \frac{n-1}{2n} \right)\\ &= (b-a) \cdot C \cdot \frac 12\\ &= T(1). \end{align*} This proves (3), which implies (2).