2
$\begingroup$

If you have a statement like:

Conjugate[a+b]

you get back

Conjugate[a+b]

but I'm expecting

Conjugate[a]+Conjugate[b]

If you try the logical comparison:

Conjugate[a+b]==Conjugate[a]+Conjugate[b]

You get the same result back (it does not evaluate the expression).

I'm assuming that Mathematica must not have enough information to give me the result I'm expecting, but I am not sure what I need to tell it. Could someone please explain to me what I am missing from my states?

Edit: I found a workaround but it is definitely not my preferred method.

Map[Conjugate, a+b]

will output as expected. I don't think this would be a preferred method because I'm not sure what it would do in all cases.

$\endgroup$
5
  • $\begingroup$ To add to this, if you do a transformation rule like Conjugate[a+b]==Conjugate[a]+Conjugate[b] /. {a->I, b->2} the expression evaluates to true $\endgroup$
    – user
    Jul 13, 2018 at 21:38
  • $\begingroup$ FullSimplify[Conjugate[a + b] == Conjugate[a] + Conjugate[b] ] ? $\endgroup$
    – kglr
    Jul 13, 2018 at 21:38
  • $\begingroup$ @kevin: But surely the OP wants the result for the general form $a = x + i y$, etc. $\endgroup$ Jul 13, 2018 at 21:39
  • $\begingroup$ @DavidG.Stork Sorry that was me posting extra info on my question, my point was that obvious when real values are used it works as expected, so why when left as symbols does it not work as expected. $\endgroup$
    – user
    Jul 13, 2018 at 21:42
  • $\begingroup$ @kglr that returns true! but if you do FullSimplify[Conjugate[a+b]] you get the same result back :( $\endgroup$
    – user
    Jul 13, 2018 at 21:44

1 Answer 1

1
$\begingroup$

Use Distribute.

Distribute[Conjugate[a + b]]
(* Conjugate[a] + Conjugate[b] *)

A safer version is

Distribute[Conjugate[a + b], Plus]

It will only distribute over Plus.

This is even safer:

Distribute[Conjugate[a + b], Plus, Conjugate]

As for Conjugate[a+b]==Conjugate[a]+Conjugate[b]: don't think of == as an operator that does something. Instead, it represents an equality. Testing if the equality will hold for all parameter values is complicated and time consuming. Having == do it automatically would be counterproductive (it would make simple operations take a long time). Thus you need to do this manually:

Conjugate[a + b] == Conjugate[a] + Conjugate[b] // FullSimplify
(* True *)
$\endgroup$
3
  • $\begingroup$ Thanks! this was exactly what I needed. $\endgroup$
    – user
    Jul 15, 2018 at 2:57
  • $\begingroup$ Is there a way to do this for a more complicated expression? Say F[(a+b)*] where F is explicitly typed out and may be arbitrarily complicated. $\endgroup$
    – ions me
    Oct 24, 2022 at 21:16
  • $\begingroup$ Map[ Distribute[#, Plus, Conjugate]&, %, Infinity] seems to do the trick in one test case ... not sure if it's completely stable though. $\endgroup$
    – ions me
    Oct 24, 2022 at 21:21

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.