Partial fractions and using values not in domain I'm studying partial fraction decomposition of rational expression. In this video the guy decompose this rational expression:

$$ \frac{3x-8}{x^2-4x-5}$$

this becomes:

$$\frac{3x-8}{(x-5)(x+1)} = \frac{A}{x-5} + \frac{B}{x+1} $$

$$[(x-5)(x+1)]\times \frac{3x-8}{(x-5)(x+1)} = \frac{A}{x-5} + \frac{B}{x+1}\times[(x-5)(x+1)]$$

$$3x-8 = A(x+1) + B(x-5)$$

then he substitutes $x$ with $-1$ this is when I feel something is wrong.

because $x=-1$ is not in the domain of the original function and all the statement below the original function hold true only if they comply within the domain of the original function isn't it? so at the time this guy substitute $x=-1$ the statement become false?

I'm newbie in math, please explain to me with easy understanding and step by step.
When you get to the stage $3x-8 = A(x+1) + B(x-5)$, you've forgotten about the partial fractions and all you're trying to do is determine a polynomial identity. i.e: what $A$ and $B$ will make $A(x+1) + B(x-5)$ identical to $3x-8$ for all values of $x$, this includes $x=-1$ and  $5$.

Once you've got those values, then you divide both sides of the polynomial identity by $(x+1)(x-5)$ with the added restriction that $x\neq -1, 5$. So this gives you $$\frac{3x-8}{(x+1)(x-5)} = \frac{A(x-5) + B(x+1)}{(x+1)(x-5)} = \frac{A}{x-5} + \frac{B}{x+1}$$

which holds for all $x \neq -1, 5$. (which is what let us do the cancelling bit on the RHS)



Some explanation: the motivation for using $x=-1$ and $5$ is that is efficient in the sense that it makes one of the terms in the identity $0$, speeding up the process of finding the values of the coefficients. If you wanted to, you could use any other two values such as $x=3$ and $4$ to get two simultaneous equations in $A$ and $B$, allowing you to determine their values, just not as efficiently.
Observe that the equation

\begin{eqnarray}
\frac{3x-8}{(x+1)(x-5)}=\frac{A}{x-5}+\frac{B}{x+1}
\end{eqnarray}

is valid only for $x\in \mathbb{R}\backslash \{-1,5\}$, as you have rightly pointed out. However, the equation

\begin{eqnarray}
3x-8=A(x+1)+B(x-5)
\end{eqnarray}

is valid for all $x\in \mathbb{R}$.