Question: Getting the correct derivative of a power in a Sum

I am trying to get Maple to recognize that

diff(x^n,x) does not equal n*x^(n-1), but rather 0 if n=0, or n*x^(n-1) otherwise.

This comes up when differentiating an infinite sum (power series). The constant term gets transformed into n/x instead of becoming zero. Maybe this is really a bug/lack of feature in how sum/Sum works.

For example: diff(Sum(x^n, n = 0 .. infinity), x) yields


Does anybody have a fix to get the differentiation right (other than expanding some terms of the series before taking the derivative)? 

(edited) Please note I am not trying to get an answer to this specific question. It is just illustrates a simplified example of behavior that leads to other bizarre results. Please see the attached worksheet for more weirdness:

Please Wait...