Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2x = 5 solves fine, 2x = sqrt(5x) does not report an error or a solution #220

Open
LasseMunk opened this issue Dec 4, 2024 · 0 comments

Comments

@LasseMunk
Copy link

Please follow the template below.
If you don't, your issue may be closed without being addressed.

Include code fragments or CodePen.io links to illustrate the issue. Do not include screenshots of code.

....
mathInputSolveFor(value, "x");
....

export const mathInputSolveFor = (mathInput: string, solveFor: string) => {
  const expr = computeEngine.parse(mathInput);
  const solution = expr.solve(solveFor);

  return isType(solution) ? solution.toString() : null;
};   

Actual Result

For 2x = 10, result is working x = 5

for 2x = sqrt(5x) or similar, if I console log solution then it's an empty array and no error is reported in the console

Expected Result

in wolfram alpha: solve for x, 2x = sqrt(5x)
output:
x = 5/4

Environment

"@cortex-js/compute-engine": "^0.26.4",
"mathlive": "^0.101.2",
"vue": "^3.5.12",

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

No branches or pull requests

1 participant