# Simplify Difference of Conjugate Pairs

Is it possible to easily simplify the difference of conjugate pairs?

In particular, if there's just a single variable, then

FullSimplify[a - Conjugate[a]]

2 I Im[a]


But trying to do the same thing with a slightly more complex expression fails:

FullSimplify[a Conjugate[b] - Conjugate[a] b]

a Conjugate[b] - Conjugate[a] b


I have found one solution (answered below) but it relies on a FullSimplify which doesn't seem very optimal.

• ComplexExpand[a Conjugate[b] - Conjugate[a] b, {a, b}] ? Jun 1, 2020 at 8:55
• That is indeed mathematically equivalent, but it usually results in quite a large expression. I was really hoping to get the result as 2 I Im[...]. Jun 1, 2020 at 9:01

Here is one solution which works to some extent, though it relies on a FullSimplify to determine whether the rule should be applied which could be quite slow.

1 / (2 I) {
a - Conjugate[a],
a Conjugate[b] - Conjugate[a] b,
a b Conjugate[c] Conjugate[d] - c d Conjugate[a] Conjugate[b],
a b c d - Conjugate[a b c d]
} /. {
a_ - b_ :> 2 I Im[a] /; FullSimplify[Conjugate[a] == b]
}

{Im[a], Im[a Conjugate[b]], Im[a b Conjugate[c] Conjugate[d]], Im[a b c d]}