MathGroup Archive 2005

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

Search the Archive

Re: positive square root

  • To: mathgroup at
  • Subject: [mg58700] Re: positive square root
  • From: Peter Pein <petsie at>
  • Date: Fri, 15 Jul 2005 03:02:15 -0400 (EDT)
  • References: <db57ne$4no$>
  • Sender: owner-wri-mathgroup at

paulvonhippel at yahoo schrieb:
> I work in a world where the square root is always a positive number.
> But Mathematica allows for the possibility of negative square roots.
> Two questions arise:
> (1) Is there a way to tell Mathematica that I'm only interested in
> positive square roots?
> (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when
> Mathematica echoes this, it puts the Abs function *under* the radical,
> so it looks like Sqrt[Abs[z]]. Is this a bug in the display?
Hi Paul,

I don't think so. It is just in general easier, to evaluate Sqrt[Abs[z]]
than Abs[Sqrt[z]]:

Assuming[(x | y) \[Element] Reals,
   {Abs[ComplexExpand[Sqrt[x + I*y]]],(*sqrt first*)
    ComplexExpand[Sqrt[Abs[x + I*y]]]}]](*abs first*)
{(x^2 + y^2)^(1/4)*
  Abs[Cos[(1/2)*ArcTan[x, y]] + I*Sin[(1/2)*ArcTan[x, y]]],
x^2 + y^2)^(1/4)}

These are of course equivalent:

SameQ @@ Simplify[ComplexExpand[%]]

Peter Pein

  • Prev by Date: Re: positive square root
  • Next by Date: Re: D[...] change in 5.1
  • Previous by thread: Re: positive square root
  • Next by thread: Re: positive square root