I have difficulty with the following question:

My understanding is that I can partially differentiate the integral with respect to any parameter (in this case, a or b) to obtain a derivate of the initial function.
My problem is that when I partially differentiate the integral with respect to a or b, I obtain the following:

I am unsure how I could obtain anything useful by evaluating either integrals (and then integrating that result to obtain $g(x)$). Any help would be much appreciated.
I only show you how to calculate the integral $I_1$. The second one is quite similar.
Start with $$\frac\pi {\sqrt{a^2-b^2}}=\int_0^\pi \frac {dx}{a+b \cos x}.$$
Differentiating twice with respect to $a$ you get $$\frac {2a^2+b^2}{(a^2-b^2)^{5/2}} \pi = \frac {\partial^2}{\partial a^2} \frac\pi {\sqrt{a^2-b^2}} =\frac {\partial^2}{\partial a^2} \int_0^\pi \frac {dx}{a+b \cos x}\\ = \int_0^\pi \frac {\partial^2}{\partial a^2}\frac {dx}{a+b \cos x} =2 \int_0^\pi \frac{dx}{(a+b \cos x)^3}.$$
Evaluating at $a=5, b=3$ and dividing by $2$ should give the desired result.