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

  • #1
158
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.
 

Answers and Replies

  • #2
104
0
Have you tried it without the curly braces on the x at the end?
 
  • #3
158
6
Have you tried it without the curly braces on the x at the end?
yes I get an error code.
 
  • #4
104
0
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:
  • #5
DrClaude
Mentor
7,384
3,638
Yes, follow Mugged's advice and use FindRoot. You also have to use an uppercase C: Cos[x]
 

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

Replies
3
Views
3K
Replies
4
Views
1K
Replies
4
Views
3K
  • Last Post
Replies
5
Views
4K
Replies
1
Views
726
Replies
6
Views
3K
Replies
20
Views
14K
Top