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?
$\begingroup$
$\endgroup$
Add a comment
|
2 Answers
$\begingroup$
$\endgroup$
3
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] *)
-
$\begingroup$ You probably meant
$Assumptions
$\endgroup$ Commented Jul 6, 2015 at 6:02 -
$\begingroup$ @belisarius I certainly did! Thanks for catching that. $\endgroup$– MarcoBCommented Jul 6, 2015 at 6:04
-
$\begingroup$
$\endgroup$
1
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
.