# Create an animation that plots the following two functions

How do I create an animation that plots the following two functions? Let x vary from 0 to 15, set the y-values to range from -90 to 90 and include the fill between them. Do not include the axes in the plot. f(x) = x^2 - a*x + 20 + a where a varies from 10 to 15. g(x) = -x^2 + bx + b where b varies from 15 to 10.

I've tried Manipulate[ Plot[f[x, a], g[x, b], {x, 0, 15}], {a, 10, 15}, {b, 15, 10}], but that doesn't work.

You call f and g with two arguments, but they are only defined for a single argument. After fixing several typos, this seems to work:

f[x_, a_] := x^2 - a x + 20 + a;
g[x_, b_] := -x^2 + b x + b;
Manipulate[
Plot[Evaluate[{f[x, a], g[x, b]}], {x, 0, 15}],
{a, 10, 15}, {b, 10, 15}
]

• Nice answer! You can also keep the axes from moving with PlotRange->{-100,100} within Plot.
– mjw
Commented Feb 24, 2019 at 18:41
• With Filling and other items: Manipulate[ Plot[ {f[x, a], g[x, b]}, {x, 0, 15}, Axes -> False, PlotRange -> {-90, 90}, Filling -> {1 -> {2}}, PlotLegends -> Placed[{f[x, a], g[x, b]}, {0.2, 0.15}]], {a, 10, 15, 0.1}, {b, 15, 10, -0.1}, AutoAction -> True] Commented Feb 24, 2019 at 18:50
• Thank you so much guys :) Commented Feb 25, 2019 at 17:36
• You're welcome. Commented Feb 25, 2019 at 18:02