# Changing Type of Equation To Graph Through User Interface

I'm new to Mathematica. I am trying to create a graph that can change through user interface in more than just the variables. Ideally, I want the user to click a button and have the equation change from a linear equation to an exponential equation, for example, and then change the variables with sliders. I have the sliders, but I'm not sure how to change the equation itself. My code so far is as follows:

Manipulate[Plot[a*x+b, {x,-5, 6}], {a, -5, 5}, {b, -5, 5}] Manipulate[Plot[a*b^x + c, {x, -5, 6}], {a, -5, 5}, {b, 0.01, 5}, {c, -5, 5}] TabView[
{"Linear:  a x + b" ->
Manipulate[Plot[a x + b, {x, -5, 6}], {a, -5, 5}, {b, -5, 5}],
"Exponential:  a \!$$\*SuperscriptBox[\(b$$, $$x$$]\) + c" ->
Manipulate[
Plot[a b^x + c, {x, -5, 6}], {a, -5, 5}, {b, 1, 5}, {c, -5, 5}]} ]


Do you really want b to take on negative values in the Exponential function?

You can also try MenuView, which may be preferable if you have many functions.

• That's a good point; no, b probably doesn't need to take on negative values in the exponential function. – heather Jun 17 '16 at 18:26
• Thanks, it works! I changed the lower bound for b to 0.01 and there were no errors. – heather Jun 17 '16 at 18:30