Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Equation Solving >

RSolve

Updated In 7 Graphic
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.
  • RSolve[eqn, a, n] gives solutions for a as pure functions.
  • The equations can involve objects of the form a[n+Lambda] where Lambda is a constant, or in general, objects of the form a[Psi[n]], a[Psi[Psi[n]], a[Psi[...[Psi[n]]...]], where Psi can have forms such as:
n+Lambdaarithmetic difference equation
Mu ngeometric or q-difference equation
Mu n+Lambdaarithmetic-geometric functional difference equation
Mu nAlphageometric-power functional difference equation
linear fractional functional difference equation
  • Equations such as a[0]Equalval 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 q-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:
In[1]:=
Click for copyable input
Out[1]=
 
Include a boundary condition:
In[1]:=
Click for copyable input
Out[1]=
 
Get a "pure function" solution for a:
In[1]:=
Click for copyable input
Out[1]=
Substitute the solution into an expression:
In[2]:=
Click for copyable input
Out[2]=
 
Solve a functional equation:
In[1]:=
Click for copyable input
Out[1]=
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[2k] for the free function C[1]:
Plot the resulting solution:
Constant coefficient linear equation of orders 2, 3 and 4:
Inhomogeneous:
Variable coefficient linear equation:
First-order constant coefficient q-difference equation:
Equivalent way of expressing the same equation:
Initial value:
Second-order equation:
Third-order:
Inhomogeneous:
Using a numeric value for q:
Plot solution:
Linear varying coefficient equations:
Nonlinear equations:
Riccati equation:
A linear constant coefficient system of q-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 a[n] at year n when the interest r is paid on the principal p only:
Here the interest is paid on the current amount a[n], i.e. compound interest:
Here a[n] denotes the number of moves required in the Tower of Hanoi problem with n disks:
Here a[n] is the number of ways to tile a nx3 space with 2x1 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 satisfies the difference equation:
The difference equation for the series coefficients of y'[x]==2x y[x],y[0]==1:
The determinant of n×n tridiagonal matrix with diagonals c,a,b satisfies:
This models the surface area s[n] in dimension n of a unit sphere:
The volume of the unit ball in dimension n:
Applying Newton's method to x^2==3, or computing :
Applying the Euler forward method to y''[x]+1/100 y[x]==0 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 1:
Boundary value problems may have multiple solutions:
Compute the n^(th) iterate or composition of a function:
New in 5 | Last modified in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team