This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


solves a recurrence equation for .
solves a system of recurrence equations.
solves a partial recurrence equation.
  • RSolve gives solutions for a as pure functions.
  • The equations can involve objects of the form where is a constant, or in general, objects of the form , , , where can have forms such as:
n+arithmetic difference equation
ngeometric or -difference equation
n+arithmetic-geometric functional difference equation
ngeometric-power functional difference equation
linear fractional functional difference equation
  • Equations such as 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.
  • 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 difference-algebraic 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.
Solve a difference equation:
Include a boundary condition:
Get a "pure function" solution for a:
Substitute the solution into an expression:
Solve a functional equation:
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
Geometric equation:
First-order equation with variable coefficients:
A third-order constant coefficient equation:
Initial value conditions:
Plot the solution:
Second-order inhomogeneous equation:
Second-order variable coefficient equation in terms of elementary functions:
Euler-Cauchy equation:
In general, special functions are required to express solutions:
Solvable logistic equations:
Riccati equations:
Solutions in terms of trigonometric and hyperbolic functions:
Higher-order equations:
Nonlinear convolution equation:
Linear system with constant coefficients:
With boundary conditions:
Plot their solution:
Linear fractional systems:
Diagonal system:
Linear constant coefficient difference-algebraic system:
An index-2 system:
First-order linear partial difference equation with constant coefficients:
Substitute the function Sin for the free function C:
Plot the resulting solution:
Constant coefficient linear equation of orders 2, 3, and 4:
Variable coefficient linear equation:
First-order constant coefficient -difference equation:
Equivalent way of expressing the same equation:
Initial value:
Second-order equation:
Using a numeric value for :
Plot solution:
Linear varying coefficient equations:
Nonlinear equations:
Riccati equation:
A linear constant coefficient system of -difference equations:
No boundary condition, gives two generated parameters:
One boundary condition:
Two boundary conditions:
Use differently named constants:
Use subscripted constants:
This models the amount at year n when the interest r is paid on the principal p only:
Here the interest is paid on the current amount , i.e. compound interest:
Here denotes the number of moves required in the Tower of Hanoi problem with n disks:
Here is the number of ways to tile an space with tiles:
The number of comparisons for a binary search problem:
Number of arithmetic operations in the fast Fourier transform:
The integral satisfies the difference equation:
The integral i[n]∫_0^pi(Cos[n theta]-Cos[n phi])/(Cos[theta]-Cos[phi])ⅆtheta satisfies the difference equation:
The difference equation for the series coefficients of :
The determinant of an n×n tridiagonal matrix with diagonals satisfies:
This models the surface area in dimension n of a unit sphere:
The volume of the unit ball in dimension n:
Applying Newton's method to , or computing :
Applying the Euler forward method to yields:
Solutions satisfy their difference and boundary equations:
Difference equation corresponding to Sum:
Difference equation corresponding to Product:
Results may contain symbolic sums and products:
The solution to this difference equation is unique as a sequence:
As a function it is only unique up to a function of period :
Boundary value problems may have multiple solutions:
Compute the n^(th) iterate or composition of a function:
New in 5 | Last modified in 7