# Evaluate $\int_{0}^{\frac{\pi}{4}} \ln(\sec x)dx$

Evaluate $$P=\int_{0}^{\frac{\pi}{4}} \ln(\sec x)dx$$

My try: I tried using its complimentary integral:

Let $$Q=\int_{0}^{\frac{\pi}{4}} \ln(\csc x)dx$$

$$P+Q=\int_{0}^{\frac{\pi}{4}}\ln(\sec x\csc x)dx$$ $$\implies$$

$$2P+2Q=\int_{0}^{\frac{\pi}{4}}\ln(\sec^2 x\csc^2 x)dx=\int_{0}^{\frac{\pi}{4}}\ln\left(\frac{4}{4\sin^2 x\cos^2 x}\right)dx$$ $$\implies$$

$$2P+2Q=\frac{\pi}{4}\ln 4-\int_{0}^{\frac{\pi}{4}}\ln\left(\sin^2 2x\right)dx$$

$$2P+2Q=\frac{\pi}{2}\ln 2-2 \int_{0}^{\frac{\pi}{4}}\ln(\sin 2x)dx$$

Using the substitution $$2x=t$$ we get

$$2P+2Q=\frac{\pi}{2}\ln 2- \int_{0}^{\frac{\pi}{2}}\ln(\sin t)dt$$

Using the formula:

$$\int_{0}^{\frac{\pi}{2}}\ln(\sin t)dt=\frac{-\pi}{2}\ln 2$$ we get

$$2P+2Q=\pi \ln 2$$

$$P+Q=\frac{\pi}{2}\ln 2$$

Is there any way to find $$P-Q$$

In fact $$\begin{eqnarray*} P-Q&=&\int_0^{\frac{\pi}{4}}\ln(\tan t)dt\\ &=&\int_0^1\frac{\ln u}{1+u^2}du\\ &=&\int_0^1\ln u\sum_{n=0}^\infty(-1)^nu^{2n}du\\ &=&\sum_{n=0}^\infty(-1)^n\int_0^1u^{2n}\ln udu\\ &=&-\sum_{n=0}^\infty(-1)^n\frac{1}{(2n+1)^2}\\ &=&-C \end{eqnarray*}$$ where $$C$$ is the Catalan constant.

Through the properties of the logarithm, the integral can be rewritten as$$\mathfrak{I}=-\int\limits_0^{\pi/4}\mathrm dx\,\log\cos x$$Now use the Fourier expansion for $$\log\cos x$$ which is

$$\log\cos x=\sum\limits_{n\geq1}\frac {(-1)^{n-1}\cos 2nx}{n}-\log 2$$

Now integrate each time termwise to get that\begin{align*}\mathfrak{I} & =\frac {\pi}4\log 2+\sum\limits_{n\geq1}\frac {(-1)^n}{n}\int\limits_0^{\pi/4}\mathrm dx\,\cos 2nx\\ & =\frac {\pi}4\log 2+\frac 12\sum\limits_{n\geq1}\frac {(-1)^n}{n^2}\sin\left(\frac {\pi n}2\right)\\ & =\frac {\pi}4\log 2-\frac 12G\end{align*}where $$G$$ is Catalan’s constant.