Let be $t\in \mathbb{R}$, $n=1,2,\cdots $, $p\in [0,1]$ and $a\in (p,1]$.

Show that

$\underset{t}{sup}(ta-\mathrm{log}(p{e}^{t}+(1-p))=a\mathrm{log}\left(\frac{a}{p}\right)+(1-a)\mathrm{log}\left(\frac{1-a}{1-p}\right)$

So, I've try to derivate, but I did'nt get sucess, since my result is different. I've get $\mathrm{log}\left(\frac{a(1-p)}{p(1-a)}\right)$. Any ideas?

Show that

$\underset{t}{sup}(ta-\mathrm{log}(p{e}^{t}+(1-p))=a\mathrm{log}\left(\frac{a}{p}\right)+(1-a)\mathrm{log}\left(\frac{1-a}{1-p}\right)$

So, I've try to derivate, but I did'nt get sucess, since my result is different. I've get $\mathrm{log}\left(\frac{a(1-p)}{p(1-a)}\right)$. Any ideas?