# Summation+Differentiation=Disaster. I need help with a summation problem I'm having.

1. Nov 27, 2011

### PEZenfuego

My logic is flawed somewhere, but I can't figure out where or why.

So I've been playing with summation a bit and figured out a way to make equations for Ʃ$^{n}_{k=1}$K and Ʃ$^{n}_{k=1}$K$^{2}$ That looks odd, so I'll just use Ʃ from now on, but realize that it is always from k=1 to n.

ƩK is a series like 1+2+3+4...+(n-2)+(n-1)+n

and Ʃk$^{2}$ is a series like1$^{2}$+2$^{2}$+3$^{2}$+4$^{2}$...+(n-2)$^{2}$+(n-1)$^{2}$+n$^{2}$

Anyway, the equation for Ʃk$^{2}$ is (2n$^{3}$+3n$^{2}$+n)/6

and the one for ƩK is (n$^{2}$+n)/2

Now here is what I'm stepping in:

Ʃk$^{2}$=1$^{2}$+2$^{2}$+3$^{2}$+4$^{2}$...

So the derivative of this with respect to n would be

dƩk$^{2}$/dn=2(1)+2(2)+2(3)+2(4)...

another way to write this would be

dƩk$^{2}$/dn=2(1+2+3+4...)

Or...

dƩk$^{2}$/dn=2(ƩK)

So since Ʃk$^{2}$ is (2n$^{3}$+3n$^{2}$+n)/6 it stands to reason that the derivative of this equation would be equal to 2(ƩK), but it isn't.

Ʃk$^{2}$=(2n$^{3}$+3n$^{2}$+n)/6=

Ʃk$^{2}$=(1/3)n$^{3}$+(1/2)n$^{2}$+(1/6)n=

dƩk$^{2}$/dn=(n$^{2}$+n+1/6) Which we said equals 2Ʃk

dƩk$^{2}$/dn=(n$^{2}$+n+1/6)=2Ʃk

dƩk$^{2}$/dn=(n$^{2}$+n+1/6)/2=Ʃk

We earlier said that Ʃk=(n$^{2}$+n)/2 Which renders the above equation untrue.

The funny part of this is that this holds true for Ʃk$^{3}$ and a few others I have tried. Can anyone explain why this doesn't work?

2. Nov 27, 2011

### cepheid

Staff Emeritus
Re: Summation+Differentiation=Disaster. I need help with a summation problem I'm havi

No, this is wrong. You seem to have forgotten that you're differentiating with respect to n and not with respect to k. Therefore the expression is $$\frac{d}{dn}\sum_{k=1}^n k^2$$I couldn't think of a a way to compute this "term-wise" (i.e. without first just evaluating the sum and then differentiating) until I realized that I could re-write the summation as$$\sum_{i=0}^{n-1} (n-i)^2$$So now we have$$\frac{d}{dn}\sum_{i=0}^{n-1} (n-i)^2 = \sum_{i=0}^{n-1} \frac{d}{dn}\left[(n-i)^2\right] = \sum_{i=0}^{n-1} 2(n-i)$$$$= 2\sum_{i=0}^{n-1} n - 2\sum_{i=0}^{n-1}i = 2n^2 - 2\frac{n(n-1)}{2}$$$$=2n^2 - (n^2 - n)$$$$= n^2 + n$$

Hmm...looks like I'm missing a 1/6 term somewhere. But you get the basic idea.

Last edited: Nov 27, 2011
3. Nov 28, 2011

### diazona

Re: Summation+Differentiation=Disaster. I need help with a summation problem I'm havi

You can't actually define the derivative of a discrete series with respect to the upper limit of the sum. The definition of the derivative,
$$\frac{\mathrm{d}y}{\mathrm{d}x} = \lim_{\mathrm{d}x\to 0}\frac{y(x + \mathrm{d} x) - y(x)}{\mathrm{d}x}$$
involves an interval $\mathrm{d}x$ which has to become arbitrarily close to zero, while still allowing you to evaluate the function $y(x)$ at two points separated by that interval. When you only have discretely spaced "points," you can't do that. There is a lower limit on how small $\mathrm{d}x$ can become, namely 1, which means the normal definition of a derivative doesn't work.

What you have to do is analytically continue the series into a function - in other words, you have to find a differentiable function which reproduces the terms of the series when evaluated at integer values, but which is also defined at non-integer values. The easiest way to do this is just to sum the series analytically. In this case, when you do that you get
$$\sum_{k=1}^{n}k^2 = \frac{2n^3+3n^2+n}{6}$$
which is a perfectly fine function to differentiate.

cepheid, I think the reason you're missing your 1/6 term is that you aren't accounting for the increase in the number of terms in the series as $n$ increases. I actually can't think of a way to do that offhand (which is why people tend to prefer just summing the series before differentiation).

4. Nov 28, 2011

### tiny-tim

Hi PEZenfuego!

(try using the X2 icon just above the Reply box )
Do it the easy way

don't go for ∑n2, go for ∑n(n-1) [or ∑n(n-1)…(n-r)] …

what does that look like the derivative of? :tongue2:

5. Nov 29, 2011

### PEZenfuego

Re: Summation+Differentiation=Disaster. I need help with a summation problem I'm havi

Oh wow...how did I not see that?

The derivative of Ʃk2 is 2Ʃk with respect to Ʃk...obviously and not n. Thanks guys.

6. Nov 29, 2011

### Staff: Mentor

Re: Summation+Differentiation=Disaster. I need help with a summation problem I'm havi

...with respect to k, not Ʃk

7. Nov 30, 2011

### PEZenfuego

Re: Summation+Differentiation=Disaster. I need help with a summation problem I'm havi

Salt in my wound...lol