MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Real roots and other assumptions...


This does work

Select[{(1 - E)^(1/3)}, Im[#1] == 0 & ]
{}

as does this:

Select[{(2. + I)*(2. - I)}, Im[#1] == 0 & ]

which gives the odd-looking result
{5.+0.I}

and the original problem:

Solve[(x - 1)*(x^2 + 1) == 0, x]

{{x -> -I}, {x -> I}, {x -> 1}}

but

Select[x /. Solve[(x - 1)*(x^2 + 1) == 0, x], Im[#1] == 0 & ]
{1}
--

Kevin J. McCann
Johns Hopkins University APL


Allan Hayes <hay at haystack.demon.co.uk> wrote in message
news:7s796h$htf at smc.vnet.net...
>
> Janus Wesenberg <jaw at imf.au.dk> wrote in message
> news:7s3p1u$ck5 at smc.vnet.net...
> > Hi,
> > I keep encountering problems of the following type when using
mathematica:
> > I want to solve some equation(s) under some assumptions about the
> unknown(s),
> > e.g. find the real roots of (x-1)(x^2+1).
> > I've tried Solve[{Im[x]==0,(x-1)(x^2+1)==0},x]] for the above problem,
but
> that
> > doesn't get me anywhere.
> >
> > Is there a general way to let Mathematica know about such additional
> bounds as
> > non-complexness etc? -- if so I would be happy to know it!
> >
> > Janus Wesenberg
> > Student of Physics.
> >
> > PS. I'm using Mathematica from a HP-UX 10 system, and the notebook
> interface
> > have grave difficulties handling large expressions (they scrambled to
> complete
> > nonsense). The local system administrator just says "Use the text
access",
> but
> > does anyone know how to make the notebook interface work?
> >
>
> Janus,
>
> Cases[Solve[(x - 1)(x^2 + 1) == 0, x],
>   s_ /; FreeQ[s, _Complex]]
>
>     {{x -> 1}}
>
> But there could be problems with precision and also with rules like
>
>     x -> (a - I)(a + I)      (*which may, depending on a, give real
> solutions but would be excluded*)
>
>     x-> (1-e)^{1/3)        (* gives a complex solution, but would not be
> excuded*)
>
<snip-snap>




  • Prev by Date: Re: Limits of multi-var. functions
  • Next by Date: Select cell
  • Previous by thread: Re: Real roots and other assumptions...
  • Next by thread: Re: Real roots and other assumptions...