2
$\begingroup$

My question is about an apparent failure of the function "FullSimplify" to simplify an easy algebraic expression.

This is the expression that I ask Mathematica to evaluate:

FullSimplify[Re[a^(I*b)] - Re[a^(-I*b)], Element[a, Reals] && a > 0 && Element[b, Reals]]

This should give the result 0. Instead Mathematica only restates my expression:

Re[a^(-I b) (-1 + a^(2 I b))]

Replacing a and b by actual numbers solves the problem.

What could be the cause of it? How to effectively use FullSimplify (and Simplify, Expand, Integrate and so...) with assumptions?

I read that the order of variables could play a role here, but I couldn't wrap my head around it.

I tried to check for similar problems on the website as well, but I couldn't find any answer that could explain this phenomenon.

Thanks in advance for your support.

$\endgroup$
  • 2
    $\begingroup$ Have you tried ComplexExpand[]? $\endgroup$ – J. M. will be back soon Jun 2 '15 at 15:33
  • $\begingroup$ It looks like you need to put ComplexExpand under Re[] : FullSimplify[Re[(a^(I*b) - a^(-I*b)) // ComplexExpand], Element[a, Reals] && a > 0 && Element[b, Reals]] $\endgroup$ – BlacKow Jun 2 '15 at 15:42
  • $\begingroup$ Thanks for the hint! I don't have my Mathematica copy right here but I'm gonna try it tomorrow! $\endgroup$ – Giovanni De Gaetano Jun 2 '15 at 17:08
  • $\begingroup$ It works! :) Thanks again! $\endgroup$ – Giovanni De Gaetano Jun 3 '15 at 6:35
2
$\begingroup$

As pointed out in the comments by "Guess who it is" and "BlacKow", the solution is to use the function ComplexExpand[], or to add ComplexExpand under Re[].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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