definite integral involving logarithm

i am facing trouble with the following question

Evaluate-

$$\int_0^\frac{\pi}{2}\ln(\sin^2a+k^2\cos^2a)da$$

My attempt- I broke the $\ln(\sin^2a+k^2\cos^2a) \rightarrow 2\ln(\cos a)+\ln(1+k^2\tan^2 a)$. Then I could easily evaluate the 1st integral and for the second integral I tried to subsitute $\ln(1+k^2\tan^2a)$ as t which reduced the integral to $$\int_q^\infty\frac{te^tdt}{2tanasec^2a}dt$$ where q is $2\ln k$. I couldnot however proceed from here.Ideas.thanks.

It is pretty well known (and not difficult to prove) that $\int_{0}^{\pi/2}\log\tan(x)\,dx = 0$, hence the problem boils down to computing $$I(k) = \int_{0}^{\pi/2}\log(k^2+\tan^2 x)\,dx = \int_{0}^{+\infty}\frac{\log(k^2+t^2)}{1+t^2}\,dt \tag{1}$$ and by differentiation under the integral sign we have $$I'(k) = \int_{0}^{+\infty}\frac{2k\,dt}{(k^2+t^2)(1+t^2)}=\frac{\pi}{|k|+1}\tag{2}$$ so, since $I(0)=0$, $$I(k) = \color{red}{\pi\log(|k|+1)}.\tag{3}$$