$ \sum_{n=1}^{\infty} \frac{ x^{n^2} (1 + x^n) - x^n}{1 -x^n} = 0.$ ?? While studying theta functions I noticed
$$ \sum_{n=1}^{\infty} \frac{ x^{n^2} (1 + x^n) - x^n}{1 -x^n} = 0.$$ 
Why is that so ??
Is there a similar case with a term $x^{n^3}$ ??
 A: I am not sure what you mean by "similar case", but the infinite sum is zero because of the equation
$$ \sum_{n=1}^\infty  x^n/(1-x^n) =
\sum_{n=1}^\infty x^{n^2}(1+x^n)/(1-x^n) =
\sum_{n=1}^\infty \sigma_0(n)x^n \tag{1}$$
which is the generating function of the number of divisors of $n$. This is OEIS sequence A000005 which has several generating functions for this sequence and further information.
The reason for the equality is that the infinite sums count the number of divisors in several different ways. This is an example of a general technique. Suppose you have the double sum $$f(x) := \sum_{i,j=1}^\infty a_{ij}x^{ij}.$$
You can sum this by rows or columns to get
 $$f(x) = \sum_{i=1}^\infty\left(\sum_{j=1}^\infty a_{ij}x^{ij}\right) =
          \sum_{j=1}^\infty\left(\sum_{i=1}^\infty a_{ij}x^{ij}\right).$$
The second way is to sum by "gnomons" where
$$f(x) = \sum_{n=1}^\infty\left(a_{nn}x^{nn}+\sum_{j>n}a_{nj}x^{nj}+\sum_{i>n}a_{in}x^{in}\right).$$
The third way is by powers of $x$ giving
$$f(x) = \sum_{n=1}^\infty \left(\sum_{ij=n}a_{ij}\right)x^n$$
and if $a_{ij}:=1,$ then the three methods simplify to give equation $(1).$ 
