There is an unique solution with $x$ being approximately $0.739085$. But is there also a closed-form solution?
-
2I wonder if it can be expressed in terms of the Lambert $W$-function, which some people would like to add to the list of closed forms. – Gerry Myerson Jun 23 '11 at 01:43
-
The solution is unique since $y=x$ intersects $y= \cos x$ only one time. – Jan 12 '13 at 18:33
-
@JoelReyesNoche: The other is a duplicate of this one. Check the dates. – user88595 Jun 27 '14 at 08:33
-
@user88595, sorry about that. I thought the proper procedure was to flag both; I should have just flagged the newer one. – JRN Jun 27 '14 at 13:34
-
1I believe there is no known way to write this solution in terms of the Lambert W function. – GEdgar Jul 02 '14 at 02:45
-
1Where there is a will there is usually a way. – Jay Nov 29 '18 at 18:13
-
1It has a unique real solution. Does it have a unique complex solution? – GEdgar Feb 23 '22 at 16:34
-
Would one like complex solutions to be added? – Тyma Gaidash Nov 25 '23 at 15:49
13 Answers
The equation in question is a transcendental equation. Apart of guessing, numerical or analytical methods, there is no way of solving the equation without using another transcendental function, and therefore argue in circles.
In this case, denote $g(x)=\cos x -x$, see that its derivative is negative with countable many zeros, and therefore $g$ is strictly decreasing, yielding that there is at most one solution to $g(x)=0$. Since $g(0)g(\pi/2)<0$ there is such a solution. Arbitrary precise approximations can be found using Newton, bisection, or false position method.
As user Myself commented, it is a challenge (not so hard) to prove that the sequence $x_{n+1}=\cos x_n, x_0 \in \Bbb{R}$ converges to the unique solution to $\cos x=x$.
Another related problem which I encountered last week when trying to help one of my friends for an exam is to find all continuous functions $f : \Bbb{R} \to \Bbb{R}$ with the property that $f(x)=f(\cos x)\ \forall x \in \Bbb{R}$.

- 23,381
-
1But, in my understanding, being transcendental does not imply that the equation cannot have a closed form solution? – corto Jun 22 '11 at 17:19
-
-
Some equations like $\sin x=x$ have solutions you can "put your hand on", in this case $x=0$. But this is just because we can guess them. – Beni Bogosel Jun 22 '11 at 17:25
-
Something like "An equation is said to be a closed-form solution if it solves a given problem in terms of functions and mathematical operations from a given generally accepted set." mathworld.wolfram.com – corto Jun 22 '11 at 17:26
-
-
What's the point of arguing it is trancedential? Fixed point of the exponent is also transcedential, but can be expressed with an integral, for instance. – Anixx Mar 04 '15 at 07:56
-
@Anixx Can you find the solution analytically? That is: write the solution without the aid of another equation or function. – Beni Bogosel Mar 04 '15 at 09:22
-
Without another function? What do u mean? The answer by giorgiomugnaini gives an analytic solution. – Anixx Mar 04 '15 at 09:41
-
An analytic solution can be approximated numerically. A closed form solution must contain a finite number of operations. A series or limit is not, in general, considered a closed form solution. See this article: http://en.wikipedia.org/wiki/Closed-form_expression I gugess it depends on the definition you accept (or not). Still, it costs less to use a fixed point algorithm in order to find the solution of $\cos x=x$, than to use a series using Bessel functions. – Beni Bogosel Mar 04 '15 at 09:48
-
-
2If you search "transcendental equations" on the Internet, I guess things will become more clear (look at the Wikipedia link). The idea is that in a transcendental equation you cannot derive a formula for the solution $x$ using only basic arithmetic operations. You may express $x$ using arithmetic operations involving series, Lambert's function, or Bessel functions, but these functions are by definition solutions to some equations we cannot solve explicitly. – Beni Bogosel Mar 04 '15 at 10:40
-
@BeniBogosel and algebra, and finite number of operations, afair, for OP's sake – Mark C Mar 18 '20 at 13:50
-
-
-
What is your proof that it cannot be solved "without using another transcendental function"? In any case, the wolfram article mentions that the solution is a transcendental number, maybe your standards of purity only allow the use of rational numbers? (pi is defined by sin x=0, just so you know). And btw, expressing the solution in terms of other transcendental functions needn't be arguing in circles, it can be a highly non-trivial statement. – Croqueta Mar 13 '24 at 08:24
Mathworld calls this the Dottie Number. The page makes no mention of existence/non-existence of "closed" form and I would guess it is still open.

