# Integrals depending on a parameter: $\int_{0}^{\pi/2} \ln(a^2\sin^2{x} + \cos^2{x})dx$

I'm trying to calculate this integral: $$\int_{0}^{\pi/2} \ln(a^2\sin^2{x} + \cos^2{x})dx$$ For $$a > 0$$.

This is what I did:
$$I(a) = \int_{0}^{\pi/2} \ln(a^2\sin^2{x} + \cos^2{x})dx \\\ I'(a) = \int_{0}^{\pi/2} \frac{2a\sin^2{x}}{(a^2\sin^2{x} + \cos^2{x})} dx \\\ I'(a) = \int_{0}^{\pi/2} \frac{2a}{(a^2 + \frac{\cos^2{x}}{\sin^2{x}})} dx \\\ I'(a) = 2a \int_{0}^{\pi/2} \frac{1}{a^2 + \cot^2{x}}dx \\\ I'(a) = \frac{2}{a} \int_{0}^{\pi/2} \frac{1}{1 + \frac{\cot^2{x}}{a^2}}dx$$ Here I tried to substitude $$\frac{\cot^2{x}}{a^2} = t$$. This should lead me to $$\arctan(something)$$ (I write $$\arctan{x} = \tan^{-1}{x}$$.)
But I got stuck.

After I get the derivative I should integrate it back to get $$I(a)$$. Also there are steps that need some prepositions to be checked. Could one help me with this integral and also to clarify the steps that need special attention; such as the second step, where I can get the derivative $$I'(a)$$ only if the function under the integral can be differentiated? It must be possible to find its derivative.

Note that, under $$\cot x\to x$$, $$\begin{eqnarray*} I'(a)& = &2a \int_{0}^{\pi/2} \frac{1}{a^2 + \cot^2{x}}dx\\ &=&2a\int_0^\infty\frac{1}{(a^2+x^2)(1+x^2)}dx\\ &=&\frac{2a}{1-a^2}\int_0^\infty\bigg(\frac{1}{a^2+x^2}-\frac{1}{1+x^2}\bigg)dx &=&\frac{\pi}{1+a}. \end{eqnarray*}$$ which can be easily handled. So $$I(1)-I(a)=\int_a^1\frac{\pi}{1+t}dt=\pi(\ln2-\ln(1+a))$$ and hence $$I(a)=-\pi\ln2+\pi\ln(1+a)=\pi\ln\frac{1+a}{2}.$$ since $$I(1)=0$$.

• Thank you.Only, I do not understand how you got $I(0) = 2 \int_{0}^{\frac{\pi}{2}} \ln{\cos{x}} dx$ to be $-\pi \ln2$. I did get the same resoult after calculating $I(a) = \pi \ln{(1+a)} + C$ and $I(1) = 0$. Could you explain a little further how you calculated this integal? – Coupeau Jan 18 '19 at 20:00
• Yes, it will be better if using $I(1)=0$. – xpaul Jan 18 '19 at 20:23

you can also use the series of $$\ln x$$ to find it

\begin{aligned} \int_{0}^{\pi/2} \ln(a^2\sin^2{x} + \cos^2{x}) \mathrm{d}x & = \int_{0}^{\pi/2} \ln(1+(a^2-1)\sin^2{x}) \mathrm{d}x\\ & = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n} \int_{0}^{\pi/2}(a^2-1)^n\sin^{2n}{x} \mathrm{d}x\\ & = \pi \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{2n} \frac{(2n-1)!!}{(2n)!!} (a^2-1)^n \end{aligned}

where you need wallis' integral here, then using this identity

$$\operatorname{arsinh} x = \ln(2x) + \sum\limits_{n = 1}^\infty {\left( { - 1} \right)^{n - 1} \frac{{\left( {2n - 1} \right)!!}}{{2n\left( {2n} \right)!!}}} \frac{1}{{x^{2n} }}$$

let $$x=1/\sqrt{a^2-1}$$ and you will find the answer

$$\int_{0}^{\pi/2} \ln(a^2\sin^2{x} + \cos^2{x}) \mathrm{d}x = \pi\left( \operatorname{arsinh} \frac1{\sqrt{a^2-1}} - \ln\frac2{\sqrt{a^2-1}} \right) = \pi\ln\frac{a+1}{2}$$