CountRoots[f,x]
一変量関数 f の実根の数を x について与える.
CountRoots[f,{x,a,b}]
a と b の間にある根の数を与える.
CountRoots
CountRoots[f,x]
一変量関数 f の実根の数を x について与える.
CountRoots[f,{x,a,b}]
a と b の間にある根の数を与える.
例題
すべて開く すべて閉じる例 (4)
CountRoots[(x - 1)(x - 2)(x - 3)(x - 4), {x, 0, 5}]CountRoots[x ^ 17 - 1, {x, 0, 1 + I}]CountRoots[Sin[z / 2]^5 + Tan[4z]^3, {z, 0, 10 ^ 10}]CountRoots[Cos[x ^ 3], {x, -2 - 2I, 2 + 2I}]Plot3D[With[{x = u + I v}, Log@Abs[Cos[x ^ 3]]], {u, -2, 2}, {v, -2, 2}, Mesh -> None]スコープ (20)
基本的な用法 (8)
CountRoots[(x ^ 2 - 2)(x ^ 2 - 5), x]CountRoots[(x ^ 2 - 2)(x ^ 2 - 5), {x, -2, 2}]Plot[(x ^ 2 - 2)(x ^ 2 - 5), {x, -2, 2}]CountRoots[(x ^ 4 - 2)(x ^ 4 - 20), {x, -2 - 2I, 2 + 2I}]Plot3D[With[{x = u + I v}, Log@Abs[(x ^ 4 - 2)(x ^ 4 - 20)]], {u, -2, 2}, {v, -2, 2}, Mesh -> None]CountRoots[1 + x ^ 2, {x, -2I, 2I}]CountRoots[1 + x ^ 2, {x, -1 + I, 1 + I}]CountRoots[x ^ 3, {x, -1, 1}]多重度
の根の場合は,
についてのすべての導関数
もまた消失する:
Plot[Evaluate@Table[D[x ^ 3, {x, n}], {n, 0, 2}], {x, -1, 1}, PlotLabels -> {"f", "f'", "f''"}]CountRoots[(x - 1)(x - 2), {x, 0, 2}]CountRoots[x ^ 4 - 1, {x, 0, 1 + I}]実初等関数 (6)
CountRoots[x ^ 1000000 - 2x ^ 777777 + 3x ^ 12345 + 9x ^ 67 - 10, x]CountRoots[2x ^ (123451 / 67890) - x ^ 2 + 4Sqrt[x] - 4x - 9 / 8, {x, 0, ∞}]CountRoots[x ^ Pi - x ^ Sqrt[2] - Sqrt[3]x + 2 ^ (1 / 3), {x, 0, ∞}]CountRoots[E ^ (2E ^ x) - Log[x ^ 2 + 1] - 20x - 11, x]CountRoots[Cos[1 / (x ^ 2 + 1)] - Sin[E ^ -x ^ 2], x]Plot[Cos[1 / (x ^ 2 + 1)] - Sin[E ^ -x ^ 2], {x, -3, 3}]CountRoots[2Sin[Exp[x]] - Cos[Pi x] - 1 / 2, {x, 0, 7}]Plot[2Sin[Exp[x]] - Cos[Pi x] - 1 / 2, {x, 0, 7}]正則関数 (3)
CountRoots[Cos[Sin[x] + 2] - Cos[2 x] - 1, {x, -3 - 3I, 3 + 3I}]CountRoots[FresnelC[x] - x - 1, {x, -2 - 2I, 2 + 2I}]CountRoots[BesselJ[2, x] - Sin[x ^ 2], {x, -3, 3}]Plot[BesselJ[2, x] - Sin[x ^ 2], {x, -3, 3}]有理型関数 (3)
CountRoots[Tan[z] - Log[z + 3] - z ^ 2, {z, -2 - 2I, 2 + 2I}]f = Tan[z] - Log[z + 3] - z ^ 2;
g = f /. z -> x + I y;
rts = {Re[z], Im[z]} /. Solve[f == 0 && -2 ≤ Re[z] ≤ 2 && -2 ≤ Im[z] ≤ 2, z];
Show[{ContourPlot[{Re[g] == 0, Im[g] == 0}, {x, -2, 2}, {y, -2, 2}, Contours -> 0], Graphics[{PointSize[Large], Green, Tooltip[Point[rts], "Root"], Red, Tooltip[Point[{{-Pi / 2, 0}, {Pi / 2, 0}}], "Pole"]}]}]CountRoots[Gamma[z] - z - 1, {z, -2 - 2I, 2 + 2I}]f = Gamma[z] - z - 1;
g = f /. z -> x + I y;
rts = Quiet[{Re[z], Im[z]} /. Solve[f == 0 && -2 ≤ Re[z] ≤ 2 && -2 ≤ Im[z] ≤ 2, z]];
Show[{ContourPlot[{Re[g] == 0, Im[g] == 0}, {x, -2, 2}, {y, -2, 2}, Contours -> 0], Graphics[{PointSize[Large], Green, Tooltip[Point[rts], "Root"], Red, Tooltip[Point[{{-2, 0}, {-1, 0}, {0, 0}}], "Pole"]}]}]CountRoots[Gamma[x] + E ^ x - 7x, {x, -3, 3}]Plot[Gamma[x] + E ^ x - 7x, {x, -3, 3}]アプリケーション (4)
poly = x ^ 17 - 1;
CountRoots[poly, {x, 0, 1 + I}]Graphics[{{GrayLevel[0.7], Rectangle[{0, 0}, {1, 1}]}, {Red, PointSize[Medium], Point[{Re[x], Im[x]} /. NSolve[poly == 0, x]]}}]f = Tan[x] - E ^ x + 7x ^ 2;
CountRoots[f, {x, 8 / 5, 9 / 5}]FindRootを使って根を近似する:
FindRoot[f, {x, 8 / 5, 9 / 5}, Method -> "Brent", WorkingPrecision -> 30]式
を使って関数の対数導関数の閉曲線積分を計算する.ただし,
は正則関数
の根の数である:
f = Sinh[5z] - z;
ldf = D[f, z] / f;
2 Pi I CountRoots[f, {z, -1 - I, 1 + I}]NIntegrate[ldf, {z, -1 - I, 1 - I, 1 + I, -1 + I, -1 - I}] - %//Chop右半平面でCharacteristicPolynomial[m,x]の根を数えることで,動的な線形系
の0における平衡点の安定性をチェックする:
m = {{0, 0, 0, 0, 0, 0, -78375471}, {1, 0, 0, 0, 0, 0, -34057401}, {0, 1, 0, 0, 0, 0, -5727428}, {0, 0, 1, 0, 0, 0, -639271}, {0, 0, 0, 1, 0, 0, -53497}, {0, 0, 0, 0, 1, 0, -2905}, {0, 0, 0, 0, 0, 1, -85}};f = CharacteristicPolynomial[m, x];rb = 1 + Max[Abs[Drop[#, -1] / Last[#]]]&[CoefficientList[f, x]]CountRoots[f, {x, -rb I, rb + rb I}]m のすべての固有値が負の実部を持つので,平衡点は漸近的に安定である:
y = Table[x[i][t], {i, 7}];
sol = DSolveValue[{D[y, t] == m.y, (y /. t -> 0) == 1}, y, t]//N;
Plot[sol, {t, 0, 30}]m = {{0, 0, 0, 0, 0, 0, 78375471}, {1, 0, 0, 0, 0, 0, -34057401}, {0, 1, 0, 0, 0, 0, -5727428}, {0, 0, 1, 0, 0, 0, -639271}, {0, 0, 0, 1, 0, 0, -53497}, {0, 0, 0, 0, 1, 0, -2905}, {0, 0, 0, 0, 0, 1, -85}};f = CharacteristicPolynomial[m, x];
rb = 1 + Max[Abs[Drop[#, -1] / Last[#]]]&[CoefficientList[f, x]];
CountRoots[f, {x, -rb I, rb + rb I}]y = Table[x[i][t], {i, 7}];
sol = DSolveValue[{D[y, t] == m.y, (y /. t -> 0) == 1}, y, t]//N;
Plot[sol, {t, 0, 30}]特性と関係 (5)
poly = x ^ 10 - 17x ^ 7 + 21x ^ 3 - 55x ^ 2 + 22x + 2;CauchyBound[f_, x_] := Module[{cfl, n},
cfl = CoefficientList[f, x];
n = Length[cfl] - 1;
Max[Table[(n Abs[cfl[[n + 1 - k]] / cfl[[n + 1]]]) ^ (1 / k), {k, n}]]]b = Ceiling[CauchyBound[poly, x]]この多項式は実際にコーシー(Cauchy)の有界範囲で10個の根を持つ:
CountRoots[poly, {x, -b - b I, b + b I}]poly = Expand[x(x ^ 4 - 1)(x ^ 4 - 2)(x ^ 4 - 3)]CountRoots[poly, {x, -Infinity, Infinity}]Reduceを使って多項式の根を求める:
poly = (x ^ 2 - 2)(x ^ 3 - 5x + 1);CountRoots[poly, {x, 0, 3}]Reduce[poly == 0 && 0 ≤ x ≤ 3, x]RootIntervalsを使って根の分離区間を求める:
poly = (x ^ 4 - 2)(x ^ 8 - 3);CountRoots[poly, {x, -Infinity, Infinity}]RootIntervals[poly]NumberFieldSignatureを使って多項式の実根と複素根のペアを数える:
poly = x ^ 8 - 2;NumberFieldSignature[poly, x]CountRoots[poly, {x, -Infinity, Infinity}]関連するガイド
-
▪
- 整方程式
テキスト
Wolfram Research (2007), CountRoots, Wolfram言語関数, https://reference.wolfram.com/language/ref/CountRoots.html (2017年に更新).
CMS
Wolfram Language. 2007. "CountRoots." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/CountRoots.html.
APA
Wolfram Language. (2007). CountRoots. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CountRoots.html
BibTeX
@misc{reference.wolfram_2026_countroots, author="Wolfram Research", title="{CountRoots}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/CountRoots.html}", note=[Accessed: 11-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_countroots, organization={Wolfram Research}, title={CountRoots}, year={2017}, url={https://reference.wolfram.com/language/ref/CountRoots.html}, note=[Accessed: 11-September-2026]}