Computation Of Integrals Computer the Integral: $$\int\frac{2x+1}{(x-1)(x-2)}dx$$
Now using partial fraction we can write $$\frac{2x+1}{(x-1)(x-2)}=\frac{A}{x-1}+\frac{B}{x-2}$$, So we get $$\frac{2x+1}{(x-1)(x-2)}=\frac{A(x-2)+B(x-1)}{(x-1)(x-2)}$$ Now for all $x$ not equal to $1, 2$ we can cancel out the denominator to get $$2x+1=A(x-2)+B(x-1)$$ Now to find $A$ and $B$ how can we put $x=1$ and $x=2$ in this identity as this identity is valid if and only if $x$ is not equal to $1, 2$

You have
$$2x+1=A(x-2)+B(x-1) \tag{1}\label{eq1}$$
As for why substituting values of $x = 1$ and $x = 2$ works, this is because \eqref{eq1} is an identity and, thus, must be true for all values of $x$. With the original equation involving the denominators, due to continuity for all $x \neq 1,2$, the numerators must still match values at $x = 1,2$. Thus, by using $x = 2$ first, you eliminate the $A$ parameter so you only have the $B$ parameter, to get $B = 5$. Likewise, using $x = 1$ eliminates the $B$ parameter, leaving an equation in just $A$ to solve to get $-A = 3 \implies A = -3$. However, this method doesn't always work well in more complicated sets of equations (e.g., where higher powers are involved, there are considerably more variables being used so you can't isolate just one of them, etc.), which is why I present the more general method below.
Although it's sometimes more work, you can also expand and collect the terms of the same powers of $x$ together. In this case, \eqref{eq1} becomes
$$2x + 1 = (A + B)x - 2A - B \implies (2 - (A + B))x + (1 + 2A + B) = 0 \tag{2}\label{eq2}$$
Thus, you get for the coefficient of $x$ to be $0$ that
$$A + B = 2 \tag{3}\label{eq3}$$
and for the constant term to be $0$ that
$$-2A - B = 1 \tag{4}\label{eq4}$$
Adding the $2$ equations gives $-A = 3 \implies A = -3$. Thus, from \eqref{eq3}, you then get $B = 2 + 3 = 5$. This, of course, matches what was originally determined by using $x = 1$ and $x = 2$.
