What is the Mathematical Property that justifies equating coefficients while solving partial fractions? The McGraw Hill PreCaculus Textbook gives several good examples of solving partial fractions, and they justify all but one step with established mathematical properties.
In the 4th step of Example 1, when going from:
$$1x + 13 = (A+B)x+(4A-5B)$$
they say to "equate the coefficients", writing the linear system
$$A+B = 1$$
$$4A-5B=13$$
It is a simple step, color coded in the textbook for easy understanding, but McGraw Hill does not justify it with any mathematical property, postulate or theorem.  Addition and/or multiplication properties of equality don't seem to apply directly.
Can someone help me justify this step?!
 A: Lemma: If $px+q=0$ for all values of $x$, then $p=q=0$.
Proof: In particular, $p(0)+q=0$, which means that $q=0$. So $px=0$ for all $x$, which means that $p(1)=0$, and so $p=0$.
Theorem: If $px+q$ and $rx+s$ are equal for all values of $x$, then $p=r$ and $q=s$.
Proof: If $px+q$ and $rx+s$ are equal for all values of $x$, then
$$
px+q-(rx+s)=0
$$
for all values of $x$. But this expression can be rewritten as
$$
(p-r)x+(q-s)
$$
and so, by the lemma, $p-r=0$ and $q-s=0$. That is, $p=r$ and $q=s$.
A: Presumably it is stated that this equation must hold for all $x$. That means that in particular it must hold for $x=0$. If we set $x=0$ in your equation, we find the equation
$13=4A-5B$
which is the second equation you wrote. Let us now look at $x=1$, for which we find
$1+13=(A+B)+(4A-5B)$
We already know that $4A-5B=13$ from our previous step, which we can thus put into the equation, leading to $1+13=(A+B)+13$. Subtracting $13$ from either side leaves us with
$1=A+B$
which is your second equation.
Note that this can be done more generally, i.e. even if the equation only has to hold for a few $x$, not including $0$ or $1$. If you want a proof that does not use $x=0$ and $x=1$ let me know.
A: The general principle is: two polynomials are equal at every point if and only if their coefficients are equal. "If their coefficients are equal then the polynomials are equal" is clear. 
Proving the reverse is not so easy in general. It follows from a stronger result from linear algebra, which says that the Vandermonde matrix for $d+1$ distinct real numbers is invertible, and so there is a unique polynomial of degree at most $d$ passing through any $d+1$ points, provided they all have different $x$ coordinates. This is probably not accessible to you at your level, but it is probably the best way to see it overall.
Another way to see it, though making this rigorous requires some calculus, is to note that if two polynomials are equal at each point, then their constant terms must be the same. Subtracting off the constant term from each and dividing by $x$, you have two polynomials that now again have to be equal at each point. So you plug in $x=0$, which gives agreement of the linear coefficients of the original polynomials. Doing this a total of $d+1$ times gives the desired result. 
Where the lack of rigor comes in is in saying that $x/x=1$ even when $x=0$, which is not properly true. What we are really doing here is noticing that if two differentiable functions are equal everywhere then their derivatives are equal everywhere, and that if $p(x)=\sum_{k=0}^n a_k x^k$ then $a_k=\frac{p^{(k)}(0)}{k!}$, where $p^{(k)}$ denotes the $k$th derivative of $p$.
A: The property one uses is that two polynomials
$$ p(x) = a_n x^n + \dots + a_1 x + a_0, \\
q(x) = b_m x^m + \dots + b_1 x + b_0 $$
are equal to each other if and only if $a_n = b_n$ for all $n \in \mathbb{N}_0$. In other words, two polynomials are equal if and only if their coefficients are equal (and in particular, they must be of the same degree).
How one would justify this actually depends on how you think of polynomials. From an algebraic point of view, a polynomial is a formal expression of the form $p(x) = a_n x^n + \dots + a_1 x + a_0$ and two polynomials are defined to be equal if their coefficients are equal.
However, an alternative approach would be to define a polynomial as a function $p \colon \mathbb{R} \rightarrow \mathbb{R}$ for which there exists real numbers $a_0,\dots,a_n$ such that $p(x) = a_nx^n + \dots + a_1 x + a_0$ for all $x \in \mathbb{R}$. From this point of view, it is not clear that if you have two polynomial functions $p(x),q(x)$ such that $p(x) = q(x)$ for all $x \in \mathbb{R}$ then their coefficients must be equal (and in fact this is not true if one replaces $\mathbb{R}$ with an arbitrary field or ring). 
To prove this, one can give an algebraic argument using the Vandermonde determinant but for real polynomials, it is easier to note that the $k$-coefficient of $p(x) = a_n x^n + \dots + a_1 x + a_0$ is given by $a_k = \frac{p^{(k)}(0)}{k!}$ where $p^{(k)}(0)$ is the $k$-th derivative of $p$ at $x = 0$. Then if two polynomials are equal as functions, it is clear that all their derivatives of all orders must be equal and so the coefficients must be equal.
