0
$\begingroup$

I like addition theorems in trigonometry and recently YouTuber Dr Barker posted the video "My New Favourite Trig Function" playing around with following:

Define $$ \operatorname{cas}(x) := \cos(x) + \sin(x) $$

Then: $$ \operatorname{cas}(x+y) = \frac{1}{2} ( \operatorname{cas}(x)\operatorname{cas}(y) + \operatorname{cas}(x)\operatorname{cas}(-y) + \operatorname{cas}(-x)\operatorname{cas}(y) - \operatorname{cas}(-x)\operatorname{cas}(-y) ) $$

This is straightforward.

What I want is: $$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = f( \operatorname{cas}(x_{k}), \operatorname{cas}(-x_{k}) )$$

To do so I assume the addition theorems for $ \sin $ and $\cos $.

Let $N := \lbrace 1,2,3,...,n \rbrace $ and $k$ runs from 1 to n.

$$ \sin( \sum_{k=1}^{n} x_k ) = \sum_{ X \subseteq N, \left\lvert X \right\rvert odd} (-1)^{\frac{\left\lvert X \right\rvert-1}{2}} \prod_{k \notin X} \cos(x_k) \prod_{k \in X} \sin(x_k) $$

$$ \cos( \sum_{k=1}^{n} x_k ) = \sum_{ X \subseteq N, \left\lvert X \right\rvert even} (-1)^{\frac{\left\lvert X \right\rvert}{2}} \prod_{k \notin X} \cos(x_k) \prod_{k \in X} \sin(x_k) $$

Therefor we get

$$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = \sum_{ X \subseteq N} (-1)^{ \lfloor \frac{\left\lvert X \right\rvert}{2} \rfloor} \prod_{k \notin X} \cos(x_k) \prod_{k \in X} \sin(x_k)$$

It´s easy to see that:

$$ \sin(x) = \frac{\operatorname{cas}(x)-\operatorname{cas}(-x)}{2} $$ $$ \cos(x) = \frac{\operatorname{cas}(x)+\operatorname{cas}(-x)}{2} $$

So we get:

$$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = \sum_{ X \subseteq N} (-1)^{ \lfloor \frac{\left\lvert X \right\rvert}{2} \rfloor} \prod_{k \notin X} \left( \frac{\operatorname{cas}(x_k)+\operatorname{cas}(-x_k)}{2} \right) \prod_{k \in X} \left( \frac{\operatorname{cas}(x)-\operatorname{cas}(-x)}{2} \right) $$

$$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = \frac{1}{2^n} \sum_{ X \subseteq N} (-1)^{ \lfloor \frac{\left\lvert X \right\rvert}{2} \rfloor} \prod_{k \notin X} \left( \operatorname{cas}(x_k)+\operatorname{cas}(-x_k) \right) \prod_{k \in X} \left( \operatorname{cas}(x)-\operatorname{cas}(-x) \right) $$

$$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = \frac{1}{2^n} \sum_{ X \subseteq N} (-1)^{ \lfloor \frac{\left\lvert X \right\rvert}{2} \rfloor} \prod_{k=1}^{n} \left( \operatorname{cas}(x_k) - e_{X}(k) \operatorname{cas}(-x_k) \right) $$

where $e_{X}(k) := \begin{cases} 1, & \text{if $k \in X $ } \\ -1, & \text{if $k \notin X $} \end{cases} $

Now I would like to multiply this out to get a form something like

$$ \operatorname{cas}( \sum_{k=1}^{n} x_k ) = \frac{1}{2^n} \sum_{ X \subseteq N} (-1)^{ \lfloor \frac{\left\lvert X \right\rvert}{2} \rfloor} \prod_{\text{some condition}} \operatorname{cas}(x_k) \prod_{\text{some condition}} \operatorname{cas}(-x_k) $$

Can someone help me out? Any ideas?

Greetings.

$\endgroup$
2
  • 1
    $\begingroup$ It might help to notice that $\text{cas}(x)=\sqrt2\sin(x+\pi/4)=\sqrt2\cos(x-\pi/4)$. $\endgroup$
    – mr_e_man
    Commented Jun 22, 2022 at 17:36
  • $\begingroup$ Hello, thanks for your answer. I know this, but I do not want to use it, because there is this shift. I tried this way also and what I get has the desired form but all cas-terms have a shift depending on n. $\endgroup$ Commented Jun 22, 2022 at 17:49

2 Answers 2

3
$\begingroup$

I think that this can be done by recursion. Suppose we define $$ \operatorname{cas}(x) := \cos(x) + \sin(x). $$ Given a sequence of variables $\,x_1,x_2,\dots,x_n\,$ define $$ t_{+k} := \operatorname{cas}(x_k),\quad t_{-k} := \operatorname{cas}(-x_k). $$ Define $$ a_n := x_1+x_2+\cdots+x_n. $$ We want formulas for $$ y_{+n} := \operatorname{cas}(+a_n),\;\; y_{-n} := \operatorname{cas}(-a_n)$$ using only $\,t_{+k}\,$ and $\,t_{-k}.\,$ Initial cases are $$ y_0 = 1, \quad y_{\pm 1} = t_{\pm 1}. $$ Use the addition theorem for $\sin$ and $\cos$ and $\,n\ge 2\,$ to get $$ 2 y_{\pm n} = \pm2 \sin(x_{n-1}+x_n)y_{-n+2} +2 \cos(x_{n-1}+x_n)y_{n-2} $$ where $$ 2 \sin(x_{n-1}+x_n) = t_{n-1}t_n - t_{-n+1}t_{-n}, \\ 2 \cos(x_{n-1}+x_n) = t_{n-1}t_{-n} - t_{-n+1}t_n. $$

$\endgroup$
0
$\begingroup$

We know that $$ \newcommand{cas}{{\operatorname{cas}}} \cas(x) = \sqrt2\cos\left(x - \frac\pi4\right) $$ and $$ \cas(-x) = -\sqrt2\sin\left(x - \frac\pi4\right). $$

Given a list of $n$ quantities $x_1, x_2, x_3, \ldots, x_n$, let $N_1 = \{1,2,3,\ldots,n + 1\}$ and let $x_{n+1} = \dfrac{n\pi}4$. Then

\begin{align} \cas\left( \sum_{k=1}^{n} x_k \right) &= \sqrt2 \cos\left( \left(\sum_{k=1}^{n} x_k\right) - \frac\pi4 \right) \\ &= \sqrt2 \cos\left( \left(\sum_{k=1}^{n} \left(x_k - \frac\pi4\right)\right) + \frac{n\pi}4 - \frac\pi4 \right) \\ &= \sqrt2 \cos\left( \sum_{k=1}^{n+1} \left(x_k - \frac\pi4\right) \right) \\ & = \sqrt2 \sum_{\substack{ X \subseteq N_1 \\ \left\lvert X \right\rvert \text{ even}}}(-1)^{\left\lvert X \right\rvert/2} \prod_{k \notin X} \cos\left(x_k - \frac\pi4\right) \prod_{k \in X} \sin\left(x_k - \frac\pi4\right)\\ & = \sqrt2 \sum_{\substack{ X \subseteq N_1 \\ \left\lvert X \right\rvert \text{ even}}}(-1)^{\left\lvert X \right\rvert/2} \prod_{k \notin X} \frac{\cas\left(x_k\right)}{\sqrt2} \prod_{k \in X} \frac{-\cas\left(-x_k\right)}{\sqrt2}. \end{align}

There are always exactly $n + 1$ terms in the two products in each term of the sum, and the number of terms in the second product is always even, so $$ \cas\left( \sum_{k=1}^{n} x_k \right) = \frac1{2^{n/2}} \sum_{\substack{ X \subseteq N_1 \\ \left\lvert X \right\rvert \text{ even}}} (-1)^{\left\lvert X \right\rvert/2} \prod_{k \notin X} \cas\left(x_k\right) \prod_{k \in X} \cas\left(-x_k\right). \tag1\label{eq:gen} $$

Replacing $\cas\left(x_{n+1}\right)$ with $\cas\left(\dfrac{n\pi}4\right)$ in the terms of Equation ($\ref{eq:gen}$) where it appears and similarly replacing $\cas\left(-x_{n+1}\right)$ with $\cas\left(-\dfrac{n\pi}4\right)$, you obtain a function $f(\cas(x_k), \cas(-x_k))$ for $1 \leq k \leq n$ as desired.


To work out more specifically what the function $f(\cas(x_k), \cas(-x_k))$ will look like, we'll need to look at the possible cases, since the values of the constants $\cas\left(x_{n+1}\right)$ and $\cas\left(-x_{n+1}\right)$ depend on $n$. We can start by separating the sum in Equation ($\ref{eq:gen}$) into two sums, one containing all the terms in which $x_{n+1} \in X$ and the other containing all the other terms:

\begin{align} \cas\left( \sum_{k=1}^{n} x_k \right) &= \frac1{2^{n/2}} \sum_{\substack{X\subseteq N_1 \\ \lvert X\rvert\text{ even} \\ x_{n+1}\in X}} (-1)^{\left\lvert X \right\rvert/2} \prod_{k\notin X} \cas\left(x_k\right) \prod_{k\in X} \cas\left(-x_k\right) \\ &\qquad + \frac1{2^{n/2}} \sum_{\substack{X\subseteq N_1 \\ \lvert X\rvert\text{ even} \\ x_{n+1}\notin X}} (-1)^{\left\lvert X \right\rvert/2} \prod_{k\notin X} \cas\left(x_k\right) \prod_{k\in X} \cas\left(-x_k\right) \\ &= \frac{\cas\left(-x_{n+1}\right)}{2^{n/2}} \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert\text{ odd}}} (-1)^{(\lvert Y\rvert + 1)/2} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right) \\ &\qquad + \frac{\cas\left(x_{n+1}\right)}{2^{n/2}} \sum_{\substack{Y \subseteq N \\ \lvert Y\rvert\text{ even}}} (-1)^{\lvert Y \rvert/2} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right) \end{align} where $N = \{1,2,3,\ldots,n\}$.

To enable writing some of the steps a little more concisely, let \begin{align} f_0(x) &= \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert\text{ even}}} (-1)^{\lvert Y\rvert/2} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right), \\ f_1(x) &= \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert\text{ odd}}} (-1)^{(\lvert Y\rvert + 1)/2} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right). \end{align}

Then \begin{align} -f_1(x) &= \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert\text{ odd}}} (-1)^{(\lvert Y\rvert - 1)/2} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right), \\ f_0(x) + f_1(x) &= \sum_{Y\subseteq N} (-1)^{\lfloor(\lvert Y\rvert + 1)/2\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right), \\ f_0(x) - f_1(x) &= \sum_{Y\subseteq N} (-1)^{\lfloor\lvert Y\rvert/2\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right), \\ \cas\left( \sum_{k=1}^{n} x_k \right) &= \frac{\cas\left(x_{n+1}\right)}{2^{n/2}} f_0(x) + \frac{\cas\left(-x_{n+1}\right)}{2^{n/2}} f_1(x). \end{align}

Note the following table of values of $\cas\left(x_{n+1}\right)$ and $\cas\left(-x_{n+1}\right)$:

\begin{array}{ccc} n \bmod 8 & \cas\left(x_{n+1}\right) & \cas\left(-x_{n+1}\right) \\ \hline 0 & 1 & 1 \\ 1 & \sqrt2 & 0 \\ 2 & 1 & -1 \\ 3 & 0 & -\sqrt2 \\ 4 & -1 & -1 \\ 5 & -\sqrt2 & 0 \\ 6 & -1 & 1 \\ 7 & 0 & \sqrt2 \\ \end{array}

Therefore we can eliminate $\cas\left(x_{n+1}\right)$ and $\cas\left(-x_{n+1}\right)$ from Equation ($\ref{eq:gen}$) by plugging in their values according to the following eight cases according to the equivalence class of $n$ modulo $8$: $$ \cas\left( \sum_{k=1}^{n} x_k \right) = \begin{cases} \displaystyle{\frac1{2^{n/2}} \sum_{Y\subseteq N} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert + 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 0, \\ \displaystyle{\frac1{2^{(n-1)/2}} \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert \text{ even}}} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert + 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 1, \\ \displaystyle{\frac1{2^{n/2}} \sum_{Y\subseteq N} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 2, \\ \displaystyle{\frac1{2^{(n-1)/2}} \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert \text{ odd}}} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert - 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 3, \\ \displaystyle{-\frac1{2^{n/2}} \sum_{Y\subseteq N} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert + 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 4, \\ \displaystyle{-\frac1{2^{(n-1)/2}} \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert \text{ even}}} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert + 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 5, \\ \displaystyle{-\frac1{2^{n/2}} \sum_{Y\subseteq N} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 6, \\ \displaystyle{-\frac1{2^{(n-1)/2}} \sum_{\substack{Y\subseteq N \\ \lvert Y\rvert \text{ odd}}} (-1)^{\left\lfloor\large\frac{\lvert Y\rvert - 1}2\right\rfloor} \prod_{k\notin Y} \cas\left(x_k\right) \prod_{k\in Y} \cas\left(-x_k\right)} & n\equiv 7. \\ \end{cases} $$

You can simplify this a little by noticing that the first four cases apply whenever $\left\lfloor\dfrac n4\right\rfloor$ is even and the last four cases (which are the same as the first four, but with their signs flipped) apply when $\left\lfloor\dfrac n4\right\rfloor$ is odd, so you could put a factor of $(-1)^{\left\lfloor n/4\right\rfloor}$ in front of each of the first four formulas and only have to consider four cases for $n$ modulo $4$. If you work hard enough you could collapse all the cases down to one single case, although the formula for that case would have additional expressions involving $n$ in several places. But I think it is easier to read and understand the formulas when they are separated into cases as shown above.

If you do combine all the cases into one case, you'll find that the formula for that case is not in the form $$ \frac{1}{2^n} \sum_{X \subseteq N} (-1)^{\left\lfloor\large\frac{\left\lvert X \right\rvert}{2} \right\rfloor} \prod_{\text{some condition}} \cas(x_k) \prod_{\text{some condition}} \cas(-x_k). \tag2\label{eq:dnw} $$

Indeed it cannot be. Every term of the sum will always be the product of $k$ factors of the form $\cas\left(\pm x_k\right),$ so "some condition" is simply $k \in X$ under one product and $k \notin X$ under the other, just as in the cosine formula. But when $n$ is odd, not all subsets of $N$ contribute terms to the sum, and the multiplier in front is not $\dfrac1{2^n}$. Also, using $\left\lfloor\dfrac{\left\lvert X \right\rvert}{2} \right\rfloor$ as the exponent of $-1$ is not correct for all terms of the sum for any odd value of $n$. Even in some of the cases where $n$ is even, that exponent will not work for all terms of the sum. But the answer is close to the form of Expression ($\ref{eq:dnw}$); you just need to be a little more flexible about which subsets of $N$ are used in the sum, what the exponent of $-1$ is, and what multiplier you put in front of the sum.

$\endgroup$

You must log in to answer this question.

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