I have a complex variable, and I'm trying to multiply it by its Conjugate[], which should give me a real number. So, I'm currently doing:
r = Simplify[(b/a)*Conjugate[b/a], {L, k1, kreal, kimag} \[Element] Reals]
Which is giving me:
(E^(-2 I kreal L) (-1 + E^(2 (kimag + I kreal) L)) (E^(2 kimag L) -
E^(2 I kreal L)) (k1^2 + (kimag - I kreal)^2) (k1^2 + (kimag +
I kreal)^2))/((-E^(2 I kreal L) (-k1 + I kimag + kreal)^2 +
E^(2 kimag L) (k1 + I kimag + kreal)^2) (E^(2 kimag L) k1^2 -
Conjugate[
E^(2 kimag L) (kimag - I kreal) (-2 I k1 + kimag - I kreal) +
E^(2 I kreal L) (-k1 + I kimag + kreal)^2]))
(I apologize for the poor formatting, I don't know how to do it so it looks nice here without editing a ton of latex.)
Anyway, clearly this is not as simplified as it could be -- it knows that every variable in that expression is real and I multiplied a complex number by its complex conjugate, so the entire expression should be real and free of $i$'s or Conjugate[]'s, but it isn't.
What am I missing?
Thanks!
edit: I realized I should have included a and b. a is intentionally undefined, but that shouldn't matter because it divides out from b:
(a (-1 + E^(2 I k2 L)) (k1^2 - k2^2))/(-k1^2 + E^(2 I k2 L) k1^2 - 2 k1 k2 - 2 E^(2 I k2 L) k1 k2 - k2^2 + E^(2 I k2 L) k2^2)
Where k2 is then defined as:
k2 = Simplify[kreal + I*kimag, {kimag, kreal} \[Element] Reals];
I've also tried just doing Simplify[] to the Conjugate[] of (b/a), which is confusing because it still has a Conjugate[] in the output:
Simplify[Conjugate[b/a], {L, k1, kreal, kimag} \[Element] Reals
Gives:
(E^(-2 I kreal L) (-1 + E^(2 (kimag + I kreal) L)) (k1^2 + (kimag + I kreal)^2))/(E^(2 kimag L) (k1^2 - kimag^2 + kreal^2) - Conjugate[E^(2 I kreal L) (-k1 + I kimag + kreal)^2 - 2 I E^(2 kimag L) (k1 (kimag - I kreal) + kimag kreal)])
Why? It knows that all the variables inside that Conjugate[] are real, so it should just flip the signs of the $i$ terms.
{L, k1, kreal, kimag}
related to{a, b}
? $\endgroup$TeXForm
to automatically convert your equations. $\endgroup$