mathbot icon indicating copy to clipboard operation
mathbot copied to clipboard

Word Integrate not working as expected

Open patkub opened this issue 5 years ago • 6 comments

The phrase "integrate e^{x+2} from 1 to 6" works fine on wolframalpha.com, but not with the bot https://www.wolframalpha.com/input/?i=integrate+e%5E%7Bx%2B2%7D+from+1+to+6

=wolf integrate e^{x+2} from 1 to 6

MathBot BOT Today at 10:00 PM
Wolfram|Alpha didn't send a result back.
Maybe your query was malformed?

If we remove the word integrate, the following phrase assumes integration and gives a proper result:

=wolf e^{x+2} from 1 to 6

patkub avatar Oct 19 '20 02:10 patkub

If we remove the word integrate, the following phrase assumes integration and gives a proper result:

It seems to me like this may not be the case as the integration calculated by the command =wolf e^{x+2} from 1 to 6 is calculating arc length rather than area under the curve Screenshot_20201020_055455

MoralCode avatar Oct 20 '20 13:10 MoralCode

Considering this seems to work on slightly less complicated queries (see screenshot, it seems to me like this could be either: a) wolfram alpha limiting the maximum time to compute calculations provided via their API (i've seen this behavior/error before on the web with some more complicated queries before, dont specifically remember the formula that caused it tho), or b) maybe mathbot is timing out too soon and telling the user that no result was returned when it hasn't given wolfram alpha time to compute it yet Screenshot_20201020_132510

I have also tested a few variations on the syntax and it seems like all the variations I have tried fail with the "more complicated" formula, but do fine with the simpler one: Screenshot_20201020_133246 Screenshot_20201020_132959 Screenshot_20201020_133051

MoralCode avatar Oct 20 '20 20:10 MoralCode

in support of this theory it seems like the query =wolf solve 1-e^{-(x - 0.833)^1.847 } for x, which the web version of wolfram alpha calculates part of the way, but some part of it is exceeding the time limit. Screenshot_20201025_164216

Trying this with mathbot doesn't return any answer at all, even the part that was successfully calculated. Screenshot_20201025_164154

MoralCode avatar Oct 25 '20 23:10 MoralCode

Thanks for investigating! I've checked the Wolfram|Alpha API and it has a section about handing timeouts more gracefully, so it should be possible to fix this.

DXsmiley avatar Oct 29 '20 01:10 DXsmiley

I've managed to get =wolf e^{x+2} from 1 to 6 working by simply passing an argument to W|A to increase the allowed computation time, and I've pushed the change to production.

Giving solve 1-e^{-(x - 0.833)^1.847 } for x to the W|A API just produces an error, however. I'll keep looking into it.

DXsmiley avatar Jan 04 '21 07:01 DXsmiley

not sure if this makes anything more user friendly, but maybe the error message could also be edited to suggest that the error could be due to computation time rather than a malformed query (maybe by changing it to something like "Wolfram|Alpha didn't send a result back in time. Maybe your query was malformed or your query exceeded the allowed computation time. Executing this query on Wolfram alpha may help resolve the problem" (where the hyperlinked text would link to W|A's website with the users query already populated)

MoralCode avatar Jan 04 '21 18:01 MoralCode