Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am interested in how Mathematica uses the incomplete gamma function to solve difference equations. For example, if we have this inhomogeneous, 2nd order equation and use RSolve:

RSolve[{(n - 2)*a[n - 2] + (n - 1)*a[n - 1] == a[n], a[0] == 1, 
  a[1] == 1} , a , n]

The solution given is:

(2 n Gamma[n] Gamma[3, -1] + 2 n Gamma[1 + n] Gamma[3, -1] - 
   n Gamma[n] Gamma[4, -1] - n Gamma[1 + n] Gamma[4, -1] + 
   2 Gamma[2 + n, -1])/(2 n (3 Gamma[3, -1] - Gamma[4, -1]))

I am wondering if there is some very general algorithm that solves recurrence relations in terms of the incomplete gamma functions, and if so, what are the conditions on the difference equation that lets us apply the theorem. Any reference would be greatly appreciated.

share|improve this question
The usual references are Bender-Orszag and Milne-Thomson. – J. M. May 5 '13 at 11:41
is a first course in difference equations and some complex analysis enough prerequisite for this material? – chartman May 6 '13 at 1:52
I suppose. Then again, I'm self-taught with these... – J. M. May 6 '13 at 1:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.