As suggested by the OP, I post my comment as an answer:
Try out Wolfram Alpha. The code for your example is https://www.wolframalpha.com/input/?i=Sum%5B+k+a+%5Ek+b%5E%28n-k%29+%2C+%7B+k%2C+1%2C+n+%7D+%5D
As suggested by the OP, I post my comment as an answer:
Try out Wolfram Alpha. The code for your example is https://www.wolframalpha.com/input/?i=Sum%5B+k+a+%5Ek+b%5E%28n-k%29+%2C+%7B+k%2C+1%2C+n+%7D+%5D