0
$\begingroup$

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.

$\endgroup$
3
  • $\begingroup$ How are {L, k1, kreal, kimag} related to {a, b}? $\endgroup$ Jan 7, 2014 at 20:24
  • $\begingroup$ @belisarius, Thank you for the response. I've edited my post above to define b. I suspect it's because at some point I'm not telling it that the right variables are Reals, but I'm not sure why it doesn't propagate forward. $\endgroup$ Jan 7, 2014 at 20:58
  • $\begingroup$ ad your apology: You can use TeXForm to automatically convert your equations. $\endgroup$
    – shrx
    Jan 7, 2014 at 22:18

1 Answer 1

2
$\begingroup$

I'm not sure I follow the full problem, but one approach is

ComplexExpand[(b/a)*Conjugate[b/a]]
b^2/a^2

which automatically assumes the variables are real-valued. When applied to the output of your first expression, you get something real:

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);
FullSimplify[ComplexExpand[(b/a)*Conjugate[b/a]]]

gives a real-valued output

(2 (k1^2 - k2^2)^2 Sin[k2 L]^2)/(k1^4 + 6 k1^2 k2^2 + k2^4 - (k1^2 - k2^2)^2 Cos[2 k2 L])

Alternatively, if I work with your first expression but use FullSimplify and ComplexExpand (instead of just Simplify)

FullSimplify[
 ComplexExpand[(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]))]]

then you also get a real-valued output (assuming that both kreal and kimag are real-valued).

((k1^4 + 2 k1^2 (kimag - kreal) (kimag + kreal) + (kimag^2 + 
       kreal^2)^2) (1 + E^(4 kimag L) - 
     2 E^(2 kimag L) Cos[2 kreal L]))/((kimag^2 + (k1 - kreal)^2)^2 + 
   E^(4 kimag L) (kimag^2 + (k1 + kreal)^2)^2 + 
   2 E^(2 kimag L) (-(k1^4 + (kimag^2 + kreal^2)^2 - 
          2 k1^2 (3 kimag^2 + kreal^2)) Cos[2 kreal L] + 
      4 k1 kimag (-k1^2 + kimag^2 + kreal^2) Sin[2 kreal L]))
$\endgroup$
3
  • $\begingroup$ Hi, thank you. I tried that before and got something insanely long. But also, in the output you have there, there is still I's and Conjugate[]'s in it -- I know they can cancel out to give a real number, but why are they even there if it can easily be simplified to not have them? $\endgroup$ Jan 7, 2014 at 21:24
  • $\begingroup$ It wasn't completely clear if this is the proper value for b, but if it is, there are no I's or conjugates in the output. $\endgroup$
    – bill s
    Jan 7, 2014 at 21:27
  • $\begingroup$ Yep, I think that's what I get now! $\endgroup$ Jan 7, 2014 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.