Determining an upper bound I have a function $$f(\lambda)=n\ln(1-p+pe^{\frac{\lambda}{n}})-\lambda p$$
I need to prove that $$f(\lambda)\leq \frac{\lambda^2}{8n}$$ using Taylor expansion.
I have used the taylor expansion for a function of the form $\ln(1-x)=-x-\frac{x^2}{2}-\frac{x^3}{3}-\dots$
Therefore: $f(\lambda)=n\ln[1-p+pe^{\frac{\lambda}{n}}]-\lambda p=n[-p+pe^{\frac{\lambda}{n}}+(p-p^2)e^{\frac{\lambda}{n}}+\frac{1}{2}e^{{2\lambda}{n}}-\dots]-\lambda p$
Not sure how to go on from here.

$$f'(\lambda) = \frac{pe^{\frac{\lambda}{n}}}{1-p+pe^{\frac{\lambda}{n}}}$$
$$f''(\lambda) = \frac{\frac{1}{n}(1-p)pe^{\frac{\lambda}{n}}}{(1-p+pe^{\frac{\lambda}{n}})^2}$$
$$f'''(\lambda) = \frac{1}{n}(1-p)p \frac{\frac{1}{n}e^{\frac{\lambda}{n}}(1-p -pe^{\frac{\lambda}{n}})}{(1-p+pe^{\frac{\lambda}{n}})^3}$$
Use GM-AM inequality,
$$ f''(\lambda) \le \frac{1}{n} \frac{1}{4} = \frac{1}{4n}$$
Then $$ f(\lambda) = f(0) + f'(0)\lambda +\frac{1}{2}f''(\eta)(\lambda)^2  - p\lambda$$
$$\le \frac{1}{2}f''(\eta)(\lambda)^2 = \frac {\lambda^2}{8n}$$
Here $0 \le \eta \le \lambda$.
QED
