Sums of harmonic means

means

This is my first post, so go easy on me if I've made some mistakes. I'm also not a mathematician, but rather an experimental physicist.

Basically, I have a problem where I need to take the mean of a function given by a sum of two terms, $f(x) = A(x) + B(x)$, and I'm wondering if it makes sense to first take the mean of each term and then sum them, $ \left\langle A(x) \right\rangle + \left\langle B(x) \right\rangle$, or whether I have to take the mean of the entire function, $ \left\langle f(x) \right\rangle$. I get two different results, so I'm guessing one is correct and the other isn't, but I don't understand why that is.

The problem is that the $A(x)$-term does not converge when I try and take the arithmetic mean, so I have to take the harmonic mean of that term instead:

$$ f(x) = \Bigl[ \cos^2 \Bigl( \frac{\pi x}{L}-\frac{\pi}{2} \Bigr) \Bigr]^{-1} + B(x)$$

The second term, $B(x)$, can in principle be any function, so it could be that in certain cases I won't be able to take the arithmetic mean of that term; however, in my case it's simply a constant, $B$:

$$ f(x) = \Bigl[ \cos^2 \Bigl( \frac{\pi x}{L}-\frac{\pi}{2} \Bigr) \Bigr]^{-1} + B$$

When I now take the arithmetic mean of $f(x)$ I get,

$$ \left\langle f \right\rangle = \frac {1}{L^{-1} \int_0^L f^{-1} dx}$$

$$ \left\langle f \right\rangle = \Bigl( \frac{1}{2}-\frac{1}{B} \Bigr)^{-1}$$

However, had I taken the mean of each term and then added them together, $ \left\langle A(x) \right\rangle + \left\langle B(x) \right\rangle$, I will get,

$$ \left\langle A(x) \right\rangle + \left\langle B(x) \right\rangle = 2 + B $$

I'm a bit confused about that. As far as what I understand for means, I should be able to do both and get the same result, no? So why is,

$$ \left\langle f \right\rangle \neq \left\langle A(x) \right\rangle + \left\langle B(x) \right\rangle$$

Am I doing something wrong here? Or is this a property of harmonic means?

Any help would be much appreciated,

Jason

Best Answer

Let's take a simple example to show that the harmonic means do not work this way.

Suppose we have $A$ taking equally common distinct positive values $a_1$ and $a_2$ with arithmetic mean $\frac{a_1+a_2}{2}$ and harmonic mean $\frac{2a_1a_2}{a_1+a_2}$, and $B$ being the positive constant $b$.

Now consider the difference between sum of the harmonic means of $A$ and $B$ and the harmonic mean of the sum of $A$ and $B$. This is $$\left(\frac{2a_1a_2}{a_1+a_2} +b\right) - \frac{2(a_1+b)(a_2+b)}{(a_1+b)+(a_2+b)} \\= -\frac{(a_1-a_2)^2b}{(a_1+a_2)(a_1+a_2+2b)}$$ which is negative rather than $0$.

Related Question