# Get Solution range of NSolve

I have a numerical solution and when I solve it with NSolve, and substitue the results in an expression, I get something like:

1 + x + x^2 if 0 < x< 10


I want to plot the expression above in a Manipulate. Is there any way of getting the range {0, 10} in above dynamically, so I can only expose valid values?

• I don't see how you can get something like 1 + x + x^2 if 0 < x< 10, since it's not syntactially valid. Problems with code require the code for diagnosis, or an MWE exhibiting the equivalent behavior. – Michael E2 Jul 8 at 0:11
• When I stared at my results a bit more, I asked myself the same question. :) here is the original problem: mathematica.stackexchange.com/questions/225485/… – Shb Jul 8 at 0:20

What you are seeing is a ConditionalExpression.

expr = ConditionalExpression[1 + x + x^2, 0 < x < 10]


To convert the condition to a List

(List @@ expr[[-1]])[[{2, 1, 3}]]

(* {x, 0, 10} *)


or

(List @@ expr[[-1]])[[{1, 3}]]

(* {0, 10} *)