solves a recurrence equation for a[n].


solves a system of recurrence equations.


solves a partial recurrence equation.

Details and Options

  • RSolve[eqn,a,n] gives solutions for a as pure functions.
  • The equations can involve objects of the form a[n+λ] where λ is a constant, or in general, objects of the form a[ψ[n]], a[ψ[ψ[n]], a[ψ[[ψ[n]]]], where ψ can have forms such as:
  • n+λarithmetic difference equation
    μ ngeometric or -difference equation
    μ n+λarithmetic-geometric functional difference equation
    μ nαgeometric-power functional difference equation
    linear fractional functional difference equation
  • Equations such as a[0]==val can be given to specify end conditions.
  • If not enough end conditions are specified, RSolve will give general solutions in which undetermined constants are introduced.
  • The constants introduced by RSolve are indexed by successive integers. The option GeneratedParameters specifies the function to apply to each index. The default is GeneratedParameters->C, which yields constants C[1], C[2], .
  • GeneratedParameters->(Module[{C},C]&) guarantees that the constants of integration are unique, even across different invocations of RSolve.
  • For partial recurrence equations, RSolve generates arbitrary functions C[n][].
  • Solutions given by RSolve sometimes include sums that cannot be carried out explicitly by Sum. Dummy variables with local names are used in such sums.
  • RSolve sometimes gives implicit solutions in terms of Solve.
  • RSolve handles both ordinary difference equations and difference equations.
  • RSolve handles differencealgebraic equations as well as ordinary difference equations.
  • RSolve can solve linear recurrence equations of any order with constant coefficients. It can also solve many linear equations up to second order with nonconstant coefficients, as well as many nonlinear equations.


open allclose all

Basic Examples  (4)

Solve a difference equation:

Click for copyable input

Include a boundary condition:

Click for copyable input

Get a "pure function" solution for a:

Click for copyable input

Substitute the solution into an expression:

Click for copyable input

Solve a functional equation:

Click for copyable input

Scope  (36)

Generalizations & Extensions  (1)

Options  (1)

Applications  (11)

Properties & Relations  (8)

Possible Issues  (4)

Neat Examples  (1)

See Also

RSolveValue  RecurrenceTable  Sum  ZTransform  GeneratingFunction  DifferenceRoot  DSolve  FindSequenceFunction  FindGeneratingFunction  FindLinearRecurrence


Introduced in 2003
| Updated in 2008