Opened 8 years ago

# Regression in solve command

Reported by: Owned by: ppurka major sage-6.4 calculus regression kcrisman, jakobkroeker N/A wrongAnswerMarker

From google spreadsheet which no one reads `X-(`

The following is a vector calculus example. It supposedly should solve the critical point equations for the given function (symbolically, where possible, otherwise numerically):

```x,y=var('x,y')
f(x,y)=((x-1)^2+(y-3)^2)*((x+1)^2+(y+2)^2)/(x^2+y^2+1)
```

Works with 5.5.rc0 (assuming answer is correct)

```sage: solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)
[[x == (0.45 + 1.65*I), y == (-11/20*I + 27/20)], [x == (0.45 - 1.65*I), y == (11/20*I + 27/20)], [x == (2.14624170747e-08 + 2.50000000895*I), y == (-I + 1/2)], [x == (-2.14624155595e-08 + 2.49999999105*I), y == (-I + 1/2)], [x == (-1.22085882983e-09 - 2.49999999706*I), y == (I + 1/2)], [x == (1.22085741408e-09 - 2.50000000294*I), y == (I + 1/2)], [x == 0.108848345629, y == 0.064959221634], [x == 2.0690897184, y == -0.785458685751], [x == -2.08897196262, y == 0.935164613209], [x == (0.00551694210392 + 1.15257220423*I), y == (-0.0573325779446 + 2.78408620946*I)], [x == (0.00551694210392 - 1.15257220423*I), y == (-0.0573325779446 - 2.78408620946*I)], [x == (-0.4 + 1.2*I), y == (-3/5*I - 4/5)], [x == (-0.4 - 1.2*I), y == (3/5*I - 4/5)], [x == -1, y == -2], [x == 1, y == 3]]
```

Breaks with 5.5

```sage: solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)
[2*(x - 1)*((y + 2)^2 + (x + 1)^2)/(x^2 + y^2 + 1) + 2*(x + 1)*((y - 3)^2 + (x - 1)^2)/(x^2 + y^2 + 1) - 2*((y + 2)^2 + (x + 1)^2)*((y - 3)^2 + (x - 1)^2)*x/(x^2 + y^2 + 1)^2 == 0, 2*(y - 3)*((y + 2)^2 + (x + 1)^2)/(x^2 + y^2 + 1) + 2*(y + 2)*((y - 3)^2 + (x - 1)^2)/(x^2 + y^2 + 1) - 2*((y + 2)^2 + (x + 1)^2)*((y - 3)^2 + (x - 1)^2)*y/(x^2 + y^2 + 1)^2 == 0]
```

Update: it works again with sage 7.6.beta4, but not all results are correct

### comment:1 Changed 8 years ago by kcrisman

Could be a change in how Maxima does these.

### comment:2 Changed 8 years ago by vbraun_spam

• Milestone changed from sage-6.1 to sage-6.2

### comment:3 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.2 to sage-6.3

### comment:4 Changed 7 years ago by vbraun_spam

• Milestone changed from sage-6.3 to sage-6.4

### comment:5 Changed 6 years ago by rws

With 6.8:

```sage: solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)
[[x == (0.4500000000000001 + 1.65*I), y == (-11/20*I + 27/20)], [x == (0.4499999999999998 - 1.65*I), y == (11/20*I + 27/20)], [x == (2.1462417074716e-08 + 2.500000008950185*I), y == (-I + 1/2)], [x == (-2.146241555952319e-08 + 2.499999991049815*I), y == (-I + 1/2)], [x == (-1.220858829829863e-09 - 2.499999997056549*I), y == (I + 1/2)], [x == (1.220857414076436e-09 - 2.500000002943449*I), y == (I + 1/2)], [x == 0.1088483456288377, y == 0.06495922163399628], [x == 2.069089718402096, y == -0.7854586857514639], [x == -2.088971962616823, y == 0.9351646132094527], [x == (0.005516942103919547 + 1.152572204234338*I), y == (-0.05733257794463129 + 2.784086209457084*I)], [x == (0.00551694210391972 - 1.152572204234338*I), y == (-0.05733257794463129 - 2.784086209457084*I)], [x == (-0.4 + 1.2*I), y == (-3/5*I - 4/5)], [x == (-0.4000000000000001 - 1.2*I), y == (3/5*I - 4/5)], [x == -1, y == -2], [x == 1, y == 3]]