- 29,772

- 82,206
Remembering the Kepler equation and its solution, the Dottie number can be analytically written as:
$$D = 2\sum_{n=0}^\infty \left( \frac{J_{4n+1}(4n+1)}{4n+1} - \frac{J_{4n+3}(4n+3)}{4n+3}\right)$$
where $J_{n}$ are the Bessel functions. Such series is convergent and can be evaluated numerically.
A proof and numerical evaluations are provided in :

- 1,416
-
1more likely a link to Omega constant (fixed point of exponent) and an integral form. – Anixx Mar 04 '15 at 09:51
-
1http://math.stackexchange.com/questions/227317/explaining-cos-infty/1175016#1175016 – Anixx Mar 04 '15 at 12:39
Here is a closed form I just found. Using Kepler’s Equation, the median of a beta distribution, and Inverse Beta Regularized $\text I^{-1}_z(a,b)$. Here is the closed form:
$$\boxed{\text{Dottie Number}=\text D=\sin^{-1}\left(1-2\text I^{-1}_\frac12\left(\frac 12,\frac 32\right)\right)}$$
from The Incomplete Beta function $\text B_z(a,b)$:
$$\text B_{\sin^2(z)}\left(\frac 12,\frac32\right)=z+\cos(z)\sin(z)$$
taking the inverse, and a bit of algebra to get the form above. Also using the Half Covered Sine:
$$\text I^{-1}_\frac12\left(\frac 12,\frac 32\right)=\text{hacoversin}(\text {D)}=\frac12(1-\sin(\text D))\implies \text D= {\text{hacoversin}}^{-1} \text I^{-1}_\frac12\left(\frac 12,\frac 32\right) $$
With an error of $10^{-179}$ in this numerical evaluation. This is a side post since there already is an accepted answer. Please correct me and give me feedback!
See explanation here

- 12,081
-
2
-
-
The factor 2 before the root is wrong (not needed) in your last comment. It should be $\sqrt{1-\left(2\text I^{-1}_\frac12\left(\frac 12,\frac 32\right)-1\right)^2}$ – Anixx May 20 '22 at 10:42
-
@Anixx Correct. I did not want to retype the mathjax, but you already did. Thanks. – Тyma Gaidash May 20 '22 at 20:47
-
1Try to plot
Log[InverseBetaRegularized[1/2, x, 3/2]]
and-1/x^0.889
, the graphics nearly coincide. – Anixx Oct 24 '22 at 07:13 -
As I know, there is no exact way to get the solution for $\cos(x)=x$. But, you can use Newton's Method to get an approximate answer:
Consider the function $f(x)=\cos x−x$
This gives us that $f'(x)=-\sin x-1$
Newton's Method states that $x_{\text{n+1}} = x_{\text{n}} - \dfrac{f(x_{\text{n}})}{f'(x_{\text{n}})}$
Then, just start at $x_{\text{0}}=1$ and repeat this method all over again, until you are satisfied. Don't forget that rounding numbers might lead to wrong answers!

- 1,007

- 89
It is very easy to show that the equation $\cos x = x$ has a unique solution. For example take $f(x) = x - \cos x$ and notice that $f'(x) = 1+\sin x \ge 0$ (equality holding in isolated points) so $f(x)$ is strictly increasing and hence the equation can have at most one solution. Since $f(x)>0$ for $x\ge 1$ and $f(x)<0$ for $x\le 0$, and the function is continuous, by the intermediate values theorem there exists one and only one solution $\bar x \in [0,1]$.
For this particular equation there is also a very nice numeric approximation. In fact $\bar x = \lim x_n$ where $x_{n+1} = \cos (x_n)$ is any iteration of the function $\cos x$. You can easily find the numeric value for $\bar x$ simply putting any number in your pocket calculator and pressing repeatedly the $\cos$ button. In fact $\bar x$ is the fixed point of the $\cos$ function and, (at least in $[0,1]$) the $\cos$ function is a contraction hence every iterated sequence converges to the unique fixed point.
I can also convince you that $\bar x$ is an exact solution to the equation $\cos x = x$. I think that you agree that $\sqrt[3]2$ is an exact solution of the equation $x^3=2$, don't you? Now notice what's going on here... one notices that the function $x^3$ is strictly increasing hence invertible. You give a name to the inverse function and call it: cubic root. Then you find an algorithm to compute the cubic root on your calculator. Isn't this the same thing we did with the function $f(x) = x-\cos x$?
By definition the number $q = \sqrt[3]2$ is the only real number such that $q^3=2$. Analogously, the number $\bar x$ is the only number such that $\bar x-\cos \bar x=0$.

