Re: from range restriction to domain restriction
- To: mathgroup at smc.vnet.net
- Subject: [mg72606] Re: [mg72590] from range restriction to domain restriction
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 12 Jan 2007 05:09:35 -0500 (EST)
- Reply-to: hanlonr at cox.net
Reduce[Sqrt[x]>=0||Sqrt[x]<0,x]
x >= 0
Plot[Evaluate[Piecewise[{{Sqrt[x],
Reduce[Sqrt[x]>=0||Sqrt[x]<0,x]}}]],
{x,-5,5},PlotStyle->Red];
Bob Hanlon
---- Chris Chiasson <chris at chiasson.name> wrote:
> If I wanted to ensure that Sqrt[x] was always a real number, perhaps
> as a condition on Piecewise, I would say Im@Sqrt@x==0 (or
> Element[Sqrt@x,Reals], but Mathematica doesn't like to simplify that).
> In my real case, x isn't a symbol - and it comes from the output of
> some other commands. However, I also know that Element[x,Reals], so I
> was wondering if there is a way to make Mathematica do the following:
>
> (part of) input:
> Im@Sqrt@x==0
>
> output:
> x>0
>
> If someone knows how to do this (other than the obvious Cases +
> pattern transformation), I would appreciate being told how. Thank you.
>
> --
> http://chris.chiasson.name/
>