Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

These functions are equal. But I don't understand why.

$$a \leftrightarrow f(x) =|\cos(2\pi x)|^2$$

$$b \leftrightarrow f(x) = \dfrac{\cos(4\pi x)}{2} + 0.5$$

Which results both in this plot:


share|cite|improve this question
up vote 14 down vote accepted

They are the same because $$|\cos(x)|^2=\cos^2(x)=\frac{1+\cos(2x)}{2}=\frac{\cos(2x)}{2}+\frac{1}{2}.$$ (Note that the absolute value doesn't do anything, because of the square; i.e., $x^2=|x|^2$ for any $x$.) See here. This can be derived as follows:

For any $x$ and $y$, we have $$\cos(x+y)=\cos(x)\cos(y)-\sin(x)\sin(y).$$ Thus, $$\cos(2x)=\cos^2(x)-\sin^2(x)$$ $$\cos(2x)=\cos^2(x)-(1-\cos^2(x))$$ $$\cos(2x)=2\cos^2(x)-1$$ and therefore $$\cos^2(x)=\frac{1+\cos(2x)}{2}$$

Here is another, more direct derivation, using complex exponential definition of cosine: $$\cos^2(x)=\left(\frac{e^{ix}+e^{-ix}}{2}\right)^2=\frac{(e^{ix})^2+2(e^{ix})(e^{-ix})+(e^{-ix})^2}{4}=$$ $$\frac{e^{i(2x)}+e^{-i(2x)}+2}{4}=\frac{\cos(2x)+1}{2}$$

share|cite|improve this answer
Thanks. I can accept, but not +1... "An error has occurred - please retry your request" I already tried 5 times. – Martijn Courteaux Jun 27 '11 at 8:51
@Martijn: Hmm, that's a bit odd. I guess try refreshing the page, or restarting your browser? If it doesn't work, don't worry about it, one upvote is not much in the grand scheme of things :) – Zev Chonoles Jun 27 '11 at 8:53
Really strange, I restarted the browser already. I can't down vote as well (just to try ;)). – Martijn Courteaux Jun 27 '11 at 8:57
Aha, succeeded. I logged out from the site, and logged in again. Now, I can see my upvote was registered, but I was unable to see it. – Martijn Courteaux Jun 27 '11 at 9:00
Another way to see they are equal is to consider the derivative of their difference. It's zero, so the difference is a constant, and the constant can be found by considering the difference at any convenient value such as x=0. – tzs Jun 27 '11 at 11:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.