Differentiation under integration $\int_0^{\frac{\pi}{2}}\frac{\ln(1+\cos\alpha\cos x)}{\cos x}dx$ 
Question: Discuss the method of differentiation under the sign of integration. Hence evaluate following integrals: $$(i)\int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx\quad(ii)\int_0^{\frac{\pi}{2}}\frac{\ln(1+\cos\alpha\cos x)}{\cos x}dx\quad\cdots$$ 

First of all I am confused which parameter I take. Although I tried to take both parameter individually to get some intuition.
\begin{align*} 
I(b) &= \int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx \\ 
I'(b)&=\frac{d}{db}\int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx\\
I'(b)&=\int_0^{\infty}\frac{\partial}{\partial b}\left(\frac{\ln(1+a^2x^2)}{1+b^2x^2}\right)dx\\
I'(b)&=\int_0^{\infty}-\frac{2x^2b\ln \left(1+a^2x^2\right)}{\left(1+x^2b^2\right)^2}dx
\end{align*}
Now I feel I choose wrong parameter. Then try again,
\begin{align*} 
I(a) &= \int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx \\ 
I'(a)&=\frac{d}{da}\int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx\\
I'(a)&=\int_0^{\infty}\frac{\partial}{\partial a}\left(\frac{\ln(1+a^2x^2)}{1+b^2x^2}\right)dx\\
I'(a)&=\int_0^{\infty}\frac{2ax^2}{\left(1+x^2b^2\right)\left(1+a^2x^2\right)}dx
\end{align*}
Now I am frustrated and think I am missing something or didn't understand the concept.

questions:
$(1)$ Actually how to deal with them$?$
$(2)$ How to choose parameter wisely or assure that I am going right direction because after that partial derivatives those look more ugly to integrate/handle 
 and backtracking isn't possible in Exam Hall$?$
Thanks in advance and thanks for your time .

Using Nyssa's comment I tried like that: 
\begin{align*} 
I(a) &= \int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx \\ 
I'(a)&=\frac{d}{da}\int_0^{\infty}\frac{\ln(1+a^2x^2)}{1+b^2x^2}dx\\
&=\int_0^{\infty}\frac{\partial}{\partial a}\left(\frac{\ln(1+a^2x^2)}{1+b^2x^2}\right)dx\\
&=\int_0^{\infty}\frac{2ax^2}{\left(1+x^2b^2\right)\left(1+x^2a^2\right)}dx\\
&=\int_0^{\infty}\left(\frac{2a}{(a^2-b^2)(1+x^2b^2)}-\frac{2a}{(a^2-b^2)(1+x^2a^2)}\right)dx\\
&=\frac{2a}{a^2-b^2}\frac{1}{b}\arctan(bx)\bigg|_0^\infty -\frac{2a}{a^2-b^2}\frac{1}{a}\arctan(ax)\bigg|_0^\infty\\
&=\frac{\pi}{a^2-b^2}\left(\frac{a}{b}-1\right)=\frac{\pi}{(a-b)(a+b)}\frac{a-b}{b}=\frac{\pi}{b(a+b)}
\end{align*}
Now we integrate back:
\begin{align*} 
I(a)&=\frac{\pi}b\int\frac{1}{a+b}da\\
&=\frac{\pi}b\ln(a+b)+C\\
I(0)=0\implies C=-\frac{\pi}{b}\ln b \implies I(a)=\frac{\pi}{b}\ln\left(\frac{a+b}{b}\right)
\end{align*}
For $(2)$ I personally now think to choose parameter such a way that it remove $\ln,\sin^{-1}\cdots$ stuff. Please correct me If I am wrong. I put my answer as community so that anyone can edited it.
