2
$\begingroup$

If I input:

Assuming[$x_{-} \in$ Reals, FullSimplify[Conjugate[$e^{i x_1}x_2$]]]

Then the output is:

$e^{-ix_1}x_2$

As it should be. And if instead I do:

Assuming[$x_{-} \in$ Reals, FullSimplify[Conjugate[$e^{ix_1}x_2+x_3$]]]

The output is:

$e^{-ix_1}x_2+x_3$

Again as it should be. Now for some reason if I do:

Assuming[$x_{-} \in$ Reals, FullSimplify[Conjugate[$e^{ix_1}x_2+e^{ix_3}x_4$]]]

The output is:

Conjugate[$e^{ix_1}x_2+e^{ix_3}x_4$]

So for some reason mathematica does not distribute conjugation over addition in this last case. Mysterious and annoying, as I really need it to in order to progress with writing my code.

$\endgroup$
5
  • 3
    $\begingroup$ Please don't use a mixture of LaTeX and Mathematica expressions. $\endgroup$
    – MarcoB
    Aug 8, 2015 at 19:29
  • $\begingroup$ Also, note that e is just an undefined symbol. If you're looking for Euler's number: that's E in Mathematica. $\endgroup$ Aug 8, 2015 at 19:32
  • $\begingroup$ I asked as a guest so I cannot edit. I used latex to demonstrate the idea, then a moderator changed it into mathematica format for some reason. I use E and I for the natural and imaginary numbers, and have the correct syntax for mathematica, which now is not the case above. $\endgroup$
    – user32275
    Aug 8, 2015 at 19:42
  • $\begingroup$ Ok, I rolled back my edit to your initial version. Please register on the site so you will be able to accrue reputation, comment, vote up answers etc. Once you do, if you still have no control of your question, you ca use the following procedure to merge the accounts: mathematica.stackexchange.com/help/merging-accounts $\endgroup$
    – MarcoB
    Aug 8, 2015 at 19:47
  • 1
    $\begingroup$ As far as I know, you can't use patterns in assumptions. You have to provide all individual cases. $\endgroup$ Aug 8, 2015 at 20:10

1 Answer 1

1
$\begingroup$

Like the OP, I find that

Assuming[x_ ∈ Reals, FullSimplify[Conjugate[Exp[I x1] x2]]]
(* E^(-I x1) x2 *)

works, but

Assuming[x_ ∈ Reals, FullSimplify[Conjugate[Exp[I x1] x2 + x3]]]
(* E^(I x1) x2 + x3 *)
Assuming[x_ ∈ Reals, FullSimplify[Conjugate[Exp[I x1] x2 + Exp[I x3] x4]]]
(* E^(I x1) x2 + E^(I x3) x4 *)

return the wrong answer without explanation. (Note that the Question shows only the last of these giving the wrong answer. It may be that, as suggested by Sjoerd C. de Vries, patterns do not work with Assuming. So, we try instead

Assuming[(x1 | x2 | x3) ∈ Reals, FullSimplify[Conjugate[Exp[I x1] x2 + x3]]]
(* E^(-I x1) x2 + x3 *)

which gives the correct answer. Finally,

Assuming[(x1 | x2 | x3 | x4) ∈ Reals, FullSimplify[Conjugate[Exp[I x1] x2 + Exp[I x3] x4]]]
(* Conjugate[E^(I x1) x2 + E^(I x3) x4] *)

also gives a correct, although not useful, result. Of course,

ComplexExpand[Conjugate[Exp[I x1] x2 + Exp[I x3] x4]] // TrigToExp
(* E^(-I x1) x2 + E^(-I x3) x4 *)

works fine.

$\endgroup$

Your Answer

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

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