(Motivation) In an attempt to answer this question, I have stumbled upon a contour integral I currently am having trouble with. For context, I am trying to prove
$$\operatorname{P.V.}\int_{0}^{\pi}\tan\left(x\right)\ln\left(\cos^{2}\left(x\right)\right)dx = 0.$$
(Attempt) Let $f(z) = \tan\left(z\right)\ln\left(\cos^{2}\left(z\right)\right)$ and define a contour $C = [0,\pi/2 - \epsilon] \cup \psi \cup [\pi/2+\epsilon, \pi] \cup [\pi, \pi + ib] \cup [\pi + ib, ib] \cup [ib, 0]$ that we will traverse counterclockwise around. Suppose $\epsilon > 0$ is small, $b>\epsilon$, and $\psi$ is the indented semi-circular path enclosing $z=\pi/2$ with a radius of $\epsilon$.
By Cauchy's Residue Theorem, we write $\displaystyle \oint_{C} f(z)dz$ as
$$ \eqalign{ 0 &= \int_{0}^{\pi/2 - \epsilon}f(z)dz + \int_{\psi}f(z)dz + \int_{\pi/2 + \epsilon}^{\pi}f(z)dz + \int_{\pi}^{\pi+ib}f(z)dz + \int_{\pi+ib}^{ib}f(z)dz+\int_{ib}^{0}f(z)dz \cr \operatorname{P.V.}\int_{0}^{\pi}f(z)dz &= \lim_{\epsilon \to 0}\int_{-\psi}f(z)dz + \int_{0}^{ib}f(z)dz - \int_{\pi}^{\pi+ib}f(z)dz + \int_{ib}^{\pi+ib}f(z)dz. } $$
After a bit of struggling, I was able to evaluate $\displaystyle \int_{0}^{ib}f(z)dz$, $\displaystyle\int_{\pi}^{\pi+ib}f(z)dz$, and $\displaystyle\int_{ib}^{\pi+ib}f(z)dz$. However, this next part is something I am skeptical about:
$$ \eqalign{ \int_{-\psi}\tan\left(z\right)\ln\left(\cos^{2}\left(z\right)\right)dz &= \int_{0}^{\pi}\tan\left(\frac{\pi}{2}+\epsilon e^{i\theta}\right)\ln\left(\cos^{2}\left(\frac{\pi}{2}+\epsilon e^{i\theta}\right)\right)d\left(\frac{\pi}{2}+\epsilon e^{i\theta}\right) \cr &= \int_{0}^{\pi}-\epsilon ie^{i\theta}\cot\left(\epsilon e^{i\theta}\right)\ln\left(\sin^{2}\left(\epsilon e^{i\theta}\right)\right)d\theta \cr &= \int_{-\epsilon}^{\epsilon}\cot\left(u\right)\ln\left(\sin^{2}\left(u\right)\right)du \cr } $$ which approaches $0$ as $\epsilon \to 0$.
(Question) Is it true that $\displaystyle \lim_{\epsilon \to 0}\int_{-\epsilon}^{\epsilon}\cot\left(u\right)\ln\left(\sin^{2}\left(u\right)\right)du = 0$?
I understand that might seem like a silly question given the fact that most of my answers on this website are integration-related, so one would think I would find that question trivial. I understand the Cauchy Principal Value of $\displaystyle \int_{-\epsilon}^{\epsilon}\cot\left(u\right)\ln\left(\sin^{2}\left(u\right)\right)du$ equals $0$, but here, it seems like I am taking the limit of it instead. In the case of Riemann integration (i.e. $f$ is bounded), I know $\displaystyle \int_{-a}^{a}f(x)dx = 0$ is valid for integrable functions, at least when motivated by the interpretation of integration as area, for $f(a)$ being defined. (Might be irrelevant, but this is what WA says.) Still, I don't know if the same applies in my case.
I want to say my attempt is flawed. In general, the integral $\displaystyle \int_a^b f(x)dx$ is defined when $[a,b]$ lives in the domain of the definition of $f$. If so, it is $0$ when $a=b$. But for any $\epsilon > 0$, obviously $0 \in [-\epsilon, \epsilon]$, and $\cot\left(0\right)\ln\left(\sin^{2}\left(0\right)\right)$ is undefined.
For context, my background in analysis consists of an undergraduate, upper-division real analysis course, and a complex analysis course. If I missed anything trivial, please let me know. Any comment/answer shedding some light is appreciated.