Re: How do I pick out the expression under a radical?
- To: mathgroup at smc.vnet.net
- Subject: [mg36243] Re: [mg36225] How do I pick out the expression under a radical?
- From: BobHanlon at aol.com
- Date: Wed, 28 Aug 2002 04:16:03 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 8/27/02 3:01:08 AM, asb4 at psu.edu writes:
> I'm a poor physicist trying to figure out how to sort out the
> "physical" from the "non-physical" solutions to a problem. To do
> that, I need to be able to look at an expression and pick out a
> subexpression, the part under the radical.
>
> For example, say I've got the expression
>
> a b x^2 + 5 x^3 + 5 Sqrt[4 - x^2]
>
> I'd like to pick out "4 - x^2", which would then tell me that x is
> between +/- 2. I know there has got to be an easy way to do it, but I
> can't find it.
>
Needs["Algebra`InequalitySolve`"];
expr = a b x^2+5 x^3+5 Sqrt[4-x^2];
InequalitySolve[#>=0, x]& /@
Cases[expr, Sqrt[x_] -> x, Infinity]
{-2 <= x <= 2}
Bob Hanlon
Chantilly, VA USA