Existence of Lebesgue Integral $\int_0^\infty e^{-x}\log(\cos^2(x))$. I want to prove or disprove the (Lebesgue) integrability over $\mathbb{R}_{\geq 0}$ of
$$f(x)=e^{-x}\log(\cos^2(x))$$
From the plot there do not seem to be many problems.
But there are problems whenever $x\to (2k+1)\frac{\pi}{2}$. However, numerically, the integral seems to exist.
I thought about finding some function $g$ such that
$$|f(x)|=-f(x)\leq g(x)$$
I found one, $g(x)=\frac{e^{-x}}{|\cos x|}$ which still seems to be integrable. But it still doesn't seem to be easy to prove.
Is there any better choice? Or any better argument to prove the existence of the integral?
 A: $\int_{0}^{\pi} f(x)\; dx$ has a logarithmic singularity at $\pi/2$.  $|f(x)| \le |\log (c (x-\pi/2)^2)|$ for suitable positive constant $c$, so this is integrable.  And since $f(x+\pi) = e^{-\pi} f(x)$, 
$$ \left|\int_{0}^\infty f(x)\; dx\right| = \left|\sum_{n=0}^\infty e^{-n\pi} \int_0^\pi f(x)\; dx \right| = \frac{1}{1-e^{-\pi}} \left|\int_0^\pi f(x)\; dx \right|< \infty$$
A: We only need to show $\int_{\pi/2 - \epsilon}^{\pi/2 + \epsilon} |\log \cos ^2 x| \,dx \lt \infty$
This can be "brute forced" with Taylor series.
It's equivalent to show
 $\int_{- \epsilon}^{ \epsilon} |\log \cos ^2 (x - \pi/2)| \,dx \lt \infty$   
And by symmetry we only need
  $\int_{0}^{ \epsilon} |\log \cos ^2 (x - \pi/2)| \,dx \lt \infty$   
And then pulling out the exponent in front of the log
  $\int_{0}^{ \epsilon} |\log \cos (x - \pi/2)| \,dx \lt \infty$   
Write $g_n(x) = x^2 + ... + c_n x ^n = x^2(1 + ... + c_n x^{n-2}) = x^2 h_n(x)$, the $n$ term power series of $\cos(x - \pi/2)$ about $x = 0$. This series converges uniformly on the compact interval $-\epsilon, \epsilon$ and is basically a parabola $x^2$ in the region of interest.
We can then write
 $ \int_{0}^{ \epsilon} |\log x^2 h_n(x)| \,dx \lt $
 $ 2 \int_{0}^{ \epsilon} |\log x |\, dx + \int_0 ^\epsilon\log| h_n(x)| \,dx $
The first term is finite. We can choose $\epsilon$ small enough and $n$ large enough so that $1/2 \lt h_n(x) \lt 3/2$ uniformly in $n$ since $h_n(x) $ converges uniformly to $\frac{\cos(x - \pi/2)}{x^2}$. So then the second term is bounded from above. So we have a bound $M$ which works uniformly in $n$.
$ \int_{0}^{ \epsilon} |\log x^2 h_n(x)| \,dx \lt M$ 
Take the limit on the left hand side to finish.
