# Proving the sum to product formula with complex numbers starting from the left hand side

I've just asked a similar question today Prove the sum to product formulas with complex numbers but I was wondering what if we wanted to start with the left hand side instead of the right hand side? Because at the end I want to be able to think, to derive this formula without knowing the outcome, the right hand side, so I'm wondering about how to do it starting from the left hand side. My goal: $$\sin x+\sin y=2\sin\left(\frac{x+y}{2}\right)\cos\left(\frac{x-y}{2}\right)$$ Recall the complex definition of sine and cosine: $$\sin z=\frac{e^{iz}-e^{-iz}}{2i}$$ and $$\cos z=\frac{e^{iz}+e^{-iz}}{2}$$ Applying both we get after simplifying a bit: $$\frac{e^{ix}-e^{-ix}+e^{iy}-e^{-iy}}{2i}$$ but I don't really know what to do now. I've also tried with the opposite substitution that I used when proving this starting from the right hand side $$\alpha=\frac{x+y}{2}$$ and $$\beta=\frac{x-y}{2}$$ but I'm pretty sstuck. I know I have to factor it to get it closer to our goal, but no clue on how to factor this. Any hints?

• Follow the steps in the answer to the other question, in reverse order.
– mjw
Aug 30, 2021 at 1:04
• Alt. hint: $\;\operatorname{cis}(x) = \operatorname{cis}\left(\frac{x+y}{2}+\frac{x-y}{2}\right)=\operatorname{cis}\left(\frac{x+y}{2}\right)\operatorname{cis}\left(\frac{x-y}{2}\right)\,$, then do something similar for $\,\operatorname{cis}(y)\,$ and add the two.
– dxiv
Aug 30, 2021 at 1:13

Obviously, you could "cheat" and use the rhs to inform your factorisation. But that's not what you want.

If you write $$a=e^{ix}$$ and $$b=e^{iy}$$, then you have $$\frac{1}{2i}\left(a-\frac 1a + b - \frac1b\right)$$ which is $$\frac1{2abi}(ab^2+a^2b-b-a)$$

One might then recognise the common factor of $$a+b$$, and get

$$\frac1{2abi}(a+b)(ab-1)$$

If I distribute the factor of $$\frac1{ab}$$ evenly between the two brackets, I get

$$\frac1{2i}\frac{a+b}{\sqrt{ab}}\frac{ab-1}{\sqrt{ab}},$$

that is,

$$\frac1{2i}\left(\frac{\sqrt{a}}{\sqrt{b}}+\frac{\sqrt{b}}{\sqrt{a}}\right)\left(\sqrt{ab} - \frac{1}{\sqrt{ab}}\right).$$

Remembering that $$a=e^{ix}$$ and $$b=e^{iy}$$, this is

$$\frac1{2i}\left(\sqrt{e^{i(x-y)}}+\sqrt{e^{-i(x-y)}}\right)\left(\sqrt{e^{i(x+y)}} - \sqrt{e^{-i(x+y)}}\right),$$

that is,

$$\frac1{2i}\left({e^{i\frac{x-y}2}}+{e^{-i\frac{x-y}2}}\right)\left({e^{i\frac{x+y}2}} - {e^{-i\frac{x+y}2}}\right)$$

which gives you the right hand side after just a couple more fairly obvious steps.

Edit: yes, I've glossed over the fact that complex numbers have two square roots, and there's no obvious preference to determine what is meant by $$\sqrt{z}$$. Defining $$\sqrt{a}$$ and $$\sqrt{b}$$ carefully would give either the desired identity, or $$\sin x+\sin y=2\sin\left(\frac{x+y}{2}+\pi\right)\cos\left(\frac{x-y}2+\pi\right)$$

• You might also remark that there is no ambiguity implied in your last equation, since the "angle-addition" formulas allow us to write it as $$\sin x \ + \ \sin y \ \ = \ \ 2 \ · \ \left[ \ -\sin \left(\frac{x+y}{2} \right) \ \right] \ · \left[ \ -\cos \left(\frac{x-y}{2} \right) \ \right] \ \ .$$ Feb 20, 2022 at 1:33

To begin from the left side using complex exponentials only is "trickier" in the sense that there isn't much in the expression $$\ \frac{e^{ix}-e^{-ix}}{2i} + \frac{e^{iy}-e^{-iy}}{2i} \ \$$ intrinsically that suggests the result we wish to obtain for the right side of the identity equation. A proof becomes a matter of arriving at a particular "target" expression. (I don't know that I'd call it "cheating" exactly, as Michael Hartley remarks, so much as it is "aiming" to produce a result that isn't clearly motivated from its premise).

Upon adding the two sine terms, the rest becomes a matter of making a specific association and then choosing to impose a factor of $$\ 2 \$$ because that will get you the cosine factor you are after:

$$\frac{e^{ \ ix} \ - \ e^{ \ -ix}}{2i} \ + \ \frac{e^{ \ iy} \ - \ e^{ \ -iy}}{2i} \ \ = \ \ \frac{e^{ \ ix} \ + \ e^{ \ iy} \ - \ e^{ \ -ix} \ - \ e^{ \ -iy}}{2i} \ \ ;$$ we decide to compare this numerator with the result of multiplying two binomials $$( \ e^{ \ i·\alpha} \ - \ e^{ \ -i·\alpha} \ ) \ · \ ( \ e^{ \ i·\beta} \ + \ e^{ \ -i·\beta} \ ) \ \ = \ \ e^{ \ i·(\alpha + \beta)} \ + \ e^{ \ i·(\alpha - \beta)} \ - \ e^{ \ -i·(\alpha + \beta)} \ - \ e^{ \ -i·(\alpha - \beta)} \ \ ;$$

we then identify $$\ x \ = \ \alpha + \ \beta \$$ and $$\ y \ = \ \alpha - \ \beta \$$ and solve the implied system of equations to obtain

$$2·\alpha \ \ = \ \ x \ + \ y \ \ , \ \ 2·\beta \ \ = \ \ x \ - \ y$$

$$\Rightarrow \ \ \frac{e^{ \ ix} \ - \ e^{ \ -ix}}{2i} \ + \ \frac{e^{ \ iy} \ - \ e^{ \ -iy}}{2i} \ \ = \ \ \frac{( \ e^{ \ i·\alpha} - e^{ \ -i·\alpha} \ ) \ · \ ( \ e^{ \ i·\beta} + e^{ \ -i·\beta} \ )}{2i}$$ $$= \ \ \frac{ e^{ \ i·(x + y)/2} - e^{ \ -i·(x + y)/2} }{2i} \ · \ 2 \ · \ \frac{ e^{ \ i·(x - y)/2} + e^{ \ -i·(x - y)/2} }{2} \ \ ;$$
and thus to our intended trigonometric identity. (It isn't as much of a "rabbit-out-of-top-hat" proof as some you'll see -- such as introducing a zero/one and turning it into a pair of "canceling" terms/factors -- but this does show why the identity is usually demonstrated by the use of complex numbers going "right-to-left".)

We can do something a bit better "motivated", but it calls for more application of trigonometry. If we add two numbers with unit modulus, we will generally obtain a sum with non-unit modulus, $$\ e^{ \ ix} + e^{ \ iy} \ = \ s·e^{ \ i·\theta} \ \ .$$ On the Argand diagram, this would appear as a triangle as shown in the figure below. The included angle between the vectors representing these numbers is $$\ \pi - (y - x) \ \ ,$$ so the Law of Cosines gives us the modulus of the sum as $$s^2 \ \ = \ \ 1^2 \ + \ 1^2 \ - \ 2·1·1·\cos( \ \pi - [y - x] \ ) \ \ = \ \ 2 \ · \ [ \ 1 \ + \ \cos( y - x ) \ ] \ \ ,$$ which the "cosine-squared" identity $$\ \cos^2 \phi \ = \ \frac12·[ \ 1 + \cos(2 \phi) \ ] \$$ allows us to write as $$\ s^2 \ = \ \ 2 \ · \ 2·\cos^2 \left( \frac{y - x}{2} \right) \ \Rightarrow \ s \ = \ 2·\cos \left( \frac{y - x}{2} \right) \ \ .$$

So our sum to this point is $$\ e^{ \ ix} + e^{ \ iy} \ = \ 2·\cos \left( \frac{y - x}{2} \right)·e^{ \ i·(x + z)} \ \ .$$ We note that our triangle is isosceles, so we have $$\ \pi - [y - x] + z + z \ = \ \pi \ \Rightarrow \ z \ = \ \frac{y - x}{2} \ \Rightarrow \ x + z \ = \ \frac{x + y}{2} \ \ .$$ Because cosine is an even-symmetry function, we have $$\ \cos \left( \frac{y - x}{2} \right) \ = \ \cos \left( \frac{x - y}{2} \right) \ \ ,$$ so we may now write our sum as $$e^{ \ ix} + e^{ \ iy} \ \ = \ \ (\cos x \ + \ \cos y) \ + \ i·(\sin x \ + \ \sin y)$$ $$= \ \ 2·\cos \left( \frac{x - y}{2} \right) \ · \ \left[ \ \cos \left( \frac{x + y}{2} \right) \ + \ i·\sin \left( \frac{x + y}{2} \right) \ \right] \ \ .$$

By identifying the real and imaginary parts of this sum, we at last obtain a "two-fer" of trigonometric identities: $$\cos x \ + \ \cos y \ \ = \ \ 2 \ · \ \cos \left( \frac{x + y}{2} \right) \ · \ \cos \left( \frac{x - y}{2} \right)$$ and $$\sin x \ + \ \sin y \ \ = \ \ 2 \ · \ \sin \left( \frac{x + y}{2} \right) \ · \ \cos \left( \frac{x - y}{2} \right) \ \ .$$ 