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 having two problems regarding Mathematica, and both of them are happening because it does not accept such inputs:

RSolve[ g[n + 1] == g[n]^2 + 2*f[n]^2, f[n + 1] == 2f[n]*g[n]]


RSolve[ g[n + 1] == g[n]^2 + sum[ f[n - 1, i], i = 0..n-1], f[n,x]== (n!)/((x!)*(n-x)!)]

And I have no idea how to provide the correct input for such equations that Mathematica understands.

share|improve this question
You are missing an n argument. There are examples in help – Nasser Nov 16 '13 at 12:46
Also, the correct syntax for Sum is Sum[expr,{i,0,n-1}] – Peltio Nov 16 '13 at 12:48
If you wish getting helpful answers you should provide a bit more constructive question. First improve it by rewriting the code involving acceptable syntax. However in the case of your equations I suggest to start playing with RecurrenceTable or imposing appropriate initial/boundary conditions e.g. f[0] == 1/3 && g[0] == 1/2. – Artes Nov 16 '13 at 13:51
@lkn2993 You should correct the syntax in the question, then perhaps someone finds your problem interesting to solve it. I suggested to try finding appropriate initial conditions as well. – Artes Nov 16 '13 at 15:26
From my reading of the documentation RSolve will not accept nonlinear equations in two or more variables. What little experimentation I've done tends to confirm this. – m_goldberg Nov 17 '13 at 0:19
up vote 1 down vote accepted


In the following the role of f and g have been inadvertently exchanged,i.e.

$f(n)=f(n-1)^2+2 g(n-1)^2$ and $g(n)=2 f(n-1)g(n-1)$

Therefore, just exchange.

The values can be obtained by defining the recursive functions with suitable starting values for f and g. I present alternatives.

It is relatively straightforward to uncouple the relations: $h(n)=f(n)+\sqrt{2}g(n)$ and $j(n)=f(n)-\sqrt{2}g(n)$ the recurrence then becomes:



then the solutions are:



then solving by back substitution.

For example, f(0)=g(0)=1 yields (for $n\geq1$:

$f(n)= (1+\sqrt{2})^{2^n}+(1-\sqrt{2})^{2^n}$

$g(n)= \frac{(1+\sqrt{2})^{2^n}-(1-\sqrt{2})^{2^n}}{2\sqrt{2}}$

You can also solve and tabulate as follows:


To tabulate first 5 results (and initial conditions):

TableForm[r[5], TableHeadings -> {Range[6] - 1, {f[n], g[n]}}]

enter image description here

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.