Either way is correct.
The C in your second equation equals the sum of C's in your first equation.
When integrating a series, the constant from the integration is evaluated as part of the summation or is it as a constant "outside" of the whole summation?
Say I have
Then is the result equals to this: ?
Or is the result equals to this: ?
But how would it be the same?
In the first one, if say after some working, I found out that C=5. Then there is a summation of 5 for infinity times(which results in infinity) and then plus the summation of Xn.
But in the second one, if C=5, it would just be the summation of Xn and then plus 5, wouldn't it?