Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

        List @@ Roots[x τ (-1 + τ^2) (-1 + 
\!\(\*SubsuperscriptBox[\(b\), \(1\), \(2\)]\)) (-1 + τ^2 
\!\(\*SubsuperscriptBox[\(b\), \(1\), \(2\)]\)) (Subscript[b, 1] - 
      Subscript[c, 1]) (τ^2 Subscript[b, 1] - Subscript[c, 
      1]) (-1 + 
      Subscript[b, 1] Subscript[c, 1]) (-1 + τ^2 Subscript[b, 1]
        Subscript[c, 1]) (x τ - Subscript[c, 
      2]) (τ^2 Subscript[b, 1] - x Subscript[c, 2]) (-1 + 
      x τ Subscript[c, 2]) (-x + τ^2 Subscript[b, 1]
        Subscript[c, 2]) (x τ - Subscript[c, 
      3]) (τ^2 Subscript[b, 1] - x Subscript[c, 3]) (-1 + 
      x τ Subscript[c, 3]) (-x + τ^2 Subscript[b, 1]
        Subscript[c, 3]) == 0, x]   


    {x == 0, x == Subscript[c, 2]/τ, 
 x == (τ^2 Subscript[b, 1])/Subscript[c, 2], 
 x == 1/(τ Subscript[c, 2]), 
 x == τ^2 Subscript[b, 1] Subscript[c, 2], 
 x == Subscript[c, 3]/τ, 
 x == (τ^2 Subscript[b, 1])/Subscript[c, 3], 
 x == 1/(τ Subscript[c, 3]), 
 x == τ^2 Subscript[b, 1] Subscript[c, 3]}.

I would like to have a list of the roots without the x== in each entry. How can I remove this?

share|improve this question

marked as duplicate by Mr.Wizard Jul 19 '13 at 0:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Calling your list lst use e.g. lst[[All, 2]]. – Artes Jul 18 '13 at 20:01
Thanks! That exactly answered my question. – Tyrone Jul 18 '13 at 20:03
up vote 4 down vote accepted

I think Artes will not elaborate and since questions should have answers posted as such, I will volunteer to try to write one.

Let's call your result lst. In Mathematica all things, however rendered, are functions wrapped in functions. Those equality signs? Actually a function called Equal.

To extract some part of an output it helps to know exactly how the expression we're dealing with looks and for this purpose we have FullForm.

lst // FullForm



Artes retrieved all elements on the first level and the second element on the second level using Part (lst[[All, 2]]). We can easily see from the FullForm that this is possible. Your list is just a list of Equal elements and the relevant part is the second argument to those list elements.

Most of all, peaking at the expression with FullForm often makes it very easy to find patterns that match what you want to extract, you could do

lst /. Equal[__, x__] -> x

and you would get the same thing.

share|improve this answer

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