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

  • Context: Mathematica 
  • Thread starter Thread starter TitoSmooth
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The equation x - 2 Cos[x] == 0 cannot be solved using the Solve function in Mathematica due to its transcendental nature, which lacks an exact solution. Instead, users should utilize the FindRoot function, specifically FindRoot[x == 2 Cos[x], {x, 0}], where '0' serves as the initial starting point for the numerical solver. It is crucial to ensure that 'Cos' is capitalized in the command to avoid syntax errors.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of transcendental equations
  • Knowledge of numerical methods for solving equations
  • Basic understanding of trigonometric functions
NEXT STEPS
  • Explore the FindRoot function in Mathematica for numerical solutions
  • Learn about the NSolve function for alternative numerical solving methods
  • Study transcendental equations and their properties
  • Review Mathematica's documentation on trigonometric functions and their syntax
USEFUL FOR

Mathematica users, mathematicians, and students dealing with transcendental equations and numerical methods for solving mathematical problems.

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]
 

Similar threads

Replies
8
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K