The thing that goes wrong is that you are not allowed to interchange the two limiting processes (integration, and summation of infinite series). This is only permitted under some condition like uniform convergence of the series. In this case, all three of the sums of the series ( ) give rise to divergent improper integrals, because they go to infinity at x=1. Interchanging summation and integration is definitely not safe in those conditions.

In fact, this calculation is a very nice example of why you need to be careful about interchanging limiting operations.