# Abs and ^2 within Solve: curious speed characteristics [duplicate]

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.

• Have you considered preprocessing with ComplexExpand[]? Jan 31, 2017 at 17:52
• To wit: ComplexExpand /@ {Abs[(x - I y)/(x^2 + I y)] == 4.5, Abs[x + I y]^2 == 2} and then Solve[%,{x,y}], evaluates rapidly. Jan 31, 2017 at 18:43
• Ah thank you, I didn't know about ComplexExpand. So useful! Jan 31, 2017 at 18:51
• @Feyre, it gives the wrong answer though, in version 11 Jan 31, 2017 at 20:34
• You can replace x with z and get a rapid result. Sometimes altering the lexical ordering of symbols in the expression helps Mathematica choose better transformations. Jan 31, 2017 at 20:37