mathbot
mathbot copied to clipboard
Word Integrate not working as expected
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
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

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

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:

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.

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

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.
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.
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)