5

When I input

RSolve[{0 == q[n + 1]^2 + 3 q[n + 1] + 2 q[n + 1] q[n] - 6 q[n] + q[n]^2, q[0] == 1}, q[n], n]

I get two complicated-looking complex solutions:

{{q[n] -> 1/4 I ((-2 + I) + 4 I^n - (2 + 5 I) I^(2 n) - (2 + 2 I) I^n Sqrt[5] + (2 + 2 I) I^(2 n) Sqrt[5])}, {q[n] -> -(1/4)I ((2 - I) - 4 I^n + (2 + 5 I) I^(2 n) - (2 + 2 I) I^n Sqrt[5] + (2 + 2 I) I^(2 n) Sqrt[5])}}

There should be just one solution for each $n$ that is between 0 and 1, and I'd like only to see those. How can I achieve that?

Quinn Culver
  • 153
  • 5

1 Answers1

3

The RSolve result is bogus. You can simply plug into the recurrence relation to see that it's not satisfied. It's easy to roll your own, though. I guess the relationship between $q_1$ and $q_2$ can be expressed as

q2[q1_] = q2 /. Solve[q2^2 + 3 q2 + 2 q2*q1 - 6 q1 + q1^2 == 0, q2]
(* Out: {(-3 - 2 q1 - 3 Sqrt[1 + 4 q1])/2, (-3 - 2 q1 + 3 Sqrt[1 + 4 q1])/2} *)

We can examine the following plot to see that indeed, given a $q_1 \in [0,1]$, exactly one of these $q_2$s is also in $[0,1]$.

Plot[Evaluate[q2[q1]], {q1, 0, 1}]

enter image description here

In fact, if you're used to the color scheme, you can see that it's the second solution that is again in the unit interval. Thus, we can define q as

Clear[q];
q[0] = 1;
q[n_] := q[n] =  (-3 - 2 q[n - 1] + 3 Sqrt[1 + 4 q[n - 1]])/2;
Table[q[n], {n, 0, 2}]
N[Table[q[n], {n, 0, 8}]]

enter image description here

More generally, the recursive definition of q might involve a Select command, if you don't have such a simple way to chose which branch to follow.

Mark McClure
  • 32,469
  • 3
  • 103
  • 161
  • Any idea what's wrong with RSolve? – Quinn Culver Aug 06 '14 at 16:59
  • @QuinnCulver Not definitively, but it hardly seems shocking, given the branch cuts that are bound to arise with a quadratic recurrence. – Mark McClure Aug 06 '14 at 17:04
  • What I want is an exact expression for $q(n)$. Any idea(s)? – Quinn Culver Aug 06 '14 at 17:10
  • @QuinnCulver I tried FindSequenceFunction without success but I really see no reason to think that such an expression exists. I can tell you that the sequence converges monotonically down to $3/4$ with approximate multiplier $1/2$ but not much more. – Mark McClure Aug 06 '14 at 17:17
  • And shouldn't RSolve at least get $q(1)$ correct since there's no branching yet? – Quinn Culver Aug 06 '14 at 17:17
  • 1
    @QuinnCulver Well, it oughtta get the whole damn thing correct, no? If you're going to use a black box, you'd better check your results and, in this case, they don't check out. – Mark McClure Aug 06 '14 at 17:20
  • What exactly do you mean by 'approximate multiplier $1/2$'? – Quinn Culver Aug 31 '14 at 20:41
  • @QuinnCulver I mean that $|x_{n}-3/4|<(|x_{n-1}-(3/4)|)/2$. In words, the distance between $x_n$ and $3/4$ is a little less than half the distance between $x_{n-1}$ and $3/4$. You can verify this numerically by looking at Ratios[N[Table[q[n],{n,0,9}]-3/4]] - you'll see a sequence converging to $1/2$. Analytically, you're iterating $f(x)=(-2x+3\sqrt{4x+1}-3)/2$ which has a fixed point at $x=3/4$ satisfying $f'(3/4)=1/2$. – Mark McClure Aug 31 '14 at 21:25