Why does the SIMPLE function within the Symbolic Math Toolbox return an incorrect result?

1 view (last 30 days)
When I run the following code:
syms B
num = ((1+B)/(1-B))^(1/2);
den = ((1-B)/(1+B))^(1/2);
F = num/den;
F = simple(F)
pretty(F)
I receive the wrong solution:
1 + B
------
-1 + B
The solution should be:
1 + B
------
1 - B

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is a bug in Symbolic Math Toolbox 2.1.3 (R13) that has been brought to the attention of our development staff so that it may be fixed in a future release of Symbolic Math Toolbox.
As a workaround, try using the EXPAND function before using the SIMPLE function:
syms B
num = ((1+B)/(1-B))^(1/2)
den = ((1-B)/(1+B))^(1/2)
F = simple(expand(num)/expand(den))
pretty(F)

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!