1
$\begingroup$

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)$

$\endgroup$
3
  • $\begingroup$ 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\,$. $\endgroup$
    – dxiv
    Commented Jul 2, 2017 at 6:37
  • 2
    $\begingroup$ 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\ ?$$ $\endgroup$
    – Did
    Commented Jul 2, 2017 at 8:13
  • $\begingroup$ 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. $\endgroup$
    – fleablood
    Commented Jul 3, 2017 at 1:02

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ Perhaps someone can explain the down vote, because this is a correct answer (verified numerically). An explanation may help me with future answers. Thanks. $\endgroup$ Commented Jul 6, 2017 at 20:10
  • $\begingroup$ 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. $\endgroup$
    – Anonymous
    Commented Jul 13, 2017 at 8:51
0
$\begingroup$

$$ 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)) $$

$\endgroup$
2
  • $\begingroup$ Lol I wrote this answer with my cellphone , hopefully it looks good, kinda the downside of a responsive design. $\endgroup$
    – Anonymous
    Commented Jul 3, 2017 at 0:57
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Jul 7, 2017 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .