#15 ふれてみよう高校数学 代数と式の操作

多項式の割り算と剰余定理

多項式の割り算

「17 ÷ 5 = 3 余り2」——整数の割り算では「商」と「余り」が出てきます。多項式でも全く同じことができます。「式の17に相当する式を、式の5に相当する式で割る」というイメージです。

整数の割り算 17÷5=3217 \div 5 = 3 \cdots 2(商3、余り2)と同様に、多項式にも割り算があります。

f(x)=d(x)q(x)+r(x)f(x) = d(x) \cdot q(x) + r(x)

  • f(x)f(x):被除式(割られる式)
  • d(x)d(x):除式(割る式)
  • q(x)q(x):商
  • r(x)r(x):余り(次数 < d(x)d(x) の次数)

長除法

f(x)=x3+2x2x+3f(x) = x^3 + 2x^2 - x + 3d(x)=x2d(x) = x - 2 で割ります。「数の筆算と同じ手順で、式の係数を扱う」だけです。

         x² + 4x + 7
       ____________
x - 2 | x³ + 2x² - x + 3
        x³ - 2x²
       -----------
             4x² - x
             4x² - 8x
            ----------
                  7x + 3
                  7x - 14
                 ---------
                      17   ← 余り

よって商 =x2+4x+7= x^2 + 4x + 7、余り =17= 17

検算(x2)(x2+4x+7)+17=x3+4x2+7x2x28x14+17=x3+2x2x+3(x-2)(x^2+4x+7) + 17 = x^3+4x^2+7x - 2x^2-8x-14+17 = x^3+2x^2-x+3


剰余定理の確認

f(2)=8+82+3=17f(2) = 8 + 8 - 2 + 3 = 17

これは余り =17= 17 と一致しています。剰余定理の通りです:

x=2x = 2 を代入した値が余りになる」——割り算の計算を最後までしなくても、代入するだけで余りがわかります。

f(x) を (xa) で割った余りは f(a)f(x) \text{ を } (x-a) \text{ で割った余りは } f(a)


組立除法の復習

(xa)(x-a) で割る場合は組立除法が高速です——「式全体を書かずに、係数だけを操作する省力版の割り算」です。

x3+2x2x+3x^3 + 2x^2 - x + 3(x2)(x-2) で割る(a=2a = 2):

2 | 1   2  -1   3
  |     2   8  14
  ----------------
    1   4   7  17
  • 商の係数:1,4,71, 4, 7x2+4x+7x^2 + 4x + 7
  • 余り:1717

手順

  1. 最初の係数をそのまま下へ
  2. 下の数 × aa → 右にずらして上の数に足す
  3. 繰り返す
  4. 最後の数が余り

因数定理との連携

第10回で学んだ因数定理をここでもう一度確認します。

f(a)=0    (xa) は f(x) の因数f(a) = 0 \iff (x - a) \text{ は } f(x) \text{ の因数}

これは剰余定理の特別な場合です。余りがゼロ = 割り切れる = 因数——「余りなくピッタリ割れる」ということが「因数」の定義です。

例:f(x)=x37x+6f(x) = x^3 - 7x + 6 を完全因数分解

有理根候補:±1,±2,±3,±6\pm 1, \pm 2, \pm 3, \pm 6

f(1)=17+6=0f(1) = 1 - 7 + 6 = 0(x1)(x-1) は因数——代入してゼロになった!

1 | 1   0  -7   6
  |     1   1  -6
  -----------------
    1   1  -6   0

商:x2+x6=(x+3)(x2)x^2 + x - 6 = (x+3)(x-2)

完全因数分解:f(x)=(x1)(x+3)(x2)f(x) = (x-1)(x+3)(x-2)


グラフと根の可視化

f(x) = x³ - 7x + 6 と3つの根:マウスのX位置でスライダーとして f(a) を表示
function loop() {
ctx.clearRect(0, 0, W, H);

var cx = W/2, cy = H/2;
var scaleX = 50, scaleY = 10;
var a = -4 + (mx/W)*8;  // -4 to 4

// Grid
ctx.strokeStyle = '#1a2036'; ctx.lineWidth = 1;
for (var gx=-5; gx<=5; gx++) {
  ctx.beginPath(); ctx.moveTo(cx+gx*scaleX,0); ctx.lineTo(cx+gx*scaleX,H); ctx.stroke();
}

// Axes
ctx.strokeStyle = '#334155'; ctx.lineWidth = 1.5;
ctx.beginPath(); ctx.moveTo(0,cy); ctx.lineTo(W,cy); ctx.stroke();
ctx.beginPath(); ctx.moveTo(cx,0); ctx.lineTo(cx,H); ctx.stroke();

ctx.fillStyle = '#475569'; ctx.font = '11px monospace'; ctx.textAlign = 'center';
for (var n=-5; n<=5; n++) {
  if (n===0) continue;
  ctx.fillText(n, cx+n*scaleX, cy+14);
}

// f(x) = x³ - 7x + 6
ctx.strokeStyle = '#3b82f6'; ctx.lineWidth = 2.5;
ctx.beginPath();
var started = false;
for (var px=0; px<=W; px+=2) {
  var xv = (px-cx)/scaleX;
  var yv = xv*xv*xv - 7*xv + 6;
  var py = cy - yv * scaleY;
  if (py < -60 || py > H+60) { started=false; continue; }
  if (!started) { ctx.moveTo(px,py); started=true; } else ctx.lineTo(px,py);
}
ctx.stroke();

// Roots at x=-3, 1, 2
var roots = [-3, 1, 2];
var rootColors = ['#ef4444','#fbbf24','#22c55e'];
for (var ri=0; ri<3; ri++) {
  ctx.fillStyle = rootColors[ri];
  ctx.beginPath();
  ctx.arc(cx+roots[ri]*scaleX, cy, 7, 0, Math.PI*2);
  ctx.fill();
  ctx.fillStyle = rootColors[ri]; ctx.font='bold 13px monospace'; ctx.textAlign='center';
  ctx.fillText('x='+roots[ri], cx+roots[ri]*scaleX, cy-16);
}

// Slider point for f(a)
var fa = a*a*a - 7*a + 6;
var sliderPx = cx + a*scaleX;
var sliderPy = cy - fa*scaleY;
sliderPy = Math.max(10, Math.min(H-10, sliderPy));

// Dashed vertical line
ctx.strokeStyle = '#fbbf24'; ctx.lineWidth = 1; ctx.setLineDash([4,4]);
ctx.beginPath(); ctx.moveTo(sliderPx, cy); ctx.lineTo(sliderPx, sliderPy); ctx.stroke();
ctx.setLineDash([]);

// Point on curve
var isRoot = Math.abs(fa) < 0.3;
ctx.fillStyle = isRoot ? '#22c55e' : '#f59e0b';
ctx.beginPath();
ctx.arc(sliderPx, sliderPy, 8, 0, Math.PI*2);
ctx.fill();

// Info panel
ctx.fillStyle = '#0f172a'; ctx.fillRect(8,8,280,90);
ctx.strokeStyle = '#334155'; ctx.lineWidth=1; ctx.strokeRect(8,8,280,90);
ctx.font='13px monospace'; ctx.textAlign='left';
ctx.fillStyle = '#e2e8f0';
ctx.fillText('f(x) = x³ - 7x + 6', 18, 28);
ctx.fillText('a = ' + a.toFixed(2), 18, 48);
ctx.fillStyle = isRoot ? '#22c55e' : '#f59e0b';
ctx.fillText('f(a) = ' + fa.toFixed(3) + (isRoot ? '  ≈ 0 → 根!' : ''), 18, 68);
ctx.fillStyle = '#94a3b8';
ctx.fillText('因数分解:(x+3)(x-1)(x-2)', 18, 88);

requestAnimationFrame(loop);
}
loop();

f(a)=0f(a) = 0 のとき (xa)(x-a) が因数である理由

「なぜ代入してゼロになると因数なのか?」——剰余定理から直接証明できます:

f(x)=(xa)q(x)+rf(x) = (x-a)q(x) + rrr は定数)

x=ax = a を代入:f(a)=0q(a)+r=rf(a) = 0 \cdot q(a) + r = r

f(a)=0f(a) = 0 なら r=0r = 0、つまり f(x)=(xa)q(x)f(x) = (x-a)q(x)(割り切れる)

「代入してゼロ → 余りがゼロ → 割り切れる → 因数」という論理のつながりです。


一般の除式による割り算

f(x)f(x) を2次式 d(x)=x2+px+qd(x) = x^2 + px + q で割る場合、余りは1次以下の式 r(x)=Ax+Br(x) = Ax + B になります。

例:f(x)=x4+1f(x) = x^4 + 1x21x^2 - 1 で割る

長除法の手順:
x^4 ÷ x^2 = x^2  →  x^2(x^2-1) = x^4-x^2  →  余り: x^2+1
x^2 ÷ x^2 = 1    →  1(x^2-1) = x^2-1      →  余り: 2

結果:x4+1=(x21)(x2+1)+2x^4 + 1 = (x^2-1)(x^2+1) + 2

剰余定理の拡張:f(1)=2f(1) = 2 でも f(1)=2f(-1) = 2 でも確認できます。


恒等式と方程式の違い

「両者の違いを意識していなかった」という人は意外と多いです。

恒等式:すべての xx の値で成立する等式——「どんな数を代入しても常に正しい」

方程式:特定の xx の値でのみ成立する等式——「ある特定の数を代入したときだけ正しい」

恒等式の例:

(x-1)(x+1) = x² - 1    ← すべての x で成立
x² + 5x + 6 = (x+2)(x+3)  ← すべての x で成立

係数比較法:両辺の同じ次数の係数が等しいことを利用して未知の係数を求める。

例:3x2+7x+2A(x+1)(x+2)+B(x+2)+C3x^2 + 7x + 2 \equiv A(x+1)(x+2) + B(x+2) + C を求める

x=1x = -137+2=B(1)3-7+2 = B(1)B=2B = -2

x=2x = -21214+2=C12-14+2 = CC=0C = 0

係数比較(x2x^2):3=A3 = AA=3A = 3

多項式除法の視覚化:f(x) を (x-a) で割った商と余り。マウスで a を変える
function polyDiv(coeffs, a) {
// coeffs: [c_n, c_{n-1}, ..., c_0] (high to low)
var result = [coeffs[0]];
for (var i = 1; i < coeffs.length - 1; i++) {
  result.push(result[result.length-1]*a + coeffs[i]);
}
var remainder = result[result.length-1]*a + coeffs[coeffs.length-1];
return { quotient: result, remainder: remainder };
}

