I've been playing around with dynamic input fields; here's a basic example, which just consists of an input field where the user can enter a function and then a button that can be clicked to graph the function. What I'm wondering is: is there a way to allow free-form linguistic input to be entered in the input field? Right now, I must enter regular Mathematica syntax like Cos[x] to get a graph, but I'd really like to be able to enter something like "cos x". (Ultimately, I'd like my dynamic module to do more than just graph the function, which is why I don't want to just use Wolfram Alpha directly.)

DynamicModule[{graph, f, button},
 graph = Plot[1, {x, 0, 1}, PlotRange -> {0, 0.1}, Axes -> False, 
   ImageSize -> 480, Background -> White];
 f = Cos[x];

 button = Button["Graph!",
   graph = Plot[f, {x, -3, 3}, ImageSize -> 480, Background -> White];

    {InputField[Dynamic[f]], button},
    {Dynamic[graph], SpanFromLeft}},
   Spacings -> {2, 1}, Alignment -> {Left, Baseline}



1 Answer 1


I believe that Mathematica feeds the input string in free-form linguistic input to the function WolframAlpha. Try something like

 If[in =!= "", WolframAlpha[in], "Enter input"],
 {{in, ""}, InputField[Dynamic[in], String] &}

Manipulate output

Response to comment

I can't find a definitive statement in the documentation that an internet connection is required for all free-form linguistic input, but the following suggests that it is (just as I thought, too).

Mathematica graphics

  • $\begingroup$ Thanks, this helps. I really just want the input form of the function, and it looks like I can get it by doing something like WolframAlpha[f, {{"Input", 1}, "Input"}] This is a separate question, but does all of the free-form linguistic input require an internet connection? I see that the WolframAlpha command certainly does, and ideally I'd use something that worked offline as well. $\endgroup$
    – Janet
    Oct 10, 2013 at 23:56
  • $\begingroup$ @Janet I believe an internet connection is required. See update. $\endgroup$
    – Michael E2
    Oct 11, 2013 at 0:20
  • $\begingroup$ Thanks! The same thing happens when I try it offline, so that must just be how it is. $\endgroup$
    – Janet
    Oct 11, 2013 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.