Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

Tags:
  1. Mar 22, 2014 #1
    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.
     
  2. jcsd
  3. Mar 22, 2014 #2
    Have you tried it without the curly braces on the x at the end?
     
  4. Mar 22, 2014 #3
    yes I get an error code.
     
  5. Mar 22, 2014 #4
    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: Mar 22, 2014
  6. Mar 22, 2014 #5

    DrClaude

    User Avatar

    Staff: Mentor

    Yes, follow Mugged's advice and use FindRoot. You also have to use an uppercase C: Cos[x]
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: How to solve Solve x-2cosx=0 in mathematica
Loading...