Could you help me, please? I have two complex functions of real variable f[x] and fc[x] such that one is a conjugate of another one. I'd like to take a conjugate of an expression that includes both of these functions. Is it possible to define Conjugate operation for both of these functions?

I'm looking for something like that:

Conjugate[f[x_]] := fc[x];

Conjugate[fc[x_]] := f[x];

Eq = Conjugate[2f[x] + fc[x]]

I'd like to get Eq = 2 fc[x] + f[x]

Thank you in advance for your help!


Conjugate[f[x_]] := fc[x]; will fail because MMA tries to store this rule under Conjugate, which is protected.

However, you may store it under f by using up-set or up-set-delayed:

Conjugate[f[x_]] ^:= fc[x];

Conjugate[fc[x_]] ^:= f[x];

Eq = Conjugate[2 f[x] + fc[x]]

(* f[x] + 2 fc[x] *)
  • $\begingroup$ Fantastic! It is exactly what I was looking for! Thank you! $\endgroup$ – Svetlana Apr 20 at 18:41
Conjugate[2 f[x] + fc[x]] /. {Conjugate[f[x]] -> fc[x], Conjugate[fc[x]] -> f[x]}
(*    f[x] + 2 fc[x]    *)

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.