How do I make Conjugate behave more consistently?
list = {a b, 2 a b, a (b + c), a (b + 2 c), a (b + c (d + e))};
If you never want Conjugate
to distribute, use Inactive
Inactive[Conjugate] /@ list
If you want Conjugate
to always distribute
conj[expr_] :=
ComplexExpand[expr, Variables@Level[expr, {-1}],
TargetFunctions -> Conjugate] // Simplify
conj@*Conjugate /@ list
(* {Conjugate[a] Conjugate[b], 2 Conjugate[a] Conjugate[b],
Conjugate[a] (Conjugate[b] + Conjugate[c]),
Conjugate[a] (Conjugate[b] + 2 Conjugate[c]),
Conjugate[a] (Conjugate[b] + Conjugate[c] (Conjugate[d] + Conjugate[e]))} *)
If any variables are Reals, say a
and c
, then use Simplify
Simplify[%, Element[{a, c}, Reals]]
(* {a Conjugate[b], 2 a Conjugate[b], a (c + Conjugate[b]),
a (2 c + Conjugate[b]), a (Conjugate[b] + c (Conjugate[d] + Conjugate[e]))} *)
Mathematica does not know the nature of your symbols. It knows for sure that 2 is a real number - so it can use proper distribution. You can always specify your variables to get a more consistent answer. For example,
Simplify[Conjugate[a (b + c)], Assumptions -> {a, b, c} ∈ Reals]
a (b + c)
Simplify[Conjugate[a (b + c)], Assumptions -> {{a, b} ∈ Reals}]
a (b + Conjugate[c])
Simplify[Conjugate[a (b + c)], Assumptions -> {{a} ∈ Reals}]
a Conjugate[b + c]
Or you can use Expand
as well to see all the terms distinctly
Expand[Simplify[Conjugate[a (b + c)], Assumptions -> {a, b, c} ∈ Reals]]
a b + a c
And last but not the least, the most general case
Simplify[Conjugate[a (b + c)], Assumptions -> {a, b, c} ∈ Complexes]
Conjugate[a (b + c)]