Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I know $x^3-3 x+1=0$ has three roots that can be expressed in trigonometric form: $\{2\sin(10^\circ),\,-2\cos(20^\circ),\,2\cos(40^\circ)\}$.

How can I get this result with Mathematica?

share|improve this question
3  
Use e.g. ComplexExpand@(x /. Solve[x^3 - 3 x + 1 == 0, x]). This question concerns the same issue as mathematica.stackexchange.com/questions/17269/… – Artes Jan 25 at 15:31
1  
Another related question : mathematica.stackexchange.com/questions/14726/… – Artes Jan 25 at 15:43
1  
Thanks. But I want Cos[π/9] + Sqrt[3] Sin[π/9] can be simplify to 2 Cos[(2 π)/9] – maplematica Jan 25 at 15:58

2 Answers

up vote 1 down vote accepted

You can apply an identity directly:

ComplexExpand@
  Solve[x^3 - 3 x + 1 == 0, x] /. (A_: 1) Cos[t_] + (B_: 1) Sin[t_] :>
   Sqrt[A^2 + B^2] Cos[t - ArcTan[A, B]]

(* {{x -> 2 Cos[(2 π)/9]}, {x -> 2 Sin[π/18]}, {x -> -2 Cos[π/9]}} *)
share|improve this answer
(ComplexExpand@Solve[x^3 - 3 x + 1 == 0, x] /. Pi/9 -> t // TrigFactor) /. t -> Pi/9

(*{{x -> 2 Cos[(2 π)/9]}, {x -> 2 Sin[π/18]}, {x -> -2 Cos[π/9]}}*)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.