# bug #58536: [octave forge] (symbolic) adding exponential functions returns wrong results

 Submitted by: miro Submitted on: Tue 09 Jun 2020 06:29:27 PM UTC Category: Octave Forge Package Severity: 3 - Normal Priority: 5 - Normal Item Group: Incorrect Result Status: None Assigned to: None Originator Name: Open/Closed: Open Release: 5.2.0 Operating System: GNU/Linux

You are not logged in

## Discussion

Tue 09 Jun 2020 06:29:27 PM UTC, original submission:

In symbolic mode:

1) exponential function with imaginary exponent is not well supported, adding opposite numbers never return zero, such as in this case
i+(-i)=exp(i*pi/4)+exp(-i*pi/4)=0

2) The worse result is coming when adding numbers of vertexes of symmetric polygon on unit circle. The expected result is 0, but simplify(sum(exp(sym(2)*pi*[0:4]*1i/5))) returns
1 - \left(-1\right)^{\frac{3}{5}} - \sqrt[5]{-1} + e^{\frac{4 i \pi}{5}} + e^{\frac{2 i \pi}{5}}

3) in the result of 2) there is also wrong that sqrt(-1) is not replaced by "i" and there are expressions like (-1)**(3/5), they shouldn't appear at all during symbolic counting, or at least they should be replaced by complex number if the counting method is not so good

4) working with something more complex based on exponential function with complex coefficient, such as circulant matrices should provide wrong results for eigenvectors, eigenvalues and determinant in symbolic mode

FIX

The simplest fix should be defining Euler's formula into symbolic identities and enabling following identity response:
expand(exp(x+iy))==exp(x)*(cos(y)+i*sin(y))

OTHER ERRORS

Anyway the strange form of result in using (-1)**(3/5) as the most simplified expression should have negative impact on other results than only our trigonometric case mentioned here.

miro <miro>

## Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Comment:

No files currently attached

## Dependencies

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -email is unavailable- added by miro (Submitted the item)
•

Do you think this task is very important?
This task has 0 encouragements so far.

Only project members can vote.

## History

Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2020-06-09 mtmiller SummaryAdding exponential functions is returning wrong results in symbolic mode [octave forge] (symbolic) adding exponential functions returns wrong results