TITLE: is the following a decreasing function?
QUESTION [8 upvotes]: I am stuck on figuring out why the following function is a decreasing function when I read a paper. The function is following 
$$f(x)=-\frac{1}{x}\log[{pe^{-ax}+(1-p)e^{-bx}}]$$ 
where $a$ and $b$ are two arbitrary non-zero constants (can be negative or positive), but $a$ is not equal to $b$ and $p \in(0,1)$. 
I am stuck on figuring out why $f(x)$ is globally decreasing in $x \in R$ for any choice of $a, b$.
I find the first derivative as follows, for any  $a, b$.
$$f'(x)=\frac{1}{x^2}\log[{pe^{-ax}+(1-p)e^{-bx}}]+\frac{1}{x}\frac{ape^{-ax}+b(1-p)e^{-bx}}{{pe^{-ax}+(1-p)e^{-bx}}}$$ 
But then I get stuck, how to show it's negative for all $x \in R$? I use mathematica to  plot this function, and it is indeed decreasing in $x$, but I can't proceed further on how to show this analytically
Any hint or help is extremely appreciated!
Edited: To make thing more interesting..in fact I am considering the case $a$ is not equal to $b$ and $p$ is interior in (0,1)..

REPLY [4 votes]: This answer is added to the others mainly because its methods are different, and (at least to me) make the argument less involved. Working with the derivative of the original function is difficult because of the presence of a log term added to a rational term.  I hope that someone finds this approach interesting, if only as a variant one.
First note that, since we wish to show the inequality of the OP holds for all real $a \neq b$, we'll use $a,b$ rather than the $-a,-b$ in front of the $x$ in the two exponentials. We will also drop the initial minus sign in front of the whole function, and then the OP function is decreasing iff our altered function is increasing. These adjustments just make the algebra go smoother and don't affect the argument.
Let $f(x)$ be denoted referring to its parameters as 
$$f(p,a,b,x)=\frac{1}{x} \log(p e^{ax}+(1-p)e^{bx}).$$ 
Note that then $f(p,a,b,x)=f(1-p,b,a,x).$ Thus we may assume that $a>b$ since if this is not so we may replace $p$ by $1-p$ and interchange the letters $a,b.$  Let $k=a-b>0.$ Then $a=b+k$ and using $e^{ax}=e^{bx}e^{kx}$ we arrive at a form similar to that used in other posts:
$$f(x)=b+ \frac{1}{x} \log(pe^{kx}+1-p).$$
Now let $t=kx$ and note that since $k>0$ we have $t$ increases with $x$, and then from the above, after dropping the initial added constant $b$ and rewriting the initial fraction as $k\cdot \frac{1}{kx},$ and  also dropping the initial positive factor $k$, we see that $f(x)$ will be  increasing iff $g(t)$ is increasing, where
$$g(t)=\frac{1}{t} \log(p e^t +1-p).$$
[Note that in the parameter notation this is $f(p,1,0,t)$, so that so far we've just reduced the problem to a particular case.]
Note that as it stands $g(0)$ is not defined; however L'Hopital shows the limit as $t \to 0$ of $g(t)$ is the parameter $p$. And note also for later that $g$ is analytic on $\mathbb{R} \setminus \{ 0 \} .$
Now $g(t)$ has the properties that $0 < g(t) < 1$ and that $g(t) \to 0$ as $t \to -\infty$ and $g(t) \to 1$ as $t \to \infty.$ These properties are simple to show, and I'll add details if anyone asks. In particular the range of $g$ is the open interval $(0,1).$
MAIN CLAIM: $g'(t) \ge 0$ for all $t.$ 
Otherwise choose a fixed $t_1$ at which $g'(t_1)<0.$ Then one can choose points $a,b$ near $t_1$ for which $a<t_1<b$ and also $f(a)>f(t_1)>f(b).$ Now since $g$ is continuous on $(-\infty,a]$ and goes to $0$ at $-\infty$, there is by the intermediate value theorem some point $t_0<a$ for which $g(t_0)=g(t_1).$ Similarly, since $g$ goes to $1$ at $+\infty$  there is some point $t_2>b$ for which $g(t_2)=g(t_1).$ So from the assumption that $g'(t_1)<0$, we have produced three points $t_0<t_1<t_2$ at each of which $g$ has the same value, say $a$, i.e.
$$g(t_0)=g(t_1)=g(t_2)=a.$$
Now assuming $t\neq 0$ we may take the equation $g(t)=a,$ multiply through by $t$ and expontiate, and obtain the equivalent equation $w(t)=0$ where
$$w(t)=pe^t+1-p-e^{at}.$$
Note that if $t=0$ then $w(0)=0$ holds no matter what the values of $p,a$ are. From the above, viewing $a$ as the constant common value of the $g(t_j),$  we see that $w(t)=a$ has the three distinct solutions $t_0<t_1<t_2$. So by Rolle's theorem there are two distinct values $t_a,t_b$, one in each open interval $(t_0,t_1)$ and $(t_1,t_2)$, where $w'(t_a)=w'(t_b)=0.$ But calculating $w'$ gives 
$$w'(t)=pe^t-ae^{at}$$
so that $w'(t)=0$ implies $pe^t=ae^{at}$, then $e^{t-at}=a/p$, so that $e^{(1-a)t}=a/p$ which has only one solution, since the constant $1-a$ is not zero (recall $0<a<1$). Thus $w'(t)=0$ does not have two distinct solutions, contradicting the two solutions guaranteed above using Rolle's theorem. This completes our argument for the main claim.
Now that we know $f'(t)\ge 0$ it only remains to show that in fact $f$ is strictly increasing. But this follows from $f' \ge 0$ by the fact that $f$ is analytic except at $0$, because an analytic nonconstant function cannot be zero at every point in an open interval.