[Date Index] [Thread Index] [Author Index]
Re: "Nice" complex form
On 9/9/13 at 12:06 AM, sam.takoy at yahoo.com 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:= Sqrt[a - 4] // LeafCount Out= 7 In:= I Sqrt[4 - a] // LeafCount Out= 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]] to I Sqrt[4 - a] you will have to create a special function to do that. Perhaps the following will suffice: In:= Sqrt[a - 4] /. Sqrt[a_] -> I Sqrt[-a] Out= 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.