I'm brand new to Wolfram, so apologies in advance if this sounds stupid. I'm trying to use the API to solve an equation involving non-integer numbers, but the documentation is unclear on how to coax the API into recognising the non-integer part. Take this example:
http://www.wolframalpha.com/input/?i=solve+%280.2%5E-a+%3D+2*0.4%5E-a+%2B+1+-+2%29+for+a+not+integer
I'm interested in that numerical solution, ~0.349... The numerical solution is really the only bit Im interested in but right now Id settle for the whole XML dump so long as the answer is in there somewhere. I want to be able to get the solution to this from a script inside a Google Sheets document, like this:
function printEquationAnswer(argument) {
var input = UrlFetchApp.fetch("http://api.wolframalpha.com/v2/query?appid=XXXXX&input="+argument).getContentText();
return input;
}
... With a cell in the spreadsheet containing something like:
=printEquationAnswer("solve+%280.2%5E-a+%3D+2*0.4%5E-a+%2B+1+-+2%29+for+a+not+integer ")
Which goes to the following URL attempting to solve the equation
http://api.wolframalpha.com/v2/query?appid=XXXXX&input=solve+%280.2%5E-a+%3D+2*0.4%5E-a+%2B+1+-+2%29+for+a+not+integer
But visiting that URL (with a suitable appid in there rather than XXXXX) shows that the result just comes up with a <didyoumean> section rather than an answer. The only way I can get something more like a proper response is to remove the "+not+integer" from the end of the URL... But of course then it performs a "Solution over the integers" and doesn't give me the answer I want. I've tried writing assumptions into the URL but to no avail. I'm presumably getting the syntax wrong, and can't find any documentation with examples of how to do it correctly.
Help! How do I persuade the API to stop treating a as an integer in the same way that you can do so easily on the wolframalpha site itself?