I was playing around with the Solve function recently and found a behavior I couldn't explain. The equations I'm working with look like
Solve[{
Abs[(x - I y)/(x + I y)] == 4.5,
Abs[x + I y]^2 == 2}, {x, y}]
Which computes quite quickly. The variations I looked at add a squaring (^2) to different terms, eg.
Solve[{
Abs[(x^2 - I y)/(x + I y)] == 4.5,
Abs[x + I y]^2 == 2}, {x, y}]
Solve[{
Abs[(x - I y^2)/(x + I y)] == 4.5,
Abs[x + I y]^2 == 2}, {x, y}]
Solve[{
Abs[(x - I y)/(x + I y^2)] == 4.5,
Abs[x + I y]^2 == 2}, {x, y}]
All solve quite quickly. However,
Solve[{
Abs[(x - I y)/(x^2 + I y)] == 4.5,
Abs[x + I y]^2 == 2}, {x, y}]
has been running for quite a while now, and my hopes of it completing at all are low. But it seems so similar to the previous three variations! Why is this fourth system, though ostensibly similar to the other three, so much more difficult for Mathematica to Solve?
In case it matters, I'm running v11 on Windows 7.
ComplexExpand[]
? $\endgroup$ComplexExpand /@ {Abs[(x - I y)/(x^2 + I y)] == 4.5, Abs[x + I y]^2 == 2}
and thenSolve[%,{x,y}]
, evaluates rapidly. $\endgroup$x
withz
and get a rapid result. Sometimes altering the lexical ordering of symbols in the expression helps Mathematica choose better transformations. $\endgroup$