利用函数Manipulate或Animate
代码示例:
Clear["`*"];
Manipulate[x^2, {x, 0, 1}]
Manipulate[a*x^2, {x, 0, 1}, {a, -1, 1}]
Manipulate[
Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}], {a, -1, 1}, {b, -1, 1}]
Manipulate[
Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[1]], {a, -1, 1}, {b, -1, 1}]
Manipulate[
Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]], {a, -1,
1}, {b, -1, 1}]
Animate[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[1]], {a, -1,
1}, {b, -1, 1}]
Animate[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]], {a, -1,
1}, {b, -1, 1}]
Manipulate[
Reduce[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]] >
0], {a, -1, 1}, {b, -1, 1}]
Manipulate[
Reduce[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]] ==
0], {a, -1, 1}, {b, -1, 1}]
Manipulate[
Reduce[Maximize[{a*x^2 - b, 0 <= x <= 1}, {x}][[2, 1, 2]] <
0], {a, -1, 1}, {b, -1, 1}]
输出结果: