# Rearranging exp terms

I have some problems rearranging exp terms to receive a cos or sin. I guess the solution is silly but I‘m not able to spot my mistake.

I know the solution (since i looked it up with wolfram alpha) has to be a $cos(\pi /4n)$ and therefore $\frac{e^{-j\pi/4n}+ e^{j\pi/4n}}{2}$. My goal is to rearrange the two terms $e^{j\pi/4n}+ e^{j7/4\pi n}$ (devided by 2) to receive this cos. One can clearly see that by removing the $\pi/4$ e term on both sites of $$e^{j\pi/4n}+ e^{j7/4\pi n} =e^{-j\pi/4n}+ e^{j\pi/4n}$$ this remains $$e^{j7/4\pi n}= e^{-j\pi/4n}$$ wich is true, when its drawn on the unit circle.

If one doesnt see this trick, my usual approach is to split an e term up to make the remaining two e terms conj. compex of each other. Like this $$e^{j\pi n} \cdot (e^{-j3\pi/4n}+ e^{j3\pi/4n})$$

Saddly this results (as far as I can see) in $(-1)^n\cdot 2cos(3/4\pi n)$, which is not what I‘ve expected. How comes this rearrangement doesn‘t result in the same cos? Is this rearrangement in some cases prohibited?

• "$−2\cos(3/4\pi n)$, which is complex" um, it's definitely real, unless your $n$ has an imaginary part. – Marcus Müller Aug 30 '18 at 6:50
• Oh yeah I see. Have to rewritet this. Thanks! – Mr.Sh4nnon Aug 30 '18 at 6:51

## 2 Answers

If I understand correctly, you're trying to show the following equality:

$$e^{jn\pi/4}+e^{j7n\pi/4}=2\cos(n\pi/4)\tag{1}$$

Note that $e^{\pm jn2\pi}=1$, $n\in\mathbb{Z}$, so you have

$$e^{j7n\pi/4}=e^{j7n\pi/4}e^{-jn2\pi}=e^{-jn\pi/4}\tag{2}$$

and plugging this into Eq. $(1)$ gives you the desired result.

EDIT (answering your comment):

$$e^{jn\pi/4}+e^{j7n\pi/4}=e^{j8n\pi /4}\big(e^{jn\pi/4}+e^{-jn\pi/4}\big)=e^{jn\pi/4}+e^{-jn\pi/4}\tag{3}$$

because $e^{j8n\pi /4}=e^{j2n\pi}=1$.

Your result is also correct because

$$(-1)^n\cos(3\pi n/4)=\cos(n\pi)\cos(3\pi n/4)=\\=\frac12\big(\cos(n\pi/4)+\cos(7n\pi/4)\big)=\cos(n\pi/4)\tag{4}$$

where I used $\cos(x)\cos(y)=\frac12\big(\cos(x-y)+\cos(x+y)\big)$ and $\cos(x\pm 2n\pi)=\cos(x)$.

• yes i know... thats what I already said. Im asking why I cant receive the same by factorization. Taking an e term out (which offten is then a -1 oder 1) and getting two remaining e terms which form a cos or sin. – Mr.Sh4nnon Aug 30 '18 at 14:16
• @Mr.Sh4nnon: OK, see my edit. – Matt L. Aug 30 '18 at 14:36
• thank you! thats what I was looking for. Still I‘m wondering, was mine false? And if so why? As far as I can see (-1)^ncos(3/4pin) is not the same as cos(pi/4*n) – Mr.Sh4nnon Aug 30 '18 at 14:39
• @Mr.Sh4nnon: Yours is correct too, see my new edit. – Matt L. Aug 30 '18 at 14:48
• ou... shouldn‘t have trusted wolfran alpha. of course, I see it know. Thanks a lot! – Mr.Sh4nnon Aug 30 '18 at 14:51

Hint:

1. So you have proved that

$$\exp\left({j\frac \pi4 n}\right)+ \exp\left({j\frac{7\pi} 4 n}\right) =\exp\left({-j\frac \pi4 n}\right)+ \exp\left({j\frac \pi4 n}\right)$$

2. The second derivation does results in the same answer as well. It is not prohibited but one would want to simplify things here. It does not help factorizing with a factor $$\exp({j\pi n})$$ because $$\exp({j\pi n}) = \left(-1\right)^n$$ and not $$-1$$. But one could factor by $$\exp({j2\pi n})$$ for instance since $$\exp({j2\pi n}) = 1$$. With this in mind:

$$\exp\left({j\frac\pi4n}\right)+ \exp\left({j\frac{7\pi}{4}n}\right)={\exp\left({j2\pi n}\right)}\cdot\left[\underbrace{\exp\left(-j\frac{7\pi}{4}n\right)}_{\exp\left(j\frac{\pi}{4}n\right)}+ \exp\left(-j\frac{1\pi}{4}n\right)\right]$$

And the two forms are identical.

• thank you. @Matt L. already pointed that out. Guess case closed – Mr.Sh4nnon Aug 30 '18 at 15:12
• Good that you edited the $-1$ with $(-1)^n$. – Gilles Aug 30 '18 at 15:15
{"ft_lang_label":"__label__en","ft_lang_prob":0.884744,"math_prob":0.99805176,"size":1019,"snap":"2021-04-2021-17","text_gpt3_token_len":358,"char_repetition_ratio":0.14679803,"word_repetition_ratio":0.0,"special_character_ratio":0.3346418,"punctuation_ratio":0.055084746,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99991703,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-04-13T02:05:25Z\",\"WARC-Record-ID\":\"<urn:uuid:62b872fd-6022-4187-b951-ace418b9c27e>\",\"Content-Length\":\"180306\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:31b320d5-1459-454c-a777-763cb3cade7a>\",\"WARC-Concurrent-To\":\"<urn:uuid:dcaa2f0c-f685-4491-9d46-5a7607aba2c8>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://dsp.stackexchange.com/questions/51616/rearranging-exp-terms/51634\",\"WARC-Payload-Digest\":\"sha1:J7G3FD5E5IKVAXJGZWVY2UUKD4S6PS2Q\",\"WARC-Block-Digest\":\"sha1:T6HAY7SH3P63P2C5BOIISWT3SB6IIOPA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-17/CC-MAIN-2021-17_segments_1618038071212.27_warc_CC-MAIN-20210413000853-20210413030853-00492.warc.gz\"}"}