I want to apply Conjugate[] to a certain quite long rational function of some parameters. My problem is that although it evaluates perfectly fine on each single part of the expression, Mathematica does not like to handle the whole thing. Rather than describe the problem in more words, let me demonstrate by example:
Refine[Conjugate[(9 + 6 (-1 + n))/(20 + 6 (-1 + n)) + (I n)/(
2 (-1 + n)^2)], Element[n, Integers]]
evaluates to
Conjugate[(9 + 6 (-1 + n))/(20 + 6 (-1 + n)) + (I n)/(2 (-1 + n)^2)]
which is not very helpful, whereas if I only give Mathematica one part of the expression, say the second summand only,
Refine[Conjugate[(I n)/(
2 (-1 + n)^2)], Element[n, Integers]]
it correctly evaluates to
-((I n)/(2 (-1 + n)^2))
Unfortunately, the expression is much more complicated so splitting it up and doing it by hand would be a lot of work. What is going on here?
ComplexExpand
(in place ofRefine
) should be enough here, since the integer property is not as important as thatn
is purely real, whichComplexExpand
assumes by default. E.g.ComplexExpand[ Conjugate[(9 + 6 (-1 + n))/(20 + 6 (-1 + n)) + (I n)/(2 (-1 + n)^2)]]
evaluates to(9 + 6*(-1 + n))/(20 + 6*(-1 + n)) - ((I/2)*n)/(-1 + n)^2
. $\endgroup$ – Thies Heidecke Sep 9 '19 at 17:02Apart[(9+6(-1+n))/(20+6(-1+n))+(I n)/(2(-1+n)^2)]
is1+(I/2)/(-1+n)^2+(I/2)/(-1+n)-11/(2*(7+3*n))
andRefine[Conjugate[Apart[(9+6(-1+n))/(20+6(-1+n))+(I n)/(2(-1+n)^2)]],Element[n,Integers]]
returns1-(I/2)/(-1+n)^2-(I/2)/(-1+n)-11/(2*(7+3*n))
which does appear to be the conjugate because the signs of the complex have flipped. I am guessing that the answer to your question "why didn't conjugate work" might be if it is complicated enough it can't find the conjugate.Apart
simpler. $\endgroup$ – Bill Sep 9 '19 at 20:07