MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Solutions of an equation under complex form


Michaël_Monerau <mmonerau at gmail.com> wrote:
> Hello,
>
> I'm running into a little problem under Mathematica 5.0 but I'm sure
> people here will just take it as "too easy", but, well :) I just want
> the solutions of the equation :
>
> x^2 + x + 1 == 0
>
> under their complex form.
>
> So, I type :
>
> Solve [x^2 + x + 1 == 0, x]
>
> But I unfortunately get :
> { { {x -> -(-1)^(1/3) }, { x -> (-1)^(2/3) } } }
>
> And I'd prefer to obtain the more "readable" form :
> -1/2 + I*1/2*Sqrt[3], -1/2 - I*1/2*Sqrt[3]
>
> that I would get under another system for instance. What special function
> should I call to get this form under Mathematica ?

You can use ComplexExpand:

In[1]:= ComplexExpand//@Solve[x^2 + x + 1 == 0, x]

Out[1]= {{x -> -(1/2) - (I*Sqrt[3])/2}, {x -> -(1/2) + (I*Sqrt[3])/2}}

David Cantrell


  • Prev by Date: Re: pattern matching all list elements but last
  • Next by Date: Re: problems plotting a derivative
  • Previous by thread: Re: Solutions of an equation under complex form
  • Next by thread: Re: Solutions of an equation under complex form