Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

x * (x - 1) = 1 ===>> throws 'Math error: No term with symbol: x , returning no steps' #234

Open
bawarkamalqader opened this issue Jan 25, 2018 · 1 comment

Comments

@bawarkamalqader
Copy link

bawarkamalqader commented Jan 25, 2018

actually i found two issues after testing the above equation.

  1. It wrongly throws that error, it fails to detect the two "x" symbols on the left side of the equation. after a little bit of debugging , i found this happens in the "Symbols.js" file , in the function assigned to "Symbols.getLastSymbolTerm".
    That function first tries to find a symbol if it is a polyomial node, if not , it checks if the operator of the node is "+", if true, it will recursively try to find a symbol in the nodes. The above equation is not polyomial, and its operator is " * ", so the function will return null and fail in detecting the symbol in the above equation.
    Possible Fix : I think after the check for the "+" operator , another check for " * " should be done, to try to find symbols even if it is " * " operator.

  2. after fixing the above issue, it will not throw the "No term with symbol: " error. but another issue happens, it will throw 'Unsupported operation: ' error. It looks like it happens in the EquationsOperations.js file (possibly line 113), and the function responsible is EquationOperations.removeSymbolFromRightSide().
    the reason is, it takes the (x - 1) part to the other side, so the equation becomes x = 1/(x-1)
    it looks like the system is not able to handle that equation and take the (x-1) back to the left side.
    Possible Fix :

    1. the system should handle inverting functions and be able to take symbols from the right side to the left side, this is also written in the EquationsOperations.js file ( TODO ; line 70)
    2. the system should never try to take symbols to the right side like it does in the above equation
@AugustMKraft
Copy link

I'm having a similar issue but with the equation x^2+4x+6=0, and other non-factorable quadratic equations.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants