2
$\begingroup$

I want to get the modulus of following

(1+(x+I*y)/2+(x+I*y)^2/12)/(1-(x+I*y)/2+(x+I*y)^2/12)

I use

Abs[(1+(x+I*y)/2+(x+I*y)^2/12)/(1-(x+I*y)/2+(x+I*y)^2/12)]

But I always get

                                    2
                 x + I y   (x + I y)
             1 + ------- + ----------
                    2          12
Out[52]= Abs[-------------------------]
                                     2
                 -x - I y   (x + I y)
             1 + -------- + ----------
                    2           12

Can someone help me?

$\endgroup$
0

1 Answer 1

6
$\begingroup$

You need to tell M that all symbols are real:

expr = (1 + (x + I*y)/2 + (x + I*y)^2/12)/(1 - (x + I*y)/
      2 + (x + I*y)^2/12);
ComplexExpand@ Abs @expr

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Can you explain more about ComplexExand@ Abs @expr? I am new user of Mathematica. $\endgroup$
    – Ben
    Commented Apr 9, 2015 at 3:03
  • $\begingroup$ @Ben, the help reference.wolfram.com/language/ref/ComplexExpand.html really explains it well. Basically, if you type Abs[x + I y], then M can't do Sqrt[(x^2+y^2)] since x and y themselves can be complex numbers, each with real and imaginary parts. If that was the case, then x^2 will contains a complex value in it. So someone came up with a function to tell M to assume all symbols are real. $\endgroup$
    – Nasser
    Commented Apr 9, 2015 at 3:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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