# Under what conditions are two series equal term by term?

I have often seen derivations where people take two series that should be equal and then set the terms equal, term by term. Under what conditions is this valid?

For example, say I expand a real function, $f\left(x\right)$ using some arbitrary real orthogonal polynomials, $P_k\left(x\right)$, as $f(x) = \sum_k a_k P_k\left(x\right)$. Since $f\left(x\right)$ is real we can find a relation for the coefficients as:

$$\begin{array}{rcl} f\left(x\right) & = & f^*\left(x\right) \\ \sum_k a_k P_k\left(x\right) & = & \sum_k a_k^* P_k\left(x\right) \\ \end{array}$$

Then people usually say that the coefficients for the $k$-th term must be equal, so you would get $a_k=a_k^*$. But why do the terms have to be equal term by term? Is it something special about orthogonal polynomials? or orthogonal basis functions in general?

For instance say that I have an adjacency matrix $A_{ij}$, which is symmetric. And I define node weights as:

$$w_i=\sum_j \frac{w_j}{d_j}A_{ij}$$

where $d_j$ is the degree (number of edges connected to) of node $j$, I could try to prove that the weights are proportional to the degrees by the following:

$$\begin{array}{rcl} \sum_i w_i &= & \sum_i\sum_j \frac{w_j}{d_j}A_{ij} \\ \sum_i\sum_j \frac{w_j}{d_j}A_{ij} &= &\sum_i\sum_j \frac{w_j}{d_j}A_{ji} \\ \sum_i\sum_j \frac{w_j}{d_j}A_{ij} &= &\sum_i\sum_j \frac{w_i}{d_i}A_{ij} \\ \end{array}$$

Then if the "coefficients" of the adjacency matrix have to be equal term by term we get: $$\frac{w_j}{d_j}=\frac{w_i}{d_i}=C$$ However, I was told that this is inappropriate, but I don't know why you can't set the terms of the summation equal term by term in this case?

• I don't think the most important element in the question is present: are these sums finite? – Git Gud Apr 5 '13 at 22:01
• The trick is the orthogonality - it lets you compute the coefficients based on $f$. – Thomas Andrews Apr 5 '13 at 22:13

Decided to make my comments into an answer ...

The crucial property is linear independence. In fact, uniqueness of coefficients in linear combinations is essentially the definition of linear independence. Then, if coefficients are unique, you can equate them as you described, of course.

Two special cases are worth mentioning, and are discussed below: (1) when the set of vectors forms a basis, and (2) when the vectors are orthogonal.

The vectors in a basis of a vector space are always linearly independent, of course, so the "equating" technique works when you have linear combinations of basis vectors. The other key property of a basis is its ability to span the entire vector space. This is not relevant to our current discussion -- we only need the linear independence of the basis vectors.

If a collection of vectors are orthogonal, then they are certainly linearly independent. So orthogonality is sufficient for the "equating" step (though certainly not necessary).

All of the above assumes that the sums are finite.

• What is the catch with infinite series? – okj Apr 8 '13 at 15:58

The whole point of bases is that the expression of vector as sum of basis vectors with some coefficients is unique. On the other hand, this usually fails if you don't have a basis.

Another example I can think of is convergent power series: two different convergent power series define two different functions in any neighbourhood in which both are convergent.

• Or rather, it can fail (for the case of finite sums) iff the "basis" vectors are linearly dependent. Infinite series are more complicated: you need a uniqueness theorem. – Robert Israel Apr 5 '13 at 22:21
• @RobertIsrael: If I understand what you're saying, the ability to set the coefficients equal is a result of there being a unique representation in a given basis, but that this only happens when the basis is both orthogonal and complete. Is that correct? (i.e. the answer to the question would be, that the conditions are orthogonality and completeness of the basis). – okj Apr 5 '13 at 23:06
• I didn't say anything about orthogonality. There are plenty of cases of uniqueness without orthogonality. – Robert Israel Apr 5 '13 at 23:12
• So, what are the conditions required for uniqueness? – okj Apr 5 '13 at 23:16
• The crucial condition is linear independence. And, of course, the vectors in a basis of a vector space are always linearly independent (by the usual definition of the term "basis", anyway). Note the quotes around "basis" in Robert Israel's comment -- the quotes indicate that he is using the word "basis" in a non-standard way. – bubba Apr 6 '13 at 0:40