The solution set of $\cos(x) + \cos(y) - \cos(x + y) = 0$ looks like an ellipse. Is it actually an ellipse, and if so, is there a way of writing down its equation (without any trig functions)?

What motivates this is the following example. The solution set of $\cos(x) - \cos(3x + 2y) = 0$ looks like two straight lines, and indeed we can determine the equations of those lines.

$$ \begin{align} \cos(x) &= \cos(3x + 2y) \\ \implies x &= \pm (3x + 2y) \\ \implies x + y &= 0 \text{ or } 2x + y = 0 \end{align} $$

Can we do a similar thing for the first equation?

  • 8
    $\begingroup$ Completely unrelated, but that is one of the coolest graphs I've ever seen $\endgroup$ – imulsion Jun 23 '15 at 19:32
  • $\begingroup$ $cos(x)+cos(y)$ may be transormed into multiplication, using the identity. $\endgroup$ – hyperkahler Jun 23 '15 at 19:33
  • 1
    $\begingroup$ An obvious approach would be to expand $\cos(x+y)=\cos(x)\cos(y)-\sin(x)\sin(y)$, then rewrite $\sin$ in terms of $\cos$ using $\cos^2+\sin^2=1$ and substituting $t=\cos x, s=\cos y$. This should transform this into a degree $4$ polynomial in $t, s$, which might turn out to be an ellipse equation squared with some luck.. just a guess. $\endgroup$ – Damian Reding Jun 23 '15 at 19:37
  • $\begingroup$ The graph you linked looks like a bunch of ellipses: have you tried graphing $\cos(x) + \cos(y) - \cos(x + y) = z$? Maybe its an agglomeration of cones and the z=0 plane cuts the cones (since ellipses are conic sections). Just my $0.02. $\endgroup$ – K. Rmth Jun 23 '15 at 19:50
  • 23
    $\begingroup$ Level curves close to a local maximum or a local minimum tend to look like ellipses, simply because the level curves of the second-order Taylor polynomial, which approximates the function, are ellipses. (At least "usually", i.e., in the positive or negative definite case, not the semidefinite case). $\endgroup$ – Hans Lundmark Jun 23 '15 at 20:39

It looks like an ellipse because the isocurves of any smooth surface look like an ellipse in the vicinity of an extremum !

Indeed, by Taylor's development in 2D,

$$f(x,y)=f(a,b)+\frac{\partial f}{\partial x}(x-a)+\frac{\partial f}{\partial y}(y-b)\\ +\frac12\frac{\partial^2 f}{\partial x^2}(x-a)^2+\frac{\partial^2 f}{\partial x\partial y}(x-a)(y-b)+\frac12\frac{\partial^2 f}{\partial y^2}(y-b)^2\cdots$$

This development shows that in the vicinity of an ordinary point, a smooth surface usually behaves like a plane because the linear terms dominate, and isocurves are approximately straight lines.

But when the first derivatives are zero, the next order terms, the quadratic ones, enter into play and the behavior becomes that of a quadric. The isocurve $f(x,y)=F$ is approximately of the form

$$A(x-a)^2+2B(x-a)(y-b)+C(y-b)^2=D,$$ an ellipse centered at $(a,b)$. (Provided that the quadratic form is positive-definite, i.e. not a saddle point.)

The closer you get to the extremum, the more you get an exact ellipse. The effect is more pronounced and the curves more symmetric when the third order derivatives are small.

enter image description here

In the case of the given trigonometric function, translating the coordinates to $(\pi,-\pi)$, to bring a maximum at the origin, we get


Then the Taylor development up to fourth order yields

$$z\approx 3-x^2-xy-y^2+\frac{x^4}{12}+\frac{x^3y}6+\frac{x^2y^2}4+\frac{xy^3}6+\frac{y^4}{12}.$$

The plot below shows you the isocurve $z=0$ computed with the quadric (brownish) and quartic (pinkish) approximations; the latter is indistinguishable from the true curve, a quasi-ellipse.

enter image description here

  • $\begingroup$ Well put - that's a very nice insight. $\endgroup$ – nbubis Jun 25 '15 at 14:18
  • $\begingroup$ I think you forgot a $2$ factor in your first Taylor developpement, this should be $\frac{\partial ^2 f}{\partial x \partial y}(x-a)(y-b)$ (and nice answer by the way !) $\endgroup$ – user171326 Aug 18 '16 at 8:16
  • $\begingroup$ @N.H.: you are right, that smells the hasty copy/paste. Now fixed. $\endgroup$ – Yves Daoust Aug 18 '16 at 8:31

Using the sum-to-product formula for cosine

$$ \cos s + \cos t = 2\cos \tfrac{s+t}{2}\cos \tfrac{s-t}{2} = \cos (s+t)$$

this is a great time to do that 45 degree rotation $u = \tfrac{s+t}{2}:, v=\tfrac{s-t}{2}, s+t = 2u$

$$ 2\cos u\cos v = \cos 2u \hspace{0.25in}\text{or}\hspace{0.25in} \bbox[5px,border:2px solid #F5A029]{2\cos v = \frac{\cos 2u}{\cos u}}$$

Wolfram Alpha doens't offer much simplification beyond this.

import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

x = 2*np.pi*np.arange(-1,1,0.01)
y = 2*np.pi*np.arange(-1,1,0.01)
z = np.cos(x[...,None]) + np.cos(y[None,...]) - np.cos(x[...,None]+y[None,...])

They are definitely not ellipses:

enter image description here

Alternatives plots from Wolfram Alpha. Somehow the level sets must interpolate between the "ellipses" and the "bow-ties".

enter image description here

Amoebas and Coamoebas

Using Demoivre identity $\cos \theta + i \sin \theta = e^{i\theta}$ we can instead consider the equation in complex numbers:

$$ e^{ix} + e^{iy} - e^{i(x+y)} = z + w - zw = 1 - (z-1)(w-1) = 0$$

The set of points $(z,w) \in \mathbb{C}^2$ satisfying this equation is not an algebraic variety. The log of the norms are what is known as an amoeba.

$$ \log: (z,w) \mapsto (\log |z|, \log|w|) \hspace{0.25in}\text{for}\hspace{0.25in} (z,w) \in \{ (z,w):z + w - zw\} $$

The angles of the solutions to this equation are known as the coamoeba

$$ \arg: (|z|e^{i\theta},|w|e^{i\phi}) \mapsto (\theta, \phi) \hspace{0.25in}\text{for}\hspace{0.25in} (z,w) \in \{ (z,w):z + w - zw\} $$

enter image description here

See What is an Amoeba in the Notices of the American Mathematical Society. Or the Master's thesis of Masahito Yamazaki Brane Tilings and their Applications

enter image description here

  • 1
    $\begingroup$ @johnmangual, Rewriting your double angle formula, $2\cos u\cos v=2\cos^2u-1$ is quadratic in $\cos u$ and $\cos v,$ but not in $x$ and $y.$ Shouldn't this be enough? $\endgroup$ – John Molokach Jun 24 '15 at 2:58

Your equation is not an ellipse, or even a family of ellipses. Ellipses are graphs given by a quadratic relation in $$Ax^2+Bxy+Cy^2+Dx+Ex+F=0.$$ Your equation, using Taylor Expansion (for $k\to\infty$), is $$\sum _{n=0}^k\frac{\left(-1\right)^n\left(x^{2n}+y^{2n}\right)}{\left(2n\right)!}=\sum _{n=0}^k\frac{\left(-1\right)^n\left(x+y\right)^{2n}}{\left(2n\right)!},$$ which is only quadratic for $k=1,$ and incidentally the graph for $k=1$ is not an ellipse but the hyperbola $xy+1=0.$ As a related note, a near duplicate of your graph using an ellipse is $$\left(x-\pi \right)^2+\left(x-\pi \right)\left(y-\pi \right)+\left(y-\pi \right)^2-\sqrt{19}=0.$$ But by inspection we see the curvature of the graphs are not equal. enter image description hereenter image description here

In fact, here is an animation showing the polynomial relations for $k=0$ to $k=20.$

enter image description here

The "ellipses" occur along the lines $y=\pm x.$

Also, as conjectured my @MathGemini in the above comments, your graph could be an agglomeration of cones in $(x,y,z),$ where $$z=\cos x+\cos y-\cos(x+y).$$ This is not the case, however because the surface you get is one of periodic maxima and minima, which is the expected behavior given by the equation.


(This is the surface and its intersection with the $xy$ plane viewed from the positive $z-$axis.)

enter image description here

(This is the surface and its intersection with the $xy$ plane viewed from $x>0,y>0,z>0.$)

enter image description here

(This is the surface and its intersection with the $xy$ plane viewed from below the $xy-$plane.)


They are not ellipses.

To prove this, consider the closed curve lying above and directly to the right of the origin. Since the given equation is symmetric between $x$ and $y$, this curve is symmetric about the line $y=x$. Thus, if it is an ellipse, its minor axis must line on the line $y=x$. Now, it is easy to check that the points $$ (\pi,\pi) \pm \alpha (1,1) \qquad\text{and}\qquad (\pi,\pi) \pm \beta (-1,1), $$ lie on this curve, where $\alpha = \cos^{-1}\!\!\left(\dfrac{-1+\sqrt{3}}{2}\right)$ and $\beta = \dfrac{2\pi}{3}$, so these would have to be the endpoints of the major and minor axes. However, in this case, the point $$ (x,y) \;=\; (\pi,\pi) + \frac{\alpha}{\sqrt{2}}(1,1) + \frac{\beta}{\sqrt{2}}(-1,1) $$ would also have to lie on the ellipse, and it doesn't. In particular, $$ \cos(x) + \cos(y) -\cos(x+y) \;\approx\; -1.906 \;\ne\; 0. $$ for these values of $x$ and $y$.

  • 3
    $\begingroup$ +1 for actually proving it's not an ellipse, rather than just stating it. $\endgroup$ – A. Rex Jun 26 '15 at 4:01

For the record, the substitution $t=\cos x, s=\cos y$ leads to $2st(s+t) + 1 = 2(s^2+t^2+st)$ with $s, t$ ranging over $[-1, 1]$. We now need some algebraic geometer to recognize this equation...


we have $$\begin{align} 0 &= \cos x +\cos y -\cos(x + y)\\ &=\cos x +\cos y -\cos x \cos y+ \sin x \sin y\\ &=(1-\cos x)\cos y+\sin x \sin y+\cos x\\ &=2\sin^2 (x/2)\cos y+2\sin(x/2)\cos(x/2)\sin y + \cos x\\ &=2\sin(x/2)\left(\sin (x/2)\cos y+\cos(x/2)\sin y)\right)+\cos x\\ &=2\sin(x/2)\sin (x/2 + y)+\cos x\\ \end{align} $$

therefore $$y=-\frac x2-\sin^{-1}\left(\frac{\cos x}{2\sin (x/2)}\right)+2k\pi,-\frac x2 +\sin^{-1} \left(\frac{\cos x}{2\sin (x/2)}\right)+2k\pi + \pi .\tag 1 $$

when i graphed $(1),$ what i see kind of ellipses all running parallel to the line $y = -x/2.$


@Mr Spock: You can go from $\cos(x)+\cos(y)=\cos(x+y)$ to a rational function (you ask about it!) via identities $$\tan (\frac x2)=t$$$$\tan (\frac y2)=s$$ $$\tan (\frac {x+y}{2})=\frac{t+s}{1-ts}$$ from which you have $$\cos (x)=\frac{1-t^2}{1+t^2}$$ $$\cos (y)=\frac{1-s^2}{1+s^2}$$ Since $$\tan (\frac{x+y}{2})=\frac{t+s}{1-ts}$$ it follows $$\cos (x+y)=\frac {(1-ts)^2-(t+s)^2}{(1-ts)^2+(t+s)^2}=\frac{(1+t+s-ts)(1-t-s-ts)}{1+t^2s^2+t^2+s^2}$$ Thus $$2(1-t^2s^2)(1+t^2s^2+t^2+s^2)= (1+t^2)(1+s^2)[(1-ts)^2-(t+s)^2]$$
In contour plots below you can see the silhouetted “ellipses”.

enter image description here


Due to symmetry in x,y we can do 45 deg rotation to bring "ellipse" axes along $ x$ and $y$. Let use rotationally transform $ x_1 = x-y, y_1 = x+y $ and ignore scaling of axes.

The contour is of a topography of hills and valleys.

Near to "Col" points ( flatter place to rest during mountaineering) between "ellipse" centers level curves more hyperbolic with saddle points.

At higher altitudes they are more elliptic and intersection ovals appear to be ellipses but indeed they are not so.

Ellipses are not periodic, meaning they have a one time appearance in the entire $x,y$ interval $ -\infty< x < \infty, -\infty< y < \infty $ of dimension 2.

But the given curves are an infinite degree polynomial trigonometric array whose dimension cannot be two as it is for a conic section.

This fact alone justifies to its instant recognition to being other than a conic section.

From the exact equation you have given a second degree approximation around its center can lead you to an ellipse, as per the following second degree approximation.


$ \cos x + \cos y = \pm \cos (x+y) $ , including negative sign if you shift

attention to the hyperboloid side of contour as well.

$ \cos x \approx. 1 - x^2/2 ,\cos y \approx 1 - y^2/2 ,\cos (x+y) \approx 1 - (x+y)^2/2 $ respectively simplify to

$ x^2 + y^2 + x\, y =1 $ and $ x\, y + 1 =0 $ . By taking 3,4,5 number of terms the 'ellipse' or 'hyperbola' can be approximated. So what you now see are a higher order ellipses/hyperbolas.

With respect to the oval center it looks like an ellipse. With respect to a center point of ovals as center you notice that..

the hyperbola look-like profile is ignored as, perhaps people look at the more round profile only. Different viewpoint centers are attached in the last illustration for level plots of $ \cos x + \cos y $.


As a relevant aside I can also mention..

$$ \cos a \cos b = \cos c , \cosh\, a \cosh \,b = \cosh \,c $$ which are non-linear Non-Euclidean generalizations to linear Euclidean geometry also have their smaller degree approximation leading to the Pythagoras:

$$ a^2 + b^2 = c^2 $$

So by this token supposing you had asked " Why does $ \cosh x + \cosh y = \cosh(x+y) $ look like a hyperbola? ", the discussion would run, imho along similar lines.


After rotating the graph by $45^\circ$, shifting it in the $y$ direction to centralize a unit curve about the origin, and rescaling $x$ and $y$, the unit curve of the graph can be made to look pretty much like the circle $x^2+y^2=1$. The equation of the graph becomes $$\cos\alpha y=\frac12\sec\beta x-\cos\beta x,$$where $\alpha=\frac23\pi$ and $\beta=\arccos(\frac12\sqrt3-\frac12).$ Obviously, this isn't the unit circle, as can be checked by looking at the Taylor expansion, say for small $x$ to order $x^2$. But it does pass through the points $(\pm1,0)$ and $(0,\pm1)$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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