1
$\begingroup$

I would like to find the real and imaginary parts of $x + y$ in terms of polar coordinates.

Here is code:

ComplexExpand[Re[x + y], {x, y}, TargetFunctions -> {Abs, Arg}]

How can I add the assumption that $Abs[x]$ equals to $Abs[y]$?

For example this code does not work:

ComplexExpand[Re[x + y], {x, y}, TargetFunctions -> {Abs, Arg}, 
Assumptions -> Abs[x] == Abs[y]]
$\endgroup$
  • $\begingroup$ By the above assumption, I expect to obtain: Re[x + y] = Abs[x] (Cos[Arg[x]] + Cos[Arg[y]]) $\endgroup$ – To Be Jun 21 '14 at 13:23
  • $\begingroup$ Or, how can I change the code to obtain Re[x + y] = Abs[x] (Cos[Arg[x]] + Cos[Arg[y]]), by the assumption that Abs[x] = Abs[y]? $\endgroup$ – To Be Jun 21 '14 at 13:24
1
$\begingroup$

Would

Simplify[
  ComplexExpand[Re[x + y], {x, y}, TargetFunctions -> {Abs, Arg}], 
  Assumptions -> Abs[x] == Abs[y]]
Abs[y] (Cos[Arg[x]] + Cos[Arg[y]])

work for you?

$\endgroup$
  • $\begingroup$ Very good. Thank you. $\endgroup$ – To Be Jun 21 '14 at 13:47
  • $\begingroup$ @To Be - The algorithms give Abs[y] rather than the equivalent Abs[x]; however, if the difference is important to you, you could try playing with the ComplexityFunction for FullSimplify or just use a rule /. Abs[y] -> Abs[x] $\endgroup$ – Bob Hanlon Jun 21 '14 at 14:09

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.