range = {0, 1};
f[x_] := x^2 - 2x + 1;
df[x_] := D[f[x], x];
increasing = Reduce[df[x] > 0, x] // Quiet;
decreasing = Reduce[df[x] < 0, x] // Quiet;
extremum = Solve[df[x] == 0, x] // Quiet;
monotonicity = Switch[{increasing, decreasing}, {True, False}, "单调递增", {False, True}, "单调递减", {True, True}, "函数是常数"];
extremumValue = Switch[Length[extremum], 0, "无极值点", 1, df[x] > 0 /. extremum[[1]], "极小值", 1, df[x] < 0 /. extremum[[1]], "极大值", _, "拐点"];
Grid[{{"x", range, " ", " "}, {"f'(x)", Switch[df[x], _?Positive, "+", 0, "0", _, "-"], " ", " "}, {"f(x)", "[UpperRightArrow]", extremumValue, "[LowerRightArrow]"}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}, {" ", " ", " ", " "}}, Alignment -> Left]
Mathematica 代码生成函数单调性及极值点表格

原文地址: https://www.cveoy.top/t/topic/oO8y 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录