I was trying a past paper from http://www.abacus.utwente.nl/tentamens/M%20-%20Stochastic%20Processes/1a%20-%20Stochastic%20Processes%20Februari%202007.pdf
Hint: Use the fact that $p \log (1 + x) + q \log (1 − x)$ is maximized when $x = p − q$.
Secondly it was written: Let $f : (-1,1) \rightarrow \mathbb{R} : x \mapsto p\log (1+x) + q \log (1-x).$ Then using the hint above, $f$ is maximised at $p-q$ and $f(p-q) = \log 2 + p\log p + q\log q.$
My first question is, how (possibly using analysis/calculus?) would you deduce/get that $p \log (1 + x) + q \log (1 − x)$ is maximized when $x = p − q?$
The other thing, I have trouble understanding what exactly does $f : (-1,1)$ mean? And how would I intepret/read the following line? Its a bit new to me as I have not seen functions written like the following before. $f : (-1,1) \rightarrow \mathbb{R} : x \mapsto p\log (1+x) + q \log (1-x).$
Lastly, it says that $f$ is maximised at $p-q$ and $f(p-q) = \log 2 + p\log p + q\log q.$ How do you get that $f(p-q) = \log 2 + p\log p + q\log q?$ I tried substituting it into $f(x)=p\log (1+x) + q \log (1-x)$, getting $f(p-q) = p\log(1+p-q) + q\log(1-p+q). $ How would I go about from there?