(* Examples of solving equations/finding roots *) (* Simply paste each one at the Mathemtica prompt *) (* Get a symbolic answer. Analytical solution *) Solve[x^2 - 1 == 0, x] Solve[ {x^2 + y^2 ==1, x + y ==0 }, {x, y}] (* Same, but get a numerical value of the answer *) NSolve[ {x^2 + y^2 ==1, x + y ==0 }, {x, y}] (* find the sum of the above solutions, x+ y *) x + y /. % (* Good for polynomials, should give you all the roots *) NSolve[ {x^2 - 1 == 0}, x ] (* No analytical/symbolic solution *) Solve[Cos[x] == x, x] NSolve[Cos[x] == x, x] (* But you can get an answer using a "full-fledged" (Newton's) numerical method *) (* You will need to specify a starting point (1 in the example below) *) (* for the iterations. *) FindRoot[Cos[x] == x, {x, 1} ] (* If there is more than one root, the algorithm will most likely *) (* converge (if it all ) to a root nearest to the starting point. *) (* Try out a few different starting points *) (* It is always a good idea to plot the function first to see what *) (* to expect *) FindRoot[Sin[1/x] == 0.5, {x, 0.1}]