I am trying to prove an idientity I have come accross in a book:

$\displaystyle \log\left(\log t-\log\log t+O\left(\frac{\log\log t}{\log t}\right)\right)=\log\log t-\frac{\log\log t}{\log t}-\frac{1}{2}\left(\frac{\log\log t}{\log t}\right)^{2}+O\left(\frac{\log\log t}{\left(\log t\right)^{2}}\right)$

I have managed to prove,

$\displaystyle \log\left(\log t+O\left(\log\log t\right)\right)=\log\log t+O\left(\frac{\log\log t}{\log t}\right)$

using various facts such as

- $\displaystyle O\left(O\left(f\left(z\right)\right)\right)=O\left (f\left(z\right)\right)$,
- $\displaystyle g\left(z\right)O\left(f\left(z\right)\right)=O(g(z )f(z))$
- and $\displaystyle \log z=O\left(z\right)$.

But I can't prove the above more difficult identity. Can anyone help me with this?

Thanks for reading.