{"id":315,"date":"2016-05-19T07:22:37","date_gmt":"2016-05-19T07:22:37","guid":{"rendered":"http:\/\/florian-roemer.de\/blog\/?p=315"},"modified":"2016-05-19T07:30:43","modified_gmt":"2016-05-19T07:30:43","slug":"extended-trigonometric-pythagorean-identities-the-proof","status":"publish","type":"post","link":"https:\/\/florian-roemer.de\/blog\/extended-trigonometric-pythagorean-identities-the-proof\/","title":{"rendered":"Extended Trigonometric Pythagorean Identities: The Proof"},"content":{"rendered":"<p>I recently posted on<a href=\"http:\/\/florian-roemer.de\/blog\/trigonometric-pythagorean-identity-extended\/\"> Extended Trigonometric Pythagorean Identities<\/a> and a <a href=\"http:\/\/florian-roemer.de\/blog\/trigonometric-pythagorean-identity-supercharged\/\">&#8220;supercharged&#8221; version of them<\/a>, which allows to simplify certain sums of shifted sine functions raised to integer powers. In particular, the claim was that<\/p>\n<p>$$\\sum_{n=0}^{N-1} \\sin^2\\left(x+n\\frac{\\pi}{N}\\right) = \\frac{N}{2}$$<\/p>\n<p>or more generally for any integer $k$ and $N\\geq k+1$:<\/p>\n<p>$$\\sum_{n=0}^{N-1} \\sin^{2k}\\left(x+n\\frac{\\pi}{N}\\right) =<br \/>\nN \\frac{(2k)!}{(k!)^2 2^{2k}} = \\frac{N}{\\sqrt{\\pi}} \\frac{\\Gamma(k+1\/2)}{\\Gamma(k+1)} $$<\/p>\n<p>However, in the initial TPI post, I struggled a bit with the proof. It took a while to realize that it is actually quite simple using (a) the algebraic series, i.e.,<\/p>\n<p>$$ \\sum_{n=0}^{N-1} q^n = \\frac{1-q^N}{1-q}$$<\/p>\n<p>for any $q \\in \\compl_{\\neq 0,1}$ and (b) the fact that $\\sin(x) = \\frac{1}{2\\jmath}\\left({\\rm e}^{\\jmath x} &#8211; {\\rm e}^{-\\jmath x}\\right)$. Let us use this relation to prove the following Lemma:<\/p>\n<p><strong>Lemma 1<\/strong>: <em>For any $M \\in \\mathbb{Z}$, we have<\/em><\/p>\n<p>$$ \\sum_{n=0}^{N-1}{\\rm e}^{\\jmath \\frac{2\\pi}{N} \\cdot M \\cdot n} =<br \/>\n\\begin{cases}<br \/>\nN &amp; M = k \\cdot N, \\, k\\in \\mathbb{Z} \\\\<br \/>\n0 &amp; {\\rm otherwise}.<br \/>\n\\end{cases}$$<\/p>\n<p><strong>Proof<\/strong>: The proof is simple by realizing that the sum is in fact an arithmetic series with $q={\\rm e}^{\\jmath \\frac{2\\pi}{N} \\cdot M}$. Obviously, if $M$ is an integer multiple of $N$ we have $q=1$ and the sum is equal to $N$. Otherwise, by the above identity, the series is equal to<\/p>\n<p>$$\\frac{1-{\\rm e}^{\\jmath 2\\pi \\cdot M}}{1-{\\rm e}^{\\jmath \\frac{2\\pi}{N} \\cdot M}}<br \/>\n= \\frac{{\\rm e}^{\\jmath \\pi \\cdot M}}{{\\rm e}^{\\jmath \\frac{\\pi}{N} \\cdot M}}\\cdot<br \/>\n\\frac{{\\rm e}^{-\\jmath \\pi \\cdot M}-{\\rm e}^{\\jmath \\pi \\cdot M}}{{\\rm e}^{-\\jmath \\frac{\\pi}{N} \\cdot M}-{\\rm e}^{\\jmath \\frac{\\pi}{N} \\cdot M}}= {\\rm e}^{\\jmath \\frac{\\pi}{N}M(N-1)} \\cdot \\frac{\\sin(\\pi M)}{\\sin(\\frac{\\pi}{N}M)} = 0,<br \/>\n$$<br \/>\nsince the enumerator is zero (and the denominator is not).<\/p>\n<p>Piece of cake.<\/p>\n<p>Now, we can proceed to prove the TPI for $2k=2$:<\/p>\n<p>\\begin{align}<br \/>\n\\sum_{n=0}^{N-1} \\sin^2\\left(x+n\\frac{\\pi}{N}\\right)<br \/>\n&amp; = \\sum_{n=0}^{N-1}\u00a0 \\left(\\frac{1}{2\\jmath} {\\rm e}^{\\jmath(x+n\\frac{\\pi}{N})}-\u00a0\\frac{1}{2\\jmath} {\\rm e}^{-\\jmath(x+n\\frac{\\pi}{N})}\\right)^2\\\\<br \/>\n&amp; = -\\frac{1}{4}\\sum_{n=0}^{N-1} {\\rm e}^{2\\jmath(x+n\\frac{\\pi}{N})} + {\\rm e}^{-2\\jmath(x+n\\frac{\\pi}{N})} &#8211; 2 {\\rm e}^{\\jmath(x+n\\frac{\\pi}{N})-\\jmath(x+n\\frac{\\pi}{N})} \\\\<br \/>\n&amp; = -\\frac{1}{4} {\\rm e}^{2\\jmath x} \\sum_{n=0}^{N-1} {\\rm e}^{\\jmath 2n\\frac{\\pi}{N}}<br \/>\n-\\frac{1}{4} {\\rm e}^{-2\\jmath x} \\sum_{n=0}^{N-1} {\\rm e}^{-\\jmath 2n\\frac{\\pi}{N}}<br \/>\n-\\frac{1}{4} \\sum_{n=0}^{N-1} (-2) \\\\<br \/>\n&amp; = -\\frac{1}{4} \\cdot 0 -\\frac{1}{4}\\cdot 0 -\\frac{1}{4}\\cdot(-2N) = \\frac{N}{2}<br \/>\n\\end{align}<\/p>\n<p>where we have used Lemma 1 for $M=1$ and $M=-1$ (which for the Lemma to work requires $M\\neq N$ and thus $N\\geq 2$). Isn&#8217;t that simple? I wonder why I didn&#8217;t see it earlier.<\/p>\n<p>Even better yet, this technique allows to extend the proof to other values of $k$. Let&#8217;s try $2k=4$:<\/p>\n<p>\\begin{align}<br \/>\n\\sum_{n=0}^{N-1} \\sin^4\\left(x+n\\frac{\\pi}{N}\\right)<br \/>\n&amp; = \\sum_{n=0}^{N-1}\u00a0 \\left(\\frac{1}{2\\jmath} {\\rm e}^{\\jmath(x+n\\frac{\\pi}{N})}-\u00a0\\frac{1}{2\\jmath} {\\rm e}^{-\\jmath(x+n\\frac{\\pi}{N})}\\right)^4\\\\<br \/>\n&amp; = \\frac{1}{16} \\sum_{n=0}^{N-1} {\\rm e}^{4 \\jmath(x+n\\frac{\\pi}{N})}<br \/>\n-4 {\\rm e}^{3\\jmath(x+n\\frac{\\pi}{N}) -\\jmath(x+n\\frac{\\pi}{N})}<br \/>\n+6 {\\rm e}^{2\\jmath(x+n\\frac{\\pi}{N}) -2 \\jmath(x+n\\frac{\\pi}{N})} \\\\ &amp;<br \/>\n-4 {\\rm e}^{\\jmath(x+n\\frac{\\pi}{N}) -3\\jmath(x+n\\frac{\\pi}{N})}<br \/>\n+ {\\rm e}^{-4 \\jmath(x+n\\frac{\\pi}{N})} \\\\<br \/>\n&amp; = \\frac{1}{16}{\\rm e}^{4 \\jmath x} \\sum_{n=0}^{N-1} {\\rm e}^{4 \\jmath n\\frac{\\pi}{N}}<br \/>\n&#8211; \\frac{4}{16}{\\rm e}^{2\\jmath x} \\sum_{n=0}^{N-1}{\\rm e}^{2 \\jmath n\\frac{\\pi}{N}}<br \/>\n+ \\frac{6}{16}\\sum_{n=0}^{N-1} {\\rm e}^{0} \\\\ &amp;<br \/>\n&#8211; \\frac{4}{16}{\\rm e}^{-2\\jmath x} \\sum_{n=0}^{N-1}{\\rm e}^{-2 \\jmath n\\frac{\\pi}{N}}<br \/>\n+ \\frac{1}{16}{\\rm e}^{-4 \\jmath x} \\sum_{n=0}^{N-1} {\\rm e}^{-4 \\jmath n\\frac{\\pi}{N}} \\\\<br \/>\n&amp; = \\frac{1}{16} \\cdot 0 &#8211; \\frac{4}{16} \\cdot 0 + \\frac{6}{16} \\cdot N &#8211; \\frac{4}{16} \\cdot 0 + \\frac{1}{16} \\cdot 0 = \\frac{3}{8} N,<br \/>\n\\end{align}<\/p>\n<p>where this time we have used Lemma 1 for $M=2, 1, -1, -2$ and thus need $N\\geq 3$. This already shows the pattern: The polynomic expansion creates mostly terms with vanishing sums except for the &#8220;middle&#8221; term where the exponents cancel. The coefficient in front of this term is $\\frac{1}{2^{2k}}$ (from the $\\frac{1}{2\\jmath}$ that comes with expanding the sine) times ${2k \\choose k}$ (from the binomial expansion). This explains where the constant $N \\cdot \\frac{(2k)!}{(k!)^2 2^{2k}}$ comes from.<\/p>\n<p>Formally, we have<\/p>\n<p>\\begin{align}<br \/>\n\\sum_{n=0}^{N-1} \\sin^{2k}\\left(x+n\\frac{\\pi}{N}\\right) &amp; =<br \/>\n\\sum_{n=0}^{N-1} \\left( \\frac{1}{2\\jmath}{\\rm e}^{\\jmath(x+n\\frac{\\pi}{N})}<br \/>\n&#8211; \\frac{1}{2\\jmath}{\\rm e}^{-\\jmath(x+n\\frac{\\pi}{N})} \\right)^{2k} \\\\<br \/>\n&amp; =<br \/>\n\\sum_{n=0}^{N-1} \\frac{1}{(2\\jmath)^{2k}} \\sum_{\\ell = 0}^{2k} {2k \\choose \\ell} (-1)^\\ell<br \/>\n{\\rm e}^{(2k-\\ell) \\jmath (x+n\\frac{\\pi}{N})}{\\rm e}^{-\\ell \\jmath (x+n\\frac{\\pi}{N})} \\\\<br \/>\n&amp; =<br \/>\n\\sum_{n=0}^{N-1} \\frac{(-1)^k}{2^{2k}} \\sum_{\\ell = 0}^{2k} (-1)^\\ell {2k \\choose \\ell}<br \/>\n{\\rm e}^{2(k-\\ell) \\jmath (x+n\\frac{\\pi}{N})}\\\\<br \/>\n&amp; = \\frac{(-1)^k}{2^{2k}} \\sum_{\\ell = 0}^{2k} (-1)^\\ell {2k \\choose \\ell}<br \/>\n{\\rm e}^{2(k-\\ell) \\jmath x} \\sum_{n=0}^{N-1}<br \/>\n{\\rm e}^{2(k-\\ell) \\jmath n\\frac{\\pi}{N}} \\\\<br \/>\n&amp; = \\frac{1}{2^{2k}} {2k \\choose k} N,<br \/>\n\\end{align}<\/p>\n<p>where in the last step all terms $\\ell \\neq k$ vanish due to Lemma 1 applied for $M=k, k-1, &#8230;, 1, -1, &#8230;, -k+1, -k$. This requires $N\\geq k+1$.<\/p>\n<p>Eh voila.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently posted on Extended Trigonometric Pythagorean Identities and a &#8220;supercharged&#8221; version of them, which allows to simplify certain sums of shifted sine functions raised to integer powers. In particular, the claim was that $$\\sum_{n=0}^{N-1} \\sin^2\\left(x+n\\frac{\\pi}{N}\\right) = \\frac{N}{2}$$ or more generally for any integer $k$ and $N\\geq k+1$: $$\\sum_{n=0}^{N-1} \\sin^{2k}\\left(x+n\\frac{\\pi}{N}\\right) = N \\frac{(2k)!}{(k!)^2 2^{2k}} = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/315"}],"collection":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":31,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/posts\/315\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/media?parent=315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/categories?post=315"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/florian-roemer.de\/blog\/wp-json\/wp\/v2\/tags?post=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}