# How to build an interface that plots an equation given as text by a user?

I would like to create a window where a student may enter an equation and, by clicking on a button, the function gets plotted.

In the original Spanish:

Quiero realizar una ventana en la cual el alumno tenga la opción de ingresar una ecuación la cual al presionar un botón se grafique.

-
Sorry, but this question is totally incomprehensible. You might even do better to ask in Spanish, rather than using wrongly machine-translated English that nobody can understand. // Lo sentimos, pero esta cuestión es totalmente incomprensible. Incluso puede ser mejor preguntar en español, en lugar de la máquina incorrecta traducido Inglés que nadie puede entender. –  Oleksandr R. Jan 3 at 2:59
Although I really like your language, it is convenient to write in English on this site. Would you mind to translate it for us? –  halirutan Jan 3 at 20:09
Perhaps you can use DialogInput. –  Michael E2 Jan 3 at 20:58
@MichaelE2 I hijacked the edit and changed "function" to "equation". –  Yves Klett Jan 3 at 20:59
@halirutan sorry--I thought it would probably be better for the OP to ask in a language in which she can produce a coherent question and rely on someone else to translate, rather than writing in hopelessly broken English. I realise that this isn't completely ideal, but it gives us all the best chance of being able to communicate. If the questions aren't any good for other reasons, that's another issue, of course. –  Oleksandr R. Jan 3 at 21:08

Panel[DynamicModule[{f = Sin[x^2]},
Column[{InputField[Dynamic[f]], Dynamic[Plot[f, {x, -5, 5}]]}]]]


or even simpler

Manipulate[Plot[f, {x, -5, 5}], {f, Sin[x^2]}]


I am not sure what exactly you are trying to do with your students. But if the goal is to spare them programming Plot[...] etc., you could just use free form linguistic input (or go to Wolfram|Alpha). The advantage is students wouldn't have to know strict syntax for functions:

-
If that's what I want, but instead of putting Sin in English, Spanish put in Seno –  Starlight Jan 3 at 22:40
@JennyOjeda pretendes demasiado. WolframAlpha puede entender código en lenguaje natural pero sólo en inglés por ahora. / You are hoping for too much. I believe WolframAlpha for now can only interpret natural input in English –  Rojo Jan 3 at 23:01
@JennyOjeda Yes for now W|A is English only, but I thought mathematical symbols are universal: sin(x) is that in any language –  Vitaliy Kaurov Jan 3 at 23:05
@VitaliyKaurov $余弦^2(x) + 正弦^2(x) = 1$ :D –  rm -rf Jan 4 at 2:04
I need to make a window in mathematica, it is the only software i can handle, and I would add that textfield in which you enter the abbreviated function Seno ie Sen (x) and i don´t know how to convert. –  Starlight Jan 4 at 19:15
show 1 more comment