How to solve Solve x-2cosx=0 in mathematica

  • Context: Mathematica 
  • Thread starter Thread starter TitoSmooth
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 4K views
TitoSmooth
Messages
158
Reaction score
6
Solve[x - 2 cos[x] == 0, {x}]


this is my imput but i get an error. What is the command to solve trig functions in mathematica

thanks. I searched online but no avail.
 
Physics news on Phys.org
Have you tried it without the curly braces on the x at the end?
 
Mugged said:
Have you tried it without the curly braces on the x at the end?
yes I get an error code.
 
Ok you probably should try the find root function.

FindRoot[x == 2Cos[x], {x,0}]

the 0 is an initial starting point in the numerical solver. I haven't used mathematica in a while but the problem might be that the solve function looks for an exact solution while your equation is transcendental...so no exact solution exists. mathematica's findroot or nsolve functions should work to numerically solve your equation.

Post back your result.
 
Last edited:
Yes, follow Mugged's advice and use FindRoot. You also have to use an uppercase C: Cos[x]