Opened 8 years ago

# Maxima fails to recognize some expressions as equal

Reported by: Owned by: aginiewicz major sage-9.5 calculus limit, golden_ratio kcrisman, jakobkroeker N/A wrongAnswerMarker

Maxima fails to regard some expressions as equal:

```sage: value_1 = 1-golden_ratio
sage: value_2 = -golden_ratio^(-1)
sage: bool(value_1 == value_2)
True
sage: bool(value_1^x != value_2^x)
True
```

while

```sage: bool(((x+1)^2)^y == (x^2+2*x+1)^y)
True
sage: sin(0,hold=True)^x == 0^x
sin(0)^x == 0^x
sage: bool(sin(0,hold=True)^x == 0^x)
True
```

Previous description:

I tried to define Fibonacci sequence using golden ratio in two ways, using values:

```sage: value_1 = 1-golden_ratio
sage: value_2 = -golden_ratio^(-1)
sage: bool(value_1 == value_2)
true
```

(gives true, so two definitions, F1 and F2 below should be equal, even though they are not according to Sage)

```sage: F1(k) = (golden_ratio^k-(value_1)^(k))/sqrt(5)
sage: F2(k) = (golden_ratio^k-(value_2)^(k))/sqrt(5)
sage: bool(F1(k) != F2(k))
true
```

When simplified everything seems to be equal at least for first 10 or 1000 elements:

```sage: [(F1(j)-F2(j)).full_simplify() for j in range(10)]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
```

Anyway, now to the error: limit for F1 gives wrong result:

```sage: limit(F1(k+1)/F1(k), k=oo)
0
```

and for F2 works OK:

```sage: limit(F2(k+1)/F2(k), k=oo)
1/2*sqrt(5) + 1/2
```

I've tested it with Sage 5.12 and 5.11, with same result. This can be as simple as some thing with how golden ratio is handled, or something far more involved maybe?

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

• Milestone changed from sage-6.1 to sage-6.2

### comment:3 Changed 8 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 7 years ago by aginiewicz

I don't know when it happened, but in 6.4.1 the limit works:

```sage: limit(F1(k+1)/F1(k), k=oo)
1/2*sqrt(5) + 1/2
```

but the comparison

```sage: F1(k) = (golden_ratio^k-(value_1)^(k))/sqrt(5)
sage: F2(k) = (golden_ratio^k-(value_2)^(k))/sqrt(5)
sage: bool(F1(k) != F2(k))
true
```

is still wrong. Slightly minified example:

```sage: value_1 = 1-golden_ratio
sage: value_2 = -golden_ratio^(-1)
sage: bool(value_1 == value_2)
True
sage: bool(value_1^x != value_2^x)
True
```

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

• Description modified (diff)
• Summary changed from Wrong limit for squence involving Fibonacci sequence, 0 instead of golden ratio to Maxima fails to recognize some expressions as equal

### comment:8 Changed 15 months ago by mkoeppe

• Milestone changed from sage-6.4 to sage-9.2

Unchanged after #30063 Maxima 5.44.0

### comment:9 Changed 15 months ago by kcrisman

Thanks very much for checking up on all these old tickets.

### comment:10 Changed 13 months ago by mkoeppe

• Milestone changed from sage-9.2 to sage-9.3

### comment:11 Changed 8 months ago by mkoeppe

• Milestone changed from sage-9.3 to sage-9.4

Sage development has entered the release candidate phase for 9.3. Setting a new milestone for this ticket based on a cursory review.

### comment:12 Changed 3 months ago by mkoeppe

• Milestone changed from sage-9.4 to sage-9.5
Note: See TracTickets for help on using tickets.