Recurrence Relation: $a_{n+2}+a_n=5\cos (n\pi/3)-7\sin(n\pi/4)$

discrete mathematics

Recurrence Relation: $a_{n+2}+a_n=5\cos \left(\frac{n\pi}{3}\right)-7\sin\left(\frac{n\pi}{4}\right)$

Attempt:

The solution of the associated homogeneous relation is
\begin{align}
a_n^{(h)}&=c_1\left(\cos \left(\frac{n\pi}{2}\right)+i\sin \left(\frac{n\pi}{2}\right)\right)+c_2\left(\cos \left(\frac{n\pi}{2}\right)-i\sin \left(\frac{n\pi}{2}\right)\right)\\ &=k_1\cos \left(\frac{n\pi}{2}\right)+k_2\sin \left(\frac{n\pi}{2}\right)
\end{align}

where $k_1=c_1+c_2$ and $k_2=(c_1-c_2)i$

then
\begin{align*}
a_n^{(p)} = A\cos \left( \frac{n\pi}{3} \right)+B\sin \left( \frac{n\pi}{3} \right) +C \cos \left( \frac{n\pi}{4} \right)+D\sin \left( \frac{n\pi}{4} \right)
\end{align*}

is the particular solution. The four constants $A, B, C, D$ can be calculated by substituting $a_n^{(p)}$ in the given non-homogeneous recurrence relation. But I find it difficult to calculate.

Best Answer

Let us start with a way to express the general solution:

$$\left(\begin{smallmatrix} a_1\\ a_{2}\\ a_{3}\\ .\\ .\\ .\\ a_{22}\\ a_{23}\\ a_{24} \end{smallmatrix}\right)=\underbrace{\left(\begin{smallmatrix}5\\ -1\\ a-5\\ -8.5\\ -2.5\\ 6\\ 7-a\\ 6\\ -2.5\\ -8.5\\ a-5\\ -1\\ 5\\ 6\\ -a\\ -1.5\\ -2.5\\ -1\\ a+2.5\\ -1\\ -2.5\\ -1.5\\ -a\\ 6\end{smallmatrix}\right)}_S+\alpha \underbrace{\left(\begin{smallmatrix} 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\end{smallmatrix}\right)}_{K_1}+\beta \underbrace{\left(\begin{smallmatrix} 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\\ 1\\ 0\\ -1\\ 0\end{smallmatrix}\right)}_{K_2} \tag{*}$$

with $a:=f(1)=\frac{5-7 \sqrt{2}}{2}\approx 2.4497$, for any $\alpha, \beta$.

Why considering 24 entries ? Because, for any $n$:

$$\sum_{k=n}^{k=n+23} f(k) = 0 \ \ \ \text{where} \ \ \ f(k):=5\cos \left(\frac{k\pi}{3}\right)-7\sin\left(\frac{k\pi}{4}\right)$$

(This could have been foreseen: $24$ is the shortest period for a cycle accomodating $\pi/3$ and $\pi/4$ like the Meton cycle for the Sun and the Moon...)

(See graphics below : the blue curve for function $f$ and the red curve for its cumulative values displaying the 24-periodicity),

enter image description here

As a consequence, we have the homogeneous recurrence relationship: $$a_{n+23}+a_{n+22}+2\left(\sum_{k=n+2}^{k=n+21} a_{k}\right)+a_{n+1}+a_n=0.$$

Let us stop here for a while. We know that the set of sequences $(b_n)$ (I voluntarily take a different notation) verifying relationship:

$$b_{n+23}+b_{n+22}+2\left(\sum_{k=n+2}^{k=n+21} b_{k}\right)+b_{n+1}+b_n=0.\tag{*}$$

is a vector space $V$ with dimension $24$. The set of sequences $a_n$ is therefore a subset (in fact an affine subspace) of $V$, with many constraints, all of them contributing to a final very low "dimensionality" of the issue.

Let us now switch to matrix algebra explanations.

Consider the $n= 24$ first linear relationships with a periodic indexing, meaning that $a_{25}=a_1, a_{26}=a_2$). This system of $n$ equations in $n$ unknowns

$$\underbrace{\left(\begin{smallmatrix} 1&0&1&0&0\cdots0&0&0\\ 0&1&0&1&0\cdots0&0&0\\ 0&0&1&0&1\cdots0&0&0\\ &.&.&.&.&.&\\ &.&.&.&.&.&\\ &.&.&.&.&.&\\ 0&0&0&0&0\cdots1&0&1\\ 1&0&0&0&0\cdots0&1&0\\ 0&1&0&0&0\cdots0&0&1\\ \end{smallmatrix}\right)}_A\left(\begin{smallmatrix} a_n\\ a_{n+1}\\ a_{n+2}\\ .\\ .\\ .\\ a_{n+21}\\ a_{n+22}\\ a_{n+23}\\ \end{smallmatrix}\right)=\left(\begin{smallmatrix} f(n)\\ f(n+1)\\ f(n+2)\\ .\\ .\\ .\\ f(n+21)\\ f(n+22)\\ f(n+23)\\ \end{smallmatrix}\right)\tag{2}$$

is not solvable because $A$ has rank $22$.

Indeed, the characteristic polynomial of $A$ is:

$$[x(x - 2)(x^2 - 2x + 2)(x^2 - 3x + 3)(x^2 - x + 1)(x^4 - 4x^3 + 5x^2 - 2x + 1)]^2$$

We can place the finger where the issue is: $A$ having $0$ as a double value, has a kernel with dimension $2$, meaning that there are in fact two arbitrary constants, which isn't surprizing... We must assign arbitrary values to $a_1$ and $a_2$ to get a solution $S$.

A basis of the kernel are the vectors $K_1, \ K_2$ with resp. entries $\cos k\pi/2$ and $\sin k\pi/2$, $\ k=1... 24$ (see formula (*).


Remark: I had investigated the 24 dimensional space of sequences. Here are some interesting facts, but in fact not at all useful for the solution of this problem.

The characteristic equation of (*) is

$$r^{22}(r+1)+2(\sum_{k=2}^{21} r^k)+(r+1)=0 \tag{1}$$

(which has the property to be reciprocal) has the following 23 distinct roots (obtained using a Computer Algebra System):

$$-1, \pm i, \pm w^k, k=1,2,...10 \ \ \text{where} \ w=e^{i \pi/11}$$

As a consequence, the general expression is:

$$a_n=K(-1)^n+L(i^n)+M(-i)^n+\sum_{k=1}^{10} C_k e^{ik \pi/11}+\sum_{k=1}^{10} D_k e^{-ik \pi/11}$$

for certain constants $K,L,M,C_k,D_k$ ($k=1:10$).

Due to the fact that the sequence $a_n$ is a real sequence i.e., such that $a_n=\overline{a_n}$, we can conclude that $L=M$ and for all $k$, $C_k=D_k$.

It remains to find unknowns $K,L,C_1,C_2,... C_{10}$ by setting the different constraints, which would lead to another much more complicated way to solve the issue.

Related Question