# If we restrict cosine to only where it satisfies a linear property, will it create ellipses?

On another forum, someone asked if cosine was linear. I remarked, of course not! We know already that

$$\cos(x+y) = \cos x \cos y - \sin x \sin y$$

If it were linear, we would need $$\cos(x+y) = \cos x + \cos y$$ So, I decided to graph it.

Inside each $2\pi$ square, the graph looks very much like an ellipse. But, I am more of a combinatorist, and I do not have much intuition for how to check how "ellipse-like" it is.

How would one check? Is there a substitution that could be used?

Here is the link to the Wolframalpha plot:

Wolframalpha Plot

• For the part about "why doesn't the locus contain these lines": because $\cos(2\pi+y)=\cos y$ whereas $\cos (2\pi)+\cos y=1+\cos y$. – Saucy O'Path Aug 23 '18 at 21:25
• Linearity would mean $\forall \alpha,\beta \cos(\alpha x + \beta y)=\alpha\cos x + \beta \cos y$, actually. – edmz Aug 23 '18 at 21:32
• I would love to see more questions like this on this site! It’s a sincere curious and interesting phenomenon that we can investigate as a community, not another workbook problem. – gen-z ready to perish Aug 23 '18 at 23:09
• Your sentence beginning with the word "obviously" is wrong. The points $(2\pi m, 2\pi n)$ do not solve your equation; for those points, the left side of your equation is $1$ but the right side is $2$. – symplectomorphic Aug 24 '18 at 4:45
• The easiest way to argue that $\cos$ isn't linear is to point out $\cos(0) = 1$. – leftaroundabout Aug 24 '18 at 13:49

The graph suggests that we may simplify the problem by rotating the coordinate axes in the anti-clockwise direction (or clockwise, but let's just choose to go anti-clockwise).

(Indeed, note that for every solution $(a, b)$, $(b, a)$ is also a solution. So the graph is symmetric along the line $x=y$. Rotating thus makes the solution in the new basis symmetric along x=0)

The forward transformations are:

$$x' = x\cos(\frac{\pi }{4}) + y\sin(\frac{\pi }{4})$$ $$y' = -x\sin(\frac{\pi }{4}) + y\cos(\frac{\pi }{4})$$

This transforms the equation as you gave it to: $$\cos(\sqrt{2}y') = \cos\left ( \frac{1}{\sqrt{2}} \left ( x'+y' \right ) \right ) + \cos\left ( \frac{1}{\sqrt{2}} \left ( -x'+y' \right ) \right )$$

We derive the equation of the ellipse immediately above the origin, assuming it exists, and show that it contains points not in the solution set to the above equation.

We first determine the semi-minor's length by finding the first two positive solutions to the above equation where $x'=0$, i.e. to:

$$\cos(\sqrt{2}y') = 2\cos\left ( \frac{1}{\sqrt{2}} y' \right )$$

Skipping the details, the two sought-for solutions are $(x'_{1}, y_{1}')= (0, \sqrt{2} \cos^{-1}\left ( \frac{1-\sqrt{3}}{2} \right ))$ and $(x'_{2}, y'_{2}) = (0, \sqrt{2}\left (2\pi - \cos^{-1}\left ( \frac{1-\sqrt{3}}{2} \right ) \right ))$. The semi minor's length is therefore $\sqrt{2}\left ( \cos^{-1}\left ( \frac{1-\sqrt{3}}{2} \right )- \pi \right )$.

We continue the same process for the semi-major axis. This gives $(x_{3}', y_{3}') = (\frac{2\sqrt{2}\pi }{3}, 0)$ and $(x_{4}', y_{4}') = (-\frac{2\sqrt{2}\pi }{3}, 0)$.

The equation of the ellipse above the origin, in the rotated coordinate system is:

$$\left ( \frac{3x'}{2\sqrt{2}\pi } \right ) ^{2} + \left ( \frac{y'-\sqrt{2}\pi }{\sqrt{2}\left ( \cos^{-1}\left ( \frac{1-\sqrt{3}}{2} \right )- \pi \right) } \right )^{2} = 1$$

By trying different values of $x'$ and $y'$, one can check that the above does not always imply

$$\cos(\sqrt{2}y') = \cos\left ( \frac{1}{\sqrt{2}} \left ( x'+y' \right ) \right ) + \cos\left ( \frac{1}{\sqrt{2}} \left ( -x'+y' \right ) \right )$$

So the curves you see in the picture aren't exactly rotated ellipses. But they sure are close.

So the question is about the shape of $\{ (x,y)\in[0,2\pi]^2 : \cos(x+y)=\cos(x)+\cos(y) \}$.

The equation can be written as $2\cos^2\left(\frac{x+y}{2}\right)-1 = 2\cos\left(\frac{x+y}{2}\right)\cos\left(\frac{x-y}{2}\right)$, so the problem boils down to studying the shape of $\cos^2(v)+\cos(u)\cos(v)=\frac{1}{2}$ for $u\in[0,\pi]$ and $v\in\left[0,\frac{\pi}{2}\right]$. By Maclaurin series and interpolation, such locus is extremely close to the ellipse having equation $$3v^2+u^2=\frac{7\pi^2}{16}$$ which is represented by the purple curve below:

where the external blue curve is part of the locus $\cos^2(v)+\cos(u)\cos(v)=\frac{1}{2}$.
On its turn the blue curve is tangent to the ellipse $3v^2+u^2=\frac{4\pi^2}{9}$.

By comparing the enclosed areas we should get a non-trivial inequality for a complete elliptic integral.

• “The equation can . . .” How come? – gen-z ready to perish Aug 23 '18 at 23:15
• @ChaseRyanTaylor: basic trigonometry. $\cos(x)=2\cos^2\frac{x}{2}-1$ and $\cos(x)+\cos(y)=2\cos\frac{x+y}{2}\cos\frac{x-y}{2}$. – Jack D'Aurizio Aug 23 '18 at 23:16
• This answer is very detailed, and I wanted to mark it as an answer, but the other answer finds the ellipse with geometry that has the same major and minor axes and rules it out in a bit of an easier fashion. Your response definitely lets me know that it would be extremely nontrivial to evaluate how close or far it is from that ellipse (you say non-trivial, and I will take your word for it, haha) – InterstellarProbe Aug 24 '18 at 11:40
• @InterstellarProbe: by comparing the terms $\frac{7\pi^2}{16}$ and $\frac{4\pi^2}{9}$ we may say that we are close to an ellipse with an error $<1.6\%$. – Jack D'Aurizio Aug 24 '18 at 16:56