function loop() {
ctx.clearRect(0, 0, W, H);

var a = -3 + (mx/W)*6;
// f(x) = x^4 - x^3 - 7x^2 + x + 6
var coeffs = [1, -1, -7, 1, 6];
var res = polyDiv(coeffs, a);
var fa = coeffs[0];
for (var i=1; i<coeffs.length; i++) { fa = fa*a + coeffs[i]; }

ctx.fillStyle = '#94a3b8'; ctx.font='14px monospace'; ctx.textAlign='center';
ctx.fillText('f(x) = x⁴ - x³ - 7x² + x + 6  を  (x - a) で割る', W/2, 24);

// Synth div display
var ox = 60, oy = 55, colW = 70;
ctx.fillStyle = '#fbbf24'; ctx.font='bold 14px monospace'; ctx.textAlign='right';
ctx.fillText(a.toFixed(2) + ' |', ox-4, oy+20);

var labels = ['x⁴', 'x³', 'x²', 'x¹', 'x⁰'];
for (var i=0; i<coeffs.length; i++) {
  ctx.fillStyle = '#93c5fd'; ctx.font='12px monospace'; ctx.textAlign='center';
  ctx.fillText(labels[i], ox+i*colW+colW/2, oy);
  ctx.fillStyle = '#e2e8f0'; ctx.font='13px monospace';
  ctx.fillText(coeffs[i], ox+i*colW+colW/2, oy+20);
}

ctx.strokeStyle = '#334155'; ctx.lineWidth=1;
ctx.beginPath(); ctx.moveTo(ox-10, oy+30); ctx.lineTo(ox+coeffs.length*colW+10, oy+30); ctx.stroke();

// Synthetic division intermediate row
for (var i=0; i<res.quotient.length; i++) {
  var mul = i===0 ? 0 : res.quotient[i-1]*a;
  ctx.fillStyle = '#86efac'; ctx.font='12px monospace'; ctx.textAlign='center';
  if (i>0) ctx.fillText(mul.toFixed(1), ox+i*colW+colW/2, oy+46);
}
ctx.strokeStyle = '#1e3a5f'; ctx.lineWidth=1;
ctx.beginPath(); ctx.moveTo(ox-10, oy+55); ctx.lineTo(ox+coeffs.length*colW+10, oy+55); ctx.stroke();

// Result row
for (var i=0; i<res.quotient.length; i++) {
  ctx.fillStyle = '#c4b5fd'; ctx.font='bold 13px monospace'; ctx.textAlign='center';
  ctx.fillText(res.quotient[i].toFixed(1), ox+i*colW+colW/2, oy+72);
}
var isRoot = Math.abs(res.remainder) < 0.01;
ctx.fillStyle = isRoot ? '#22c55e' : '#f59e0b';
ctx.font='bold 14px monospace'; ctx.textAlign='center';
ctx.fillText(res.remainder.toFixed(2), ox+res.quotient.length*colW+colW/2, oy+72);

ctx.fillStyle = '#c4b5fd'; ctx.font='13px monospace'; ctx.textAlign='left';
ctx.fillText('商: ' + res.quotient.map(function(v,i){return v.toFixed(1)+'x^'+(3-i);}).join(' + '), ox, oy+100);

ctx.fillStyle = isRoot ? '#22c55e' : '#f59e0b';
ctx.fillText('余り: ' + res.remainder.toFixed(3) + (isRoot ? '  → 因数! (x - '+a.toFixed(2)+') は f(x) の因数' : ''), ox, oy+122);

ctx.fillStyle = '#fbbf24'; ctx.font='bold 13px monospace'; ctx.textAlign='left';
ctx.fillText('剰余定理: f(' + a.toFixed(2) + ') = ' + fa.toFixed(3), ox, oy+148);

var match = Math.abs(fa - res.remainder) < 0.01;
ctx.fillStyle = match ? '#22c55e' : '#ef4444';
ctx.fillText(match ? '✓ 一致確認' : '計算エラー', ox+250, oy+148);

ctx.fillStyle = '#64748b'; ctx.font='12px monospace'; ctx.textAlign='center';
ctx.fillText('マウスで a を変える(現在 a = ' + a.toFixed(2) + ')', W/2, H-14);

requestAnimationFrame(loop);
}
loop();

このシリーズで学んだこと:全体マップ

式の展開 (ep.1)
    ↓ 逆操作
因数分解の基本 (ep.2) → 応用 (ep.3)
    ↓ 応用先
有理式 (ep.4) ←→ 方程式・不等式 (ep.8-12)

根号・無理数 (ep.5) ← 有理化

複素数 (ep.6-7) ← √-1 の世界

高次方程式 (ep.10) ← 因数定理 (ep.10, 15)
絶対値 (ep.13)
二項定理 (ep.14)
多項式除法 (ep.15) ← 剰余定理 → 因数定理

まとめ

  • 多項式 f(x)f(x)(xa)(x-a) で割った余りは f(a)f(a)(剰余定理)——「割り算の余り = 代入した値」
  • f(a)=0f(a) = 0 なら (xa)(x-a)因数(因数定理)——「代入してゼロ = 割り切れる」
  • 長除法:数の割り算と同じ手順で係数を操作——「筆算と同じ感覚」
  • 組立除法(xa)(x-a) で割る場合の高速アルゴリズム——「係数だけで計算する省力版」
  • 恒等式:すべての xx で成立。係数比較で未知数を求める——「どんな値を代入しても成り立つ」

シリーズ「代数と式の操作」を終えて

15回にわたって代数の核心を巡ってきました。

テーマ核心の概念
1-3展開と因数分解積⇔和の変換
4-5有理式・無理数分母の整理
6-7複素数i = √-1 の世界
8-10方程式等式・高次・因数定理
11-13不等式・絶対値解の範囲・場合分け
14-15二項定理・除法係数の構造

代数は「式を変形して本質を取り出す」技術です。すべての操作は「見た目を変えるが値は変えない」という一点に集約されます——「変形しても等しい」という感覚が身についたとき、数学は一段と面白くなります。

次のステップとして、「数学関数とグラフ」シリーズ「微積分入門」シリーズへの挑戦をお勧めします。ここで学んだ代数の力が縦横無尽に活躍するでしょう。