Differentiation uner the integral sign - help me find my mistake This is my integral:
$$I(a)=\int_0^\infty\frac {\ln(a^2+x^2)}{(b^2+x^2)}dx.$$
Taking the first derivative with respect to a:
$$I'(a)=\int_0^\infty \frac {2adx} {(a^2+x^2)(b^2+x^2)}.$$
This is how I did the partial fraction decomposition:
$\frac {2a} {(a^2+x^2)(b^2+x^2)}=\frac {Ax+B} {(a^2+x^2)}+\frac {Cx+D} {(b^2+x^2)}$.
From here I get that $A=C=0$, $B=\frac {2a} {(b^2-a^2)}$ and $D=\frac {-2a} {(b^2-a^2)}$
Is this correct? Because when I try to solve $I'(a)$ using these values for $B$ and $D$ I get a different solution from the textbook?

$$I(a)=\int_0^\infty\frac{\ln(a^2+x^2)}{(b^2+x^2)}dx$$
$$I'(a)=\int_0^\infty\frac{2a}{(a^2+x^2)(b^2+x^2)}dx$$
now we want to look at simplifying this expression:
$$\frac{2a}{(a^2+x^2)(b^2+x^2)}$$
and we know (due to both factors being quadratic) that it will be of the form:
$$\frac{2a}{(a^2+x^2)(b^2+x^2)}=\frac{Ax+B}{a^2+x^2}+\frac{Cx+D}{b^2+x^2}$$
$$2a=(Ax+B)(b^2+x^2)+(Cx+D)(a^2+x^2)$$
firstly if we look at the cubic terms:
$$0=Ax^3+Cx^3$$
now at the quadratic terms:
$$0=Bx^2+Dx^2$$
now at the linear terms:
$$0=Ab^2x+Ca^2x$$
and finally the constants:
$$2a=Bb^2+Da^2$$
From this we obtain the following simultaneous equations:
$$A+C=0$$
$$B+D=0$$
$$Ab^2+Ca^2=0$$
$$Bb^2+Da^2-2a=0$$
This should give: $A=0$, $C=0$, $B=1/(b^2-a^2)$, $D=1/(a^2-b^2)$
If we put this back in we get:
$$I'(a)=\int_0^\infty\left[\frac{1}{b^2-a^2}\frac{1}{a^2+x^2}+\frac{1}{a^2-b^2}\frac{1}{b^2+x^2}\right]dx$$
we can now split this up into parts to make it easier:
$$I_1=\frac{1}{b^2-a^2}\int_0^\infty\frac{1}{a^2+x^2}dx=\frac{1}{a^2(b^2-a^2)}\int_0^\infty\frac{1}{1+(x/a)^2}dx$$
letting $x=a\tan(u)$ we get $dx=a\sec^2(u)du$ giving:
$$I_1=\frac{1}{a(b^2-a^2)}\int_0^{\pi/2}du=\frac{\pi}{2}\times\frac{1}{a(b^2-a^2)}$$
Similarly we can obtain:
$$I_2=\frac{1}{a^2-b^2}\int_0^\infty\frac{1}{b^2+x^2}dx=\frac{\pi}{2}\times\frac{1}{b(a^2-b^2)}$$
Which gives us:
$$I'(a)=\frac{\pi}{2}\left(\frac{1}{a(b^2-a^2)}+\frac{1}{b(a^2-b^2)}\right)$$
we know now that we must integrate this to obtain an expression for $I(a)$ and work out the constant of integration. To clarify:
$$I(a)=\int\frac{\pi}{2}\left(\frac{1}{a(b^2-a^2)}+\frac{1}{b(a^2-b^2)}\right)da+C$$
To make it easier we will split this up again:
$$I_3=\int\frac{1}{a(b^2-a^2)}da$$
$$I_4=\int\frac{1}{b(a^2-b^2)}da$$
To make this shorter I will just show the answer:
$$I_3=-\frac{\ln|a^2-b^2|-2\ln|a|}{2b^2}$$
$$I_4=-\frac{\ln|a+b|-\ln|a-b|}{2b^2}$$
Giving:
$$I(a)=-\frac{\pi}{4b^2}\left(\ln|a^2-b^2|-2\ln|a|+\ln|a+b|-\ln|a-b|\right)+C$$
Normally this value of $C$ would be calculated where a value of $a$ can be inputted which makes the integral $I(a)$ trivial, its not so easy here but $a=0$ seems the best option
