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?
 A: Let’s redo the work$$\frac 1{(a^2+x^2)(b^2+x^2)}=\frac {Ax+B}{a^2+x^2}+\frac {Cx+D}{b^2+x^2}$$Multiplying both sides by the common denominator$$1=(Ax+B)(b^2+x^2)+(Cx+D)(a^2+x^2)$$To find values for $A$, $B$, $C$, and $D$, first set $x^2=-a^2$. Thus$$\begin{align*}1 & =(Ax+B)(b^2-a^2)\\ & =Ax(b^2-a^2)+B(b^2-a^2)\end{align*}$$Therefore, it’s easy to see that $A=0$ and $B=1/(b^2-a^2)$. Now do a similar procedure for the other term by setting $x^2=-b^2$. Thus$$\begin{align*}1 & =(Cx+D)(a^2-b^2)\\ & =Cx(a^2-b^2)+D(a^2-b^2)\end{align*}$$Thus, $C=0$ and $D=1/(a^2-b^2)$. So to sum everything up$$\frac 1{(a^2+x^2)(b^2+x^2)}\color{blue}{=\frac 1{(b^2-a^2)(a^2+x^2)}+\frac 1{(a^2-b^2)(b^2+x^2)}}$$
A: Here you are solving:
\begin{equation}
I(a,b)=\int_0^\infty\frac {\ln\left(a^2+x^2\right)}{\left(b^2+x^2\right)}dx
\end{equation}
The method you have taken is perfectly fine. Here I will employ Feynman's Trick and introduce a new parameter:
\begin{equation}
J(t;a,b)=\int_0^\infty\frac {\ln\left(a^2+tx^2\right)}{\left(b^2+x^2\right)}dx
\end{equation}
We see that $I(a,b) = \lim_{t \rightarrow 1^+} J(t;a,b)$ and that $J(0;a,b)$ is easy to resolve (will do later). Applying Leibniz's Integral Rule we take the derivative with respect to $t$:
\begin{align}
\frac{dJ}{dt} &= \int_0^\infty\frac {x^2}{\left(a^2 + tx^2\right)\left(b^2+x^2\right)}dx = \frac{1}{b^2t - a^2}\int_0^\infty\left[\frac{b^2}{b^2 + x^2} - \frac{a^2}{a^2+tx^2} 
 \right]dx \\
&= \frac{1}{b^2t - a^2}\left[\left|b\right|\operatorname{arctan}\left(\frac{x}{\left|b\right|} \right) - \frac{\left|a\right|}{\sqrt{t}} \operatorname{arctan}\left(\frac{\sqrt{t}x}{\left|a\right|}\right)
 \right]_0^\infty \\
&=\frac{1}{b^2t - a^2}\left[\left|b\right|\cdot \frac{\pi}{2} -\frac{\left|a\right|}{\sqrt{t}}\cdot \frac{\pi}{2}\right] =\frac{\pi}{2\left(b^2t - a^2\right)}\left[\left|b\right|\ -\frac{\left|a\right|}{\sqrt{t}}\right] = \frac{\pi}{2\sqrt{t}\left(b^2t - a^2\right)}\left[\left|b\right|\sqrt{t} -\left|a\right|\right] \\
&=\frac{\pi}{2\sqrt{t}\left(\left|b\right|\sqrt{t} + \left|a\right|\right)}
\end{align}
We now integrate with respect to $t$:
\begin{equation}
J(t;a,b) = \int \frac{\pi}{2\sqrt{t}\left(\left|b\right|\sqrt{t} + \left|a\right|\right)}\:dt
\end{equation}
Here let $t = u^2$
\begin{align}
 &\int \frac{\pi}{2\sqrt{t}\left(\left|b\right|\sqrt{t} + \left|a\right|\right)}\:dt =  \int \frac{\pi}{2\sqrt{u^2}\left(\left|b\right|\sqrt{u^2} + \left|a\right|\right)}\cdot 2u\:du = \int \frac{\pi}{\left|b\right||u| + \left|a\right|}\:du \\
&= \frac{\pi}{|b|}\ln\left|\left|b\right||u| + \left|a\right| \right| + C = \frac{\pi}{|b|}\ln\left|\left|b\right|\sqrt{t} + \left|a\right| \right| + C
\end{align}
Where $C$ is the constant of integration.To resolve we use $J(0;a,b)$:
\begin{equation}
J(0;a,b) = \int_0^\infty\frac {\ln\left(a^2+0\cdot x^2\right)}{\left(b^2+x^2\right)}dx = \frac{\pi}{|b|}\ln\left|\left|b\right|\sqrt{0} + \left|a\right| \right| + C =  \frac{\pi}{|b|}\ln\left|ab \right| + C 
\end{equation}
And thus
\begin{align}
 \frac{\pi}{|b|}\ln\left|ab \right| + C&= \int_0^\infty\frac {\ln\left(a^2\right)}{\left(b^2+x^2\right)}dx = 2\ln|a| \int_0^\infty\frac {1}{\left(b^2+x^2\right)}dx\\
& =  2\ln|a| \left[\frac{1}{\left|b\right|}\operatorname{arctan\left(\frac{x}{\left|b\right|} \right)} 
\right]_0^\infty = 2\ln|a| \cdot \frac{1}{\left|b\right|} \frac{\pi}{2} = \frac{\pi\ln|a|}{|b|}
\end{align}
Thus
\begin{equation}
C = \frac{\pi\ln|a|}{|b|} - \frac{\pi}{|b|}\ln\left|ab \right| = -\frac{\pi}{|b|}\ln|b|
\end{equation}
Thus, we form our solutions for $J(t;a,b)$:
\begin{equation}
J(t;a,b) = \frac{\pi}{|b|}\ln\left|\left|b\right| \sqrt{t}+ \left|a\right| \right| -\frac{\pi}{|b|}\ln|b|
\end{equation}
We now can solve for $I(a,b)$ by applying the limit as above:
\begin{align}
I(a,b) &= \lim_{t \rightarrow 1^+} J(t;a,b) = \lim_{t \rightarrow 1^+}\frac{\pi}{|b|}\ln\left|\left|b\right| \sqrt{t}+ \left|a\right| \right| -\frac{\pi}{|b|}\ln|b| \\
&= \frac{\pi}{|b|}\ln\left|\left|b\right| + \left|a\right| \right| -\frac{\pi}{|b|}\ln|b| =\frac{\pi}{|b|}\ln\left|\frac{\left|b\right| + \left|a\right|}{|b|} \right|
\end{align}
Or 
\begin{equation}
\int_0^\infty\frac {\ln\left(a^2+x^2\right)}{\left(b^2+x^2\right)}dx = \frac{\pi}{|b|}\ln\left|\frac{\left|b\right| + \left|a\right|}{|b|} \right|
\end{equation}
A: $$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
