Hello, fellow scientists and students. My question might be very simple to answer: How do I plot the following function
f[x_] := x^4 + a*x^2
where a is a real valued constant for three different values of a? I want to declare this function and then plot a graph with 3 different values for my constant a. Any thoughts? Thanks in advance.
Luciano
Something like:
Plot[Table[f[x], {a, {1, 30, 100}}], {x, 0, 3}]
Thank you, it worked. I am trying to plot the legends alongside the curves, but it's not working since it seems Mathematica interprets like only one function plotted three times. Is there anyway I can plot legends for the constants I am using?
When you get more elaborate, the order of evaluation matters. Plot apparently needs to peek at complicated arguments to understand what to do. So, this works:
Plot
Plot[Evaluate[Table[Labeled[f[x], a], {a, {1, 30, 100}}]], {x, 0, 3}]
It literally solved all my questions. Thank you so much