How to extract expression from ConditionalExpression
You can use Normal
, ConditionalExpression
is not explicitly mentioned there but documentation says it deals with special forms.
p1 = y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]} // First
ConditionalExpression[-Sqrt[1 - x - x^2], 1/2 (-1 - Sqrt[5]) < x < 1/2 (-1 + Sqrt[5])]
Normal @ p1
-Sqrt[1 - x - x^2]
You can forcely specify the condition to be True
:
Solve[x^2 + y^2 + x == 1, y, Reals] /.
ConditionalExpression[e_, _] :> ConditionalExpression[e, True]
{{y -> -Sqrt[1 - x - x^2]}, {y -> Sqrt[1 - x - x^2]}}
But you should always keep it in mind that this is not an identical transformation.