Message Boards Message Boards

0
|
2700 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Use the Exponent function on a symbolic monomial?

Posted 6 years ago

Hi,

I have a problem with the function Exponent.

Lets say I have a symbolic monomial -

m = x1 * x2 * x3 * Abs[x1^2 * x2 * x3^2]*Conjugate[x1]

Using the Exponent function I get:

Exponent[m,x1] = 1
Exponent[m,Conjugate[x1]]=1
Exponent[m,Abs[x1]] = 0

The last one is clearly wrong. Is there a way to overcome it? Or a related question: How can I decompose

Expand Abs[x1*x2*x3] to Abs[x1]*Abs[x2]*Abs[x3] ?
POSTED BY: idan dekel

Exponent is working as advertized, as Abs[x1] does not appear sintactically in the expanded form of m. If you need to distribute Abs over products, here is a couple of ways using replacement rules:

Abs[x1^2*x2*x3^2] /. 
 HoldPattern[Abs[Times[x__]]] :> Times @@ Map[Abs, {x}]
Abs[x1^2*x2*x3^2] //. Abs[x1_*x2_] :> Abs[x1] Abs[x2]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract