Message Boards Message Boards


Get absolute value of a complex number?

Posted 9 months ago
6 Replies
1 Total Likes


I'll start right away. I have a question about Complex Numbers.

I have a complex number, or a bunch of complex numbers, like you can see below. Here I need to know the absolute value of the number B squared, but in the result there is still the imaginery unit in it. I said that all the variables are real numbers greater than zero, so it should be possible to give me a correct term for the absolute value of B.

Or what is my mistake here? How do I use complex numbers with variables in it? How do I make sure that the variables are part of the reals numbers an grater than zero?


\[Alpha] \[Element] Reals; \[Lambda] \[Element] Reals; L \[Element] Reals; \[Alpha] > 0; \[Lambda] > 0; L > 0;

\[CapitalOmega] = (\[Alpha] - I*\[Lambda])/(\[Alpha] + I*\[Lambda])*Exp[\[Alpha]*L];
c = (2*I*\[Lambda])/(I*\[Lambda] + \[Alpha])*Exp[(\[Alpha] - I*\[Lambda])*L/2]/(1 + \[CapitalOmega]^2);
d = c*\[CapitalOmega];

B = c*Exp[(-\[Alpha] + I*\[Lambda])*L/2] + d*Exp[(\[Alpha] + I*\[Lambda])*L/2] - 1;


Abs[-1 + (
  2 I E^(L \[Alpha] + 1/2 L (\[Alpha] - I \[Lambda]) + 
    1/2 L (\[Alpha] + I \[Lambda])) (\[Alpha] - 
     I \[Lambda]) \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda])^2) + (
  2 I E^(1/2 L (\[Alpha] - I \[Lambda]) + 
    1/2 L (-\[Alpha] + I \[Lambda])) \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2

In[7]:= Simplify[
 Abs[-1 + (
   C E^(L \[Alpha] + 
     1/2 L (\[Alpha] + I \[Lambda])) (\[Alpha] - 
      I \[Lambda]))/(\[Alpha] + I \[Lambda]) + (
   2 I E^(1/2 L (\[Alpha] - I \[Lambda]) + 
     1/2 L (-\[Alpha] + I \[Lambda])) \[Lambda])/((1 + (
      E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
        I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2]

Out[7]= Abs[-1 + (
  C E^(1/2 L (3 \[Alpha] + I \[Lambda])) (\[Alpha] - 
     I \[Lambda]))/(\[Alpha] + I \[Lambda]) + (
  2 I \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2

I hope you can help me. Thanks in advance! :)

Best regards, Thomas

6 Replies

The mechanism for assumptions is different:

myAssumptions = {\[Alpha] \[Element] Reals, \[Lambda] \[Element] 
    Reals, L \[Element] Reals, \[Alpha] > 0, \[Lambda] > 0, L > 0};
FullSimplify[Abs[B]^2, myAssumptions]

If you need global assumptions, look up $Assumptions.

Ahh ok. Thank you for the quick answer!

So I have another question: Why doesn't that work for Abs[], Im[] or Re[]?

When i type

FullSimplify[Abs[B], myAssumptions]

I just get

Abs[((\[Alpha] - I \[Lambda]) ((\[Alpha] - I \[Lambda]) Cosh[L \[Alpha]] - 2 I \[Lambda] Sinh[ L \[Alpha]]))/((\[Alpha] - \[Lambda]) (\[Alpha] + \[Lambda]) * Cosh[L \[Alpha]] - 2 I \[Alpha] \[Lambda] Sinh[L \[Alpha]])]

as result. Same for Re and Im.

Perhaps the "simplest" form is the one with the imaginary unit. You can force the separation with ComplexExpand:

Simplify[ComplexExpand@Abs[B], myAssumptions]

Or perhaps with your B from above

Bstar = B /. Complex[u_, v_] -> Complex[u, -v]

and then (giving Abs[ B ]^2 )

B *Bstar // FullSimplify

I submitted a solicitation to send the answer (paper) of why complex numbers are "not needed" to the American Mathematics Society.

Their answer: "we know, but we can't teach it that way".

Complex numbers are in component form. You can take Abs[] of parts individually: however be CAUTIOUS. It's sign that the infamous `i' is tracking. Since it's imaginary until paired there isn't any point of having it's absolute value. There are ways to find the pairing without using 'i', though they don't teach it that way :)

Have fun!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract