MathGroup Archive 2013

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

Search the Archive

Re: "Nice" complex form

On 9/9/13 at 12:06 AM, sam.takoy at wrote:

>Can I get

>Assuming[a - 4 < 0, Sqrt[a - 4]]

>to "simplify" to

>I Sqrt[4 - a]

Given Mathematica by default considers expressions with lower
LeafCount as simpler and:

In[1]:= Sqrt[a - 4] // LeafCount

Out[1]= 7

In[2]:= I Sqrt[4 - a] // LeafCount

Out[2]= 13

the simplest answer to your question is you can't, i.e., there
isn't a built-in function to do this. So, if you want to transform

Assuming[a - 4 < 0, Sqrt[a - 4]]


I Sqrt[4 - a]

you will have to create a special function to do that. Perhaps
the following will suffice:

In[3]:= Sqrt[a - 4] /. Sqrt[a_] -> I Sqrt[-a]

Out[3]= I*Sqrt[4 - a]

Or possibly you could add a transformation rule to Simplify. But
this last certainly seems counter to the design of Simplify.

  • Prev by Date: DelayedRule assembly
  • Next by Date: Re: "Nice" complex form
  • Previous by thread: Re: "Nice" complex form
  • Next by thread: Re: "Nice" complex form