1
$\begingroup$

I have a seemingly simple simplification involving conjugates:

$Assumptions = Element[{a}, Reals];
FullSimplify[ x E^(I a) + Conjugate[x] E^(-I a)]

which merely outputs this,

E^(-I a) (E^(2 I a) x + Conjugate[x])

I would have expected the expression above to simplify to

2 Re[x E^(I a)]

In order to use ComplexExpand, one needs to explicitly convert every cplx variable into either Cartesian or polar form, which causes quite some extra labour:

expr = x E^(I a) + Conjugate[x] E^(-I a);
repToCart = {x -> xRE + I xIM};
repToCplx = {xRE -> Re[x], xIM -> Im[x]};
$Assumptions = Element[{a, xRE, xIM}, Reals];
Output = FullSimplify[expr /. repToCart] /. repToCplx

outputs this:

2 Cos[a] Re[x] - 2 Im[x] Sin[a]

This is indeed the same as this:

2 Re[x E^(I a)]

But it is

  1. More complicated
  2. Required quite some extra steps

Any tips on how to speed up the workflow here would be greatly appreciated :)

$\endgroup$
3
  • 1
    $\begingroup$ You can get the second expression with ComplexExpand[x E^(I a) + Conjugate[x] E^(-I a), {x}, TargetFunctions -> {Re, Im}]. $\endgroup$ Commented Nov 28, 2020 at 9:09
  • $\begingroup$ Thanks a lot, I was not aware of this wonderful shortcut ! This helps a lot. I would even have marked this comment as an accepted answer if it were an answer. $\endgroup$
    – Massimo
    Commented Nov 28, 2020 at 12:50
  • $\begingroup$ Go ahead and post an answer yourself then. $\endgroup$ Commented Nov 28, 2020 at 13:32

2 Answers 2

0
$\begingroup$

I cannot understand, why not to use ComplexExpand]. However, if not, try this:

expr = x E^(I a) + Conjugate[x] E^(-I a) /. x -> z + I*t;


Simplify[expr // ExpToTrig, {a, z, t} \[Element] Reals] /. {z -> 
   Re[x], t -> Im[x]}

(*   2 Cos[a] Re[x] - 2 Im[x] Sin[a] *)

Have fun!

$\endgroup$
0
$\begingroup$

Following up to the comment of b.gates.you.know.what, I think that is the most useful answer.

ComplexExpand[x E^(I a) + Conjugate[x] E^(-I a), {x},   TargetFunctions -> {Re, Im}]

This approach spares the user to write replacement rules back and forth. The answer from Alexei Boulbitch is also useful, but not much different than the replacement rules I mentioned in my post.

Thanks to all. Massimo

$\endgroup$

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.