4
$\begingroup$

I have a complicated complex function containing some other ones that are real, f=f(A,B,C,...) ,where A=A(r) and it is real, for example. When I do Conjugate[f] I get something like Conjugate[f]=f*=f*(Conjugate[A],Conjugate[B],...), I mean those internal function arent interpreted as real. I tried ComplexExpand to work with it by assuming that those internal functions are real, but it does not work. I also tried $Assumptions={A,B,...}\[Element] Reals at the beginning of the nb, and nothing. What I want is to Simplify some expressions like (-I A)(I A)=A^2, but I only get Conjugate[A] A. Is there some way to declare these internal functions as real, even they are part of a larger more complicated complex function?

$\endgroup$
6
$\begingroup$

Your assumption should be made on the value of g[_], not of plain g. Otherwise, your assumption can be introduced globally through $Assumptions, or as a second argument to Simplify, or using Assuming, all with the same result.

Clear[f, g, r]
f[arg_] := a - I arg

Conjugate[f[g[r]]]
(* Out: Conjugate[a] + I Conjugate[g[r]] *)

Assuming[g[_] ∈ Reals, Simplify[ Conjugate[f[g[r]]] ] ]
(* Out: Conjugate[a] + I g[r] *)
$\endgroup$
  • $\begingroup$ You probably meant $Assumptions $\endgroup$ – Dr. belisarius Jul 6 '15 at 6:02
  • $\begingroup$ @belisarius I certainly did! Thanks for catching that. $\endgroup$ – MarcoB Jul 6 '15 at 6:04
  • $\begingroup$ @MarcoB . Thank you. $\endgroup$ – Patrick El Pollo Jul 6 '15 at 6:16
6
$\begingroup$

Here is another possible solution which doesn't require you to use Simplify:

Clear[f, a, g, r]
f[arg_] := a - I arg

Conjugate[g[r_]] ^:= g[r]

Conjugate[f[g[r]]]

(* ==> Conjugate[a] + I g[r] *)

This uses UpSetDelayed to make the desired assumption part of the definitions associated with g.

$\endgroup$
  • $\begingroup$ Very elegant! (+1) $\endgroup$ – MarcoB Jul 6 '15 at 17:29

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.