Integral of $\dfrac{1}{(x-a)(x-b)}$ when $a, b$ are both different and the same ($2$ questions) So I was assigned a question in my Calc II class, and as I got into the problem, I got lost on what I was being asked to find. As I looked at the two integrals, I was able to split both up into partial fractions.
i.e.
$\dfrac{1}{(x-a)(x-b)}$ becomes $\dfrac{A}{x-a} + \dfrac{B}{x-b}$
and
$\dfrac{1}{(x-a)^2}$ becomes $\dfrac{A}{x-a} + \dfrac{B}{(x-a)^2}$
However, once I reached this point and set up the equalities, I wasn't sure how to solve for the constants $A$ and $B$ in both situations. Any help would be greatly appreciated!
Thank you so much.
 A: The second case, there is nothing to solve for because its already in the right form. This means $A = 0, B = 1$. For the first case, $\dfrac{1}{(x-a)(x-b)} = \dfrac{1}{a-b}\left(\dfrac{1}{x-a} - \dfrac{1}{x-b}\right)\implies A =\dfrac{1}{a-b}, B = -\dfrac{1}{a-b}$ .
A: If $a=b$, then we find that 
$$\int \frac{1}{(x-a)^2}\,dx=-\frac{1}{(x-a)}+C \tag 1$$
where we have tacitly used the $u$-substitution $u=x-a$ and $du=dx$.
If $a\ne b$, then we can use partial fraction expansion to write
$$\begin{align}
\int \frac{1}{(x-a)(x-b)}\,dx&=\frac{1}{a-b}\int \left(\frac{1}{x-a}-\frac{1}{x-b}\right)\,dx\\\\
&=\frac{1}{a-b}\log\left|\frac{x-a}{x-b}\right|+C \tag 2
\end{align}$$

NOTE:
We can show that $(2)$ reduces to $(1)$ in the limit as $b\to a$.  Proceeding we have
$$\begin{align}\lim_{b\to a}\frac{1}{a-b}\log\left|\frac{x-a}{x-b}\right|&=\lim_{b\to a}\frac{1}{a-b}\log\left|1+\frac{b-a}{x-b}\right|\\\\
&=\lim_{b\to a}\left(\frac{1}{a-b}\,\frac{b-a}{x-b}+O\left((b-a)^2\right)\right)\\\\
&-\frac{1}{x-a}
\end{align}$$
as expected!
A: For the first case, remember that $a$ and $b$ are fixed. Since you want $\frac{1}{(x-a)(x-b)}=\frac{A}{x-a}+\frac{B}{x-b}$ then rewriting the right hand side over their least common denominator gives you 
$$\frac{1}{(x-a)(x-b)}=\frac{A(x-b)+B(x-a)}{(x-a)(x-b)}$$. 
That implies that the numerators of the left and right hand side must be equal.
So, 
$$1=A(x-b)+B(x-a).$$
Rewriting and collecting terms on the right hand side we get
$$1=(A+B)x+(-Ab-Ba)$$ which we want to use to equate terms.
Since there is no $x$ term on the left hand side this means that $A+B=0$ or $A=-B$. On the other hand we have a constant term on both sides, that must give us $-Ab-Ba=1$. Substitute, $A=-B$ into this equation and solve for $A$ to get,
$-Ab+Aa=1\implies A(a-b)=1\implies A=\frac{1}{a-b}$. Thus $A=\frac{1}{a-b}$ and $B=-\frac{1}{a-b}.$
After that, you evaluate the integrals as you would normally do.
A: It's easy once you write the partial fractions, use vedic mathematics method on partial fractions to find the constants. Please read Vedic Mathematics Teacher's Manual - Vol. 3: Advanced Level by by Kenneth R. Williams. You will learn a lot of innovative methods in various branches of mathematics.
A: If$a-b\neq0$
then$\dfrac{1}{(x-a)(x-b)}=\dfrac{\dfrac{1}{a-b}}{x-a}-\dfrac{\dfrac{1}{a-b}}{x-b}$
If$a=b$
this case is easy to solve
