# RSolve

RSolve[eqn,a[n],n]

solves a recurrence equation for a[n].

RSolve[{eqn1,eqn2,},{a1[n],a2[n],},n]

solves a system of recurrence equations.

RSolve[eqn,a[n1,n2,],{n1,n2,}]

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 μ n geometric or -difference equation μ n+λ arithmetic-geometric functional difference equation μ nα geometric-power functional difference equation linear fractional functional difference equation
• Equations such as a==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 , which yields constants C, C, .
• 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.

# Examples

open all close all

## Basic Examples(4)

Solve a difference equation:

 In:= Out= Include a boundary condition:

 In:= Out= Get a "pure function" solution for a:

 In:= Out= Substitute the solution into an expression:

 In:= Out= Solve a functional equation:

 In:= Out= ## Neat Examples(1)

Introduced in 2003
(5.0)
|
Updated in 2008
(7.0)