1

solve the recurrence relation $a_{n+2} + a_n =0$

$ r=i $

$r=-i$

I know what to do (and I know the answer)

But I dont know how to work with $\sin $ and $\cos $

to get it to look like $a_n = A \cos(n \pi/2)+B \sin(n \pi/2)$

(its on grimaldi Example 31.10)

I know $i=cos(π/2)+isin(π/2)i=cos⁡(π/2)+isin⁡(π/2)$, so $i^n=cos(nπ/2)+isin(nπ/2)$

but why $cos(nπ/2)+isin(nπ/2) + cos(-nπ/2)+isin(-nπ/2) = A \cos(n \pi/2)+B \sin(n \pi/2)$

mahdi
  • 341
  • The last line is wrong, since the LHS simpy equals $2 \cos(n \pi/2)$. You should make it more clear how far you made it, and where you got stuck. For a general hint, you need to use that $a_0,a_1$ are (presumably) real values, which determine the constants of the general solution and, in the end, $A,B,$. – dxiv Jul 02 '17 at 06:37
  • 1
    Why not forget sines, cosines and the rest, and simply use common sense to show that $$a_n=-a_{n-2}=+a_{n-4}=-a_{n-6}=\ldots$$ hence $$a_{2n}=(-1)^na_0\qquad a_{2n+1}=(-1)^na_1\ ?$$ – Did Jul 02 '17 at 08:13
  • There's an infinite number of solutions. All that is required is that $a_{n+r} = -a_{n+2} = a_n$. So $a_{4k}= 32, a_{4k+1} = -\sqrt{\pi}, a_{4k + 2} = -32, a_{4k + 3} = \sqrt{\pi}$ will do. Or $a_i =0$ will do or $a_k = i^k$ will do or whatever. – fleablood Jul 03 '17 at 01:02

2 Answers2

1

Going through a formal derivation of a generalized Fibonacci sequence, say $f_n=af_{n-1}+bf_{n-2}$, as described here, we can show that

$$a_n=a_1\left(\frac{\alpha^n-\beta^n}{\alpha-\beta}\right)+ba_0 \left(\frac{\alpha^{n-1}-\beta^{n-1}}{\alpha-\beta}\right)$$

where $\alpha,\beta=\pm i$ are the roots as determined in the OP. In the present case, this reduces to

$$a_n=a_1\left(\frac{i^n-(-i)^n}{2i}\right)-a_0 \left(\frac{i^{n-1}-(-1)^{n-1}}{2i}\right)$$

The $a_1$-terms are zero for even values of $n$ and the $a_0$-terms are zero for odd values of $n$. The non=zero terms alternate between plus and minus one, so this can probably be simplified further.

EDIT

I have been able to simplify the result as follows:

$$a_n=a_1\sin\left(\frac{n\pi}{2}\right)+a_0\cos\left(\frac{n\pi}{2}\right)$$

These results have all been verified numerically.

Cye Waldman
  • 7,524
  • Perhaps someone can explain the down vote, because this is a correct answer (verified numerically). An explanation may help me with future answers. Thanks. – Cye Waldman Jul 06 '17 at 20:10
  • hey man nice answer I upvoted it, I answered the way I did because OP said "But I dont know how to work with sin and cos to get it to look like $an=Acos(nπ/2)+Bsin(nπ/2)$" so my solution attempted the easiest/fastest way to achieve that. – Anonymous Jul 13 '17 at 08:51
0

$$ a_n = \alpha^n \rightarrow \alpha^n(\alpha^2+1)=0 \rightarrow \alpha = \pm i $$ $$ a_n = C_1 i ^n + C_2 (-i)^n = C_1 e^{\pi ni / 2} + C_2 e^{-\pi ni/ 2} = C_1 ( \cos (\pi n /2) + i \sin (\pi n / 2)) + C_2 ( \cos (\pi n /2) - i \sin (\pi n / 2)) = $$ $$ (C_1 + C_2) \cos (\pi n /2) +(C_1 - C_2) i \sin (\pi n / 2)) = A\cos (\pi n /2) +B\sin (\pi n / 2)) $$

Anonymous
  • 1,158
  • Lol I wrote this answer with my cellphone , hopefully it looks good, kinda the downside of a responsive design. – Anonymous Jul 03 '17 at 00:57
  • 1
    Kudos on giving a reply by iPhone, I wouldn't even try it on an iPad. Nevertheless, your answer agrees with mine, which has been verified numerically for arbitrary (random) initial conditions. To which I'll add, apparently no good deed goes unpunished as witnessed by our down votes. – Cye Waldman Jul 07 '17 at 16:06