Mathematica Stack Exchange is a question and answer site for users of Mathematica. 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

This question already has an answer here:

Why doesn't Mathematica solve x == Cos[x] properly?

Both Solve and NSolve fail with the message:

Solve::nsmet: This system cannot be solved with the methods available to Solve. >>

share|improve this question

marked as duplicate by Artes, Sjoerd C. de Vries, bobthechemist, R. M. Dec 30 '13 at 15:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

NSolve works when restricted to reals: NSolve[x==Cos[x],x,Reals] gives {{x -> 0.739085}}. – Rahul Oct 22 '12 at 6:58
The "Dottie number" is not known to have an explicit closed form. – J. M. Oct 22 '12 at 7:12
Strongly related: Can Reduce really not solve for x here? – Mr.Wizard Oct 22 '12 at 11:25
up vote 8 down vote accepted

In this case you might use:


One can see that this is valid only over the interval (-1, 1) which is probably why Solve does not give an answer:

Plot[{Cos@x, ArcCos@x}, {x, -Pi, Pi}, PlotStyle -> Thick]

Mathematica graphics

A few methods to find the intersection in the illustration:

N @ FindInstance[x == Cos[x], x]

N @ Reduce[{x == Cos[x], -1 < x < 1}, x]

FindRoot[x == Cos[x], {x, 0}]
{{x -> 0.739085}}

x == 0.739085

{x -> 0.739085}

I would be remiss not to point out that my plot above is only looking at real values. One can see that as implemented ArcCos does handle the full circle:

Plot[{Cos @ ArcCos @ x, x + 1}, {x, -20, 20}]

Mathematica graphics

share|improve this answer
Thx, I just wanted to know why Mathematica didn't know to use arccos... – Tom Wellington Oct 22 '12 at 7:09
Of note is that Reduce[] returns a Root[] object, which can then be evaluated to arbitrary precision. – J. M. Oct 22 '12 at 7:19
@J.M. I get x == Root[{-Cos[#1] + #1 &, 0.73908513321516064165}] where the "Dottie number" has 20.6 digits of precision. How can that be accurately evaluated to arbitrary precision? (Assuming that you mean arbitrary in the general sense.) – Mr.Wizard Oct 22 '12 at 7:31
@Mr.Wizard The 0.739... in the argument is not used to compute the value of the root, only to isolate it from any other potential roots. In this sense, it is similar to the index for normal polynomial Root objects, as returned by say, Solve[x^5 -x-1 == 0, x]. Of course, the root can be computed to arbitrary precision using the -Cos[#1] + #1 &. – Mark McClure Oct 22 '12 at 10:32
@TomWellington This answer gives more detailed discussion of the issue… – Artes Oct 22 '12 at 10:35

Another possibility :

FixedPoint[Cos[#] &, 0.5]

(* 0.739085 *)
share|improve this answer
You don't need &: FixedPoint[Cos, 0.5] – Mr.Wizard Oct 22 '12 at 7:06
@Mr.Wizard Thanks, I was aware of this but thought to make the answer easier to generalize. – b.gatessucks Oct 22 '12 at 7:11

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