3

I get these trigonometric product to sum formulas like:

$$\sin(a)+\sin(b)=2\sin\frac12(a+b)\cos\frac12(a-b)$$

And that's useful, but I'm not too sure what to do if I need to turn a product into a sum if there's more than two variables.

What would I do with something like this? $$\sin(a)+\sin(b)+\sin(c)+\sin(d)$$

Blue
  • 75,673
Alice T
  • 31
  • 1
  • 1
    Turn a product into a sum, or turn a sum into a product? Does this question come from curiosity, or because you believe such a formula will be a valuable tool? – Greg Martin Oct 02 '20 at 01:27
  • 2
    Not sure, but you can narrow down the search. If you want a product of four sines/cosines, you'll need to be able to permute the variables without changing the product. Also, reverting the parity of each variable should revert that of the product etc. And you can probably look for quarter angles, rather than half angles, simply because this will mean multiplying four fourth-degree roots. You can also restrict to linear combinations of a,b,c,d as variables, plus a constant in front of the product. When you set two of the four variables to zero, does it revert back to the case with 2 variables? – LPenguin Oct 02 '20 at 01:39
  • Turning a product into a sum is cumbersome, but fairly easy: turn two factors into a sum, expand, you now get the sum of two products with one fewer factor. Do the same with each one, etc. If there are $n$ trig factors in the initial product, you will end up with a sum of $2^{n-1}$ trig terms. – Jean-Claude Arbaut Oct 02 '20 at 09:30

1 Answers1

0

The following formula works:

$$ \begin{align} \sin(a)+sin(b)+sin(c)+sin(d) = 4*\sin\left(\frac{a+b+c+d}{4}\right)*\cos\left(\frac{a-b+c-d}{4}\right) \\ *\cos\left(\frac{a+b-c-d}{4}\right)*\cos\left(\frac{a-b-c+d}{4}\right)- \\ 4*\cos\left(\frac{a+b+c+d}{4}\right)*\sin\left(\frac{a-b+c-d}{4}\right) \\ *\sin\left(\frac{a+b-c-d}{4}\right)*\sin\left(\frac{a-b-c+d}{4}\right) \\ \end{align} $$

I wrote this Python script in Google colab to "prove" it:

    import numpy as np
def C(x):
  return np.cos(180/np.pi*x)

def S(x):
  return np.sin(180/np.pi*x)

a = 37
b = 6
c = 88
d = 7

x = S(a) + S(b) + S(c) + S(d)
y1 = 4*S((a+b+c+d)/4.0)*C((a-b+c-d)/4.0)*C((a+b-c-d)/4.0)*C((a-b-c+d)/4.0)
y2 = 4*C((a+b+c+d)/4.0)*S((a-b+c-d)/4.0)*S((a+b-c-d)/4.0)*S((a-b-c+d)/4.0)
print(x)
print(y1-y2)

When the input is $(a,b,c,d) = (37,6,88,7)$, with angles measured in degrees, the outputs for $x$ and $(y1-y2)$ agree to $11$ decimal places at $-1.02707706592$. I also tried $(a,b,c,d) = (10,27,18,68)$, and the two sides of the equation again agreed to $11$ decimal places. That isn't a mathematical proof, but the probability of my proposed identity holding true by accident for randomly selected angles is essentially nil. I tried making one of the angles obtuse, and it still worked.

Steps in the derivation:

  1. Use angle sum formulas to derive an expression for $\sin\left(\frac{A+B+C+D}{4}\right)$ in terms of $\sin\left(\frac{A}{4}\right)$, $\sin\left(\frac{B}{4}\right)$, $\sin\left(\frac{C}{4}\right)$, $\sin\left(\frac{D}{4}\right)$, $\cos\left(\frac{A}{4}\right)$, $\cos\left(\frac{B}{4}\right)$, $\cos\left(\frac{C}{4}\right)$ and $\cos\left(\frac{D}{4}\right)$.

  2. Use the first expression, and the fact that sine and cosine are odd and even functions, respectively, to derive expressions for $\sin\left(\frac{A-B+C-D}{4}\right)$, $\sin\left(\frac{A+B-C-D}{4}\right)$ and $\sin\left(\frac{A-B-C+D}{4}\right)$.

  3. Add the four expressions together.

  4. Make the following substitutions: $$ A = a+b+c+d \\ B = a-b+c-d \\ C = a+b-c-d \\ D = a-b-c+d $$

...and you should get the formula.

Tomcat
  • 57
  • 3
  • Just because it works for two randomly chosen examples doesn’t mean that it’s a valid formula. – sampleuser Oct 02 '20 at 09:15
  • No, the derivation makes it a valid formula. I decided to summarize my derivation, rather than putting pages of math onto the screen. – Tomcat Oct 02 '20 at 09:19
  • 2
    This formula is indeed correct, but it does not turn a sum into a product. – Jean-Claude Arbaut Oct 02 '20 at 09:28
  • Uh oh, my Python program was also wrong. It should have had "np.pi/180" instead of "180/np.pi". This is why the sum of sines of "acute angles" comes out negative. I still tested on 4 randomly chosen angles, just not the ones I thought I was testing on. – Tomcat Oct 02 '20 at 10:42
  • Ah the fun of computer programming! It will never replace thinking and checking! – Oscar Lanzi Oct 02 '20 at 10:53
  • This answer does not look any better than just applying the formula for two sums twice:$$\sin a+\sin b+\sin c+\sin d = 2\sin\left(\frac{a+b}{2}\right)\cos\left(\frac{a-b}{2}\right)+2\sin\left(\frac{c+d}{2}\right)\cos\left(\frac{c-d}{2}\right)$$ – halrankard2 Oct 02 '20 at 11:49
  • Yeah, that's true. I'd be alright with deleting this answer, I guess. – Tomcat Oct 02 '20 at 17:41