I am trying to simplify a complicated expression which involves $\log$ of sum of $e^{i x_{i}}$ terms, and I found out that using PowerExpand it gets greatly simplified. But I know that PowerExpand actually makes assumption of $x_i>0$, which is not true for all of my $x_{i}$'s in the expression.

So my question is if I am assumptions about specific $x_{i}$'s does PowerExpand make assumptions about remaining $x_{j}>0$ or not ? I really don't want any other assumptions in my expression. I found the documentation of PowerExpand very sloppily written and am worried about it's technical details.


2 Answers 2


If you know x1 and x2 are positive, but are not sure about x3, you could use the 2-arg version of PowerExpand:

PowerExpand[Sqrt[x1^2] + Sqrt[x2^2] + Sqrt[x3^2], {x1, x2}]

x1 + x2 + Sqrt[x3^2]

Note that the x3 term is left alone. On the other hand, you can use explicit assumptions for x1 and x2 only:

PowerExpand[Sqrt[x1^2] + Sqrt[x2^2] + Sqrt[x3^2], Assumptions->x1<0&&x2>0]

-x1 + x2 + E^(I π Floor[1/2 - Arg[x3]/π]) x3

In this case, PowerExpand expands all 3 terms, but the x3 term is more complicated because no assumptions have been given for this variable.

In general, PowerExpand with no assumptions can give results that are not correct in general. On the other hand, if you include a non-default Assumptions option, then the output of PowerExpand will be correct (for the given assumptions).

  • $\begingroup$ One thing I noticed, and would like to point out here, Assuming[...,PowerExpand[]] doesn't work but PowerExpand[..., Assumptions -> ...] works. Is it deliberately done ? $\endgroup$
    – Jaswin
    Apr 3, 2019 at 16:56
  • $\begingroup$ @Jaswin I think the only way to get Assuming to work is to use something like Assuming[x < 0, PowerExpand[Sqrt[x^2], Assumptions->$Assumptions]] $\endgroup$
    – Carl Woll
    Apr 3, 2019 at 17:09

The documentation states

The transformations made by PowerExpand are correct in general only if c is an integer or a and b are positive real numbers.

but that does not mean that in any particluar case, if they are not positive real numbers, that the transformation is not correct. If you are concerned about possible incorrect transformation, then, in general, you can take the original expression and the transformed expression and substitute sufficiently random numerical values and see if they produce sufficiently different numerical value results or not.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.