How do we show that $x+\frac{i\log(\cos(ax))}{a}$ is equal to $\frac{i\log(1+e^{-2iax})}{a}$, or differ by a constant ?
I got these two different expressions while integrating $e^{-iax}\sec(ax)$, using Wolfram Alpha. Check this and this.
Should I expand the second expression using the formula for $\log(1+x)$? I'm not very sure. Any hint will do.
$$\log(\cos(ax))=\log\left(\frac{e^{iax}+e^{-iax}}{2}\right)\\=\log(e^{iax}(1+e^{-2iax}))-\log2\\=\log(e^{iax})+\log(1+e^{-2iax})-\log 2\\=iax+\log(1+e^{-2iax})-\log 2$$