Skip to main content
Tweeted twitter.com/#!/StackMma/status/410676305748033536
added 17 characters in body; edited tags; edited title
Source Link
István Zachar
  • 47.2k
  • 20
  • 145
  • 293

how How to extract expression from conditional expressionConditionalExpression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]}

outputs:

{ConditionalExpression[-Sqrt[1 - x - x^2], 
{ConditionalExpression[-Sqrt[1 - x - x^2], 
  1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])]}

I want to get the -Sqrt[1 - x - x^2] out of therethe conditional expression and assign it to a variable. I don't care about the conditions, I'm aware of them and need the expression for use out of the Conditional ExpressionConditionalExpression. How How do I do that?

I tried list commands combinations (flattenFlatten, first.First, etc.) but they don't work with this.

  Am I just supposed to copy-paste?

how to extract expression from conditional expression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]}

outputs:

{ConditionalExpression[-Sqrt[1 - x - x^2], 
  1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])]}

I want to get the -Sqrt[1 - x - x^2] out of there and assign it to a variable. I don't care about the conditions, I'm aware of them and need the expression for use out of the Conditional Expression. How do I do that?

I tried list commands combinations (flatten, first..) but they don't work with this.

  Am I just supposed to copy-paste?

How to extract expression from ConditionalExpression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]}
{ConditionalExpression[-Sqrt[1 - x - x^2], 
   1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])]}

I want to get the -Sqrt[1 - x - x^2] out of the conditional expression and assign it to a variable. I don't care about the conditions, I'm aware of them and need the expression for use out of the ConditionalExpression. How do I do that?

I tried list commands combinations (Flatten, First, etc.) but they don't work with this. Am I just supposed to copy-paste?

Source Link
Edoz
  • 275
  • 2
  • 5

how to extract expression from conditional expression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]}

outputs:

{ConditionalExpression[-Sqrt[1 - x - x^2], 
  1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])]}

I want to get the -Sqrt[1 - x - x^2] out of there and assign it to a variable. I don't care about the conditions, I'm aware of them and need the expression for use out of the Conditional Expression. How do I do that?

I tried list commands combinations (flatten, first..) but they don't work with this.

Am I just supposed to copy-paste?