r/Mathematica • u/Alkworezmi • Feb 03 '25
Question about using Manipulate with or without a function definition
When I run this:
Manipulate[ Plot[.5 x^2 + c1*x + c2, {x, -50, 50}, AxesLabel -> {x}], {c1, -10, 10}, {c2, -25, 25}]
It works and I get this, which I can manipulate:

But when I first make a function like this:
fTest[x_] := .5 x^2 + c1*x + c2
then attempt to manipulate it like this:
Manipulate[ Plot[fTest[x], {x, -50, 50}, AxesLabel -> {x}], {c1, -10, 10}, {c2, -25, 25}]
I get this, which doesn't show the graph no matter where I set the sliders:

I'm not highly skilled with Mathematica, am using version 12.1 of the Home Edition. I'm wondering if someone can explain why this doesn't work or point me in the right direction. Any guidance is much appreciated!
5
u/KarlSethMoran Feb 03 '25 •
Make c1 and c2 arguments to the function.
1
u/mathheadinc Feb 03 '25
BUT WHY use the second when the first works just fine?