Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an equation such as:

a*z^2 + b*(z - c)^2 == d 

where z is a complex variable and a, b, c, d are all complex parameters. I want to put x+I*y instead of z and decompose this equation into two pure real and imaginary part for further analysis, but I don't know how to do it by Mathematica! Can anybody help me?

share|improve this question

Try:

ComplexExpand[a*z^2 + b*(z - c)^2, {_}]

Or to get a somewhat shorter result:

ComplexExpand[a*z^2 + b*(z - c)^2, {_}] /. a_ + Complex[0, 1] b_ :> Simplify[a] + I Simplify[b]
(*
 -Im[c]^2 Re[b] - Im[z]^2 (Re[a] + Re[b]) + Re[b] Re[c]^2 - 
  2 Re[b] Re[c] Re[z] + Re[a] Re[z]^2 + Re[b] Re[z]^2 + 
  2 Im[b] Im[c] (-Re[c] + Re[z]) + 
  2 Im[z] (Im[c] Re[b] + Im[b] (Re[c] - Re[z]) - Im[a] Re[z]) + 
 I (Im[b] (-Im[c]^2 + 2 Im[c] Im[z] - Im[z]^2 + (Re[c] - Re[z])^2) + 
    Im[a] (-Im[z]^2 + Re[z]^2) + 2 (Im[c] Re[b] (Re[c] - Re[z]) + 
    Im[z] (Re[a] Re[z] + Re[b] (-Re[c] + Re[z]))))
*)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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