- 21,447
Your equation cannot be solved in terms of elementary functions, elementary functions and Lambert W or elementary functions and Generalized Lambert W of Mezö et al.. It can be solved in terms of "Leal-functions" and possibly by Generalized Lambert W of [Castle 2018].
1.) Elementary functions, elementary numbers
$$\cos(x)=x$$ $$\frac{1}{2}e^{ix}+\frac{1}{2}e^{-ix}=x$$ $$\frac{1}{2}e^{ix}+\frac{1}{2}e^{-ix}-x=0$$ $$\frac{1}{2}(e^{ix})^2-xe^{ix}+\frac{1}{2}=0$$ $x\to\frac{t}{i}$: $$\frac{1}{2}(e^t)^2+ite^t+\frac{1}{2}=0$$
The function on the left-hand side of the latter equation is an algebraic function in dependence of both $t$ and $e^t$. Liouville proved that such kind of functions (over a complex domain without isolated points) don't have (partial) inverses that are elementary functions.
The equation is also an algebraic equation in dependence of both $t$ and $e^t$. Lin proved, assuming Schanuel's conjecture is true, that such kind of equations don't have solutions except $0$ that are elementary numbers.
How can we show that $A(z,e^z)$ and $A(\ln (z),z)$ have no elementary inverse?
2.) Lambert W, Generalized Lambert W
The latter equation also shows that the equation cannot be solved in terms of elementary functions and Lambert W or Generalized Lambert W of Mezö et. al. either. But possibly is it solvable in terms of Generalized Lambert W of [Castle 2018].
[Mezö 2017] Mezö, I.: On the structure of the solution set of a generalized Euler-Lambert equation. J. Math. Anal. Appl. 455 (2017) (1) 538-553
[Mezö/Baricz 2017] Mezö, I.; Baricz, A.: On the generalization of the Lambert W function. Transact. Amer. Math. Soc. 369 (2017) (11) 7917–7934 (On the generalization of the Lambert W function with applications in theoretical physics. 2015)
[Castle 2018] Castle, P.: Taylor series for generalized Lambert W functions. 2018
3.) "Leal-functions"
$$\cos(x)=x$$ $$\cos(x)-x=0$$ $x\to-t$: $$t+\cos(t)=0$$ $$t=\text{Lcos}_2(0)$$ $$x=-\text{Lcos}_2(0)$$

- 6,964
-
@TymaGaidash For mathematics, it's enough to describe a new function. So we can work with the cited representations now. I wrote what I found so far. My aim was to make these inverses better known. That could help to find someone who implements it. At the moment, everyone has to make an own implementation for themselves. – IV_ Dec 25 '22 at 16:49
-
@TymaGaidash You could help to try to find the relations between "Leal-functions" and InverseBetaRegularized function. – IV_ Dec 25 '22 at 16:59
I'm truth, there the above answers are correct, stating that the number currently has no closed form solution.
An old approximation that I came up with to $\cos$ can offer a decent approximation to the Dottie number however.
$$\sqrt[3.911]{\frac{1-x^2}{1+x^2}} \approx \cos{x}$$
Setting the above approximation $=x$ and solving can give a closed form solution that lies within 4 decimal points of the solution.
Not a closed form but a way to generate very good approximations of the Dottie number.
Since the solution is close to $\frac \pi 4$, we have for $$y=x-\cos(x)$$ $$y=\frac{\pi -2 \sqrt{2}}{4} +\left(1+\frac{1}{\sqrt{2}}\right) \left(x-\frac{\pi }{4}\right)+\frac{1}{\sqrt{2}}\sum_{n=2}^\infty\frac{\sin \left(\frac{\pi n}{2}\right)-\cos \left(\frac{\pi n}{2}\right)}{n!}\left(x-\frac{\pi }{4}\right)^n$$ Truncating to some order $O\left(\left(x-\frac{\pi }{4}\right)^n\right)$ and using series reversion, we should get things like $$x=\frac \pi 4+\frac{32 \left(11482+8119 \sqrt{2}\right) t}{\left(2+\sqrt{2}\right)^{11}}-\frac{16 \left(4756+3363 \sqrt{2}\right) t^2}{\left(2+\sqrt{2}\right)^{11}}+\frac{32 \left(5333+3771 \sqrt{2}\right) t^3}{3 \left(2+\sqrt{2}\right)^{11}}+O\left(t^4\right)$$ where $t=\frac{1}{4} \left(\sqrt{2}-2\right) \left(4 y+\pi -2 \sqrt{2}\right)$. Making $y=0$ and using this very truncated series would give $$x \sim 0.739085133238$$ to be compared to the exact $0.739085133215$
Playing with the $n$ of $O\left(\left(x-\frac{\pi }{4}\right)^n\right)$, we could get the following results $$\left( \begin{array}{cc} n & x_{(n)} \\ 1 & \color{red}{0.739}536133515238 \\ 2 & \color{red}{0.739}100520482138 \\ 3 & \color{red}{0.739085}585917040 \\ 4 & \color{red}{0.7390851}49503943 \\ 5 & \color{red}{0.739085133}811963 \\ 6 & \color{red}{0.7390851332}38222 \\ 7 & \color{red}{0.73908513321}6073 \\ 8 & \color{red}{0.7390851332151}98 \\ 9 & \color{red}{0.73908513321516}2 \\ 10 & \color{red}{0.739085133215161} \end{array} \right)$$
Edit
For the fun of it, using the $\large 1,400$ years old approximation $$\cos(x) \simeq\frac{\pi ^2-4x^2}{\pi ^2+x^2}\qquad \text{for} \qquad -\frac \pi 2 \leq x\leq\frac \pi 2$$ solving the cubic equation $$x^3+4 x^2+\pi ^2 x-\pi ^2=0$$ gives as an approximation $$x\sim -\frac{2}{3} \left(2+\sqrt{3 \pi ^2-16} \sinh \left(\frac{1}{3} \sinh ^{-1}\left(\frac{128-63 \pi ^2}{2 \left(3 \pi ^2-16\right)^{3/2}}\right)\right)\right)=0.738305$$ that is to say a relative error of $0.1$%.

- 260,315
-
That's pretty impressive for a polynomial approximation! True, Newton's method $x'=(\cos x+x\sin x)/(1+\sin x)$ converges much faster, but your solution avoids the use of trig function calls. – PM 2Ring Oct 28 '20 at 14:43
You could use cosine Taylor expansion and solve the polynomial $\sum_{i=0}^{n}(-1)^i \frac{x^{2i}}{(2i)!}-x=0$ For example; for n=1,2 you get the approximations $x=1,x=\sqrt{3}-1$.

- 31
-
This method is impractical, as polynomial roots do not all have a closed-form solution. Therefore, other numerical approaches would be needed (e.g. Newton's method), which can equally well be done with the original formulation $\cos x-x$. So there is no benefit. – Jam Jan 24 '20 at 15:34
I would say that it IS already in closed form... if we follow the definition given here :https://en.m.wikipedia.org/wiki/Closed-form_expression
since trigonometric functions are considered "well-known"... don't you agree?

- 259
-
-
You are right, $\cos(x)=x$ is an equation in closed form, it is an elementary equation. But the questioner asks for a closed-form solution (a solution in closed form) of that equation. – IV_ Aug 05 '22 at 16:10
My AskConstants "constant recognition" program at http://AskConstants.org proposed the explicit exact closed form
RealInverseSphericalBesselY [0, -1, 1],
where $0$ is the order and $1$ is the branch number.
This was subsequently proved in my article at https://arxiv.org/abs/2207.00707
-
2Sorry, you have not proved anything. Rayleigh's formulae (see Wikipedia page on Bessel functions) explicitly give $j_n(x)$ and $y_n(x)$ as rational functions of $\sin x,\cos x,x$, including $y_0(x)=-\frac{\cos x}x$. – Parcly Taxel Aug 05 '22 at 05:13
-
Please disclose your affiliation with AskConstants.org when referring to it, otherwise the post may be considered spam. See What makes something spam and when should I flag it? – robjohn Aug 10 '22 at 22:29
-
this can be really easy with the help of graphs. Draw the graphs of y= cosx and x=y. Intersection points on the graph will show the solutions.

- 577