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

絶対値を含む方程式・不等式

絶対値の定義

「東京から大阪まで何キロ?」——この距離は「マイナス500km」とは言いません。距離は常に0以上です。絶対値はこの「距離」の感覚を数式で表したものです。

x={x(x0)x(x<0)|x| = \begin{cases} x & (x \geq 0) \\ -x & (x < 0) \end{cases}

絶対値は数直線上の原点からの距離です。そして xa|x - a| は、点 aa からの距離を表します。

|5| = 5
|-3| = 3
|x - 3| = "x と 3 の距離"

この「距離」としての解釈がすべての問題の出発点です——「式の計算」ではなく「地図上の距離探し」だと思うと、解法が見えてきます。


絶対値方程式

基本形:xa=b|x - a| = bb0b \geq 0

aa からの距離が bb 」を満たす xx を求めます。距離が bb になる点は、aa の左側と右側の2か所です。

|x - a| = b  ⟺  x - a = b  または  x - a = -b
           ⟺  x = a + b  または  x = a - b

例:x3=2|x - 3| = 2

「3から距離2の点」——数直線上で3から2進んだ点は5か1です。

x - 3 = 2  →  x = 5
x - 3 = -2 →  x = 1

解:x=5x = 5 または x=1x = 1

例:2x+1=5|2x + 1| = 5

2x + 1 = 5  →  x = 2
2x + 1 = -5 →  x = -3

例:x2=x+4|x - 2| = |x + 4|

両辺が等しい → 2つのケース:

x - 2 = x + 4  →  -2 = 4  (矛盾・解なし)
x - 2 = -(x+4) →  2x = -2  →  x = -1

解:x=1x = -1(-2と4の中点)——「両点からの距離が等しい点は、中点」という感覚とも一致します。


絶対値不等式

xa<r|x - a| < rr>0r > 0

aa からの距離が rr 未満」——aa を中心に半径 rr の範囲内です。

|x - a| < r  ⟺  a - r < x < a + r

xa>r|x - a| > rr>0r > 0

aa からの距離が rr より大」——aa から rr より遠い場所、つまり中心から外側の2つの領域です。

|x - a| > r  ⟺  x < a - r  または  x > a + r
|x - a| < r の距離としての解釈:マウスで a の値を変えて解の範囲を確認
var r = 2.5;

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

var a = -4 + (mx / W) * 10;

ctx.fillStyle = '#94a3b8'; ctx.font = '15px monospace'; ctx.textAlign = 'center';
ctx.fillText('|x − ' + a.toFixed(1) + '| < ' + r + '  の解', W/2, 26);
ctx.fillStyle = '#e2e8f0'; ctx.font = '13px monospace';
ctx.fillText('' + (a-r).toFixed(1) + ' < x < ' + (a+r).toFixed(1), W/2, 48);

var ny = 130, nx0=60, nx1=W-60, nrange=12, nscale=(nx1-nx0)/nrange, ncx=(nx0+nx1)/2;

ctx.strokeStyle='#475569'; ctx.lineWidth=2;
ctx.beginPath(); ctx.moveTo(nx0,ny); ctx.lineTo(nx1,ny); ctx.stroke();
for (var tick=-6; tick<=6; tick++) {
  var tx=ncx+tick*nscale;
  ctx.beginPath(); ctx.moveTo(tx,ny-5); ctx.lineTo(tx,ny+5); ctx.stroke();
  ctx.fillStyle='#64748b'; ctx.font='11px monospace'; ctx.textAlign='center';
  ctx.fillText(tick, tx, ny+18);
}

// Solution region
var lx = Math.max(nx0, ncx+(a-r)*nscale);
var rx = Math.min(nx1, ncx+(a+r)*nscale);
ctx.fillStyle='#3b82f6'; ctx.globalAlpha=0.4;
ctx.fillRect(lx, ny-12, rx-lx, 24);
ctx.globalAlpha=1;

// Center point a
var ax = ncx + a*nscale;
ctx.fillStyle='#fbbf24';
ctx.beginPath(); ctx.arc(ax, ny, 7, 0, Math.PI*2); ctx.fill();
ctx.fillStyle='#fde68a'; ctx.font='bold 12px monospace'; ctx.textAlign='center';
ctx.fillText('a=' + a.toFixed(1), ax, ny-18);

// Distance arrows
ctx.strokeStyle='#ef4444'; ctx.lineWidth=1.5;
ctx.setLineDash([3,3]);
ctx.beginPath(); ctx.moveTo(ax, ny-30); ctx.lineTo(lx, ny-30); ctx.stroke();
ctx.beginPath(); ctx.moveTo(ax, ny-30); ctx.lineTo(rx, ny-30); ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle='#ef4444'; ctx.font='12px monospace'; ctx.textAlign='center';
ctx.fillText('r=' + r, (ax+lx)/2, ny-42);
ctx.fillText('r=' + r, (ax+rx)/2, ny-42);

// Boundary open circles
ctx.strokeStyle='#93c5fd'; ctx.lineWidth=2;
ctx.beginPath(); ctx.arc(lx, ny, 5, 0, Math.PI*2); ctx.stroke();
ctx.fillStyle='#0d1117'; ctx.beginPath(); ctx.arc(lx, ny, 5, 0, Math.PI*2); ctx.fill();
ctx.strokeStyle='#93c5fd'; ctx.stroke();
ctx.beginPath(); ctx.arc(rx, ny, 5, 0, Math.PI*2); ctx.stroke();
ctx.fillStyle='#0d1117'; ctx.beginPath(); ctx.arc(rx, ny, 5, 0, Math.PI*2); ctx.fill();
ctx.strokeStyle='#93c5fd'; ctx.stroke();

ctx.fillStyle='#93c5fd'; ctx.font='12px monospace'; ctx.textAlign='left';
ctx.fillText((a-r).toFixed(1), lx-16, ny+32);
ctx.fillStyle='#93c5fd'; ctx.textAlign='right';
ctx.fillText((a+r).toFixed(1), rx+16, ny+32);

ctx.fillStyle='#64748b'; ctx.font='12px monospace'; ctx.textAlign='center';
ctx.fillText('マウスで a を動かす(r = ' + r + ' 固定)', W/2, 230);

requestAnimationFrame(loop);
}
loop();

場合分けによる解法

絶対値を含む式は、中身の符号で場合分けします——「xx がどの値のとき、絶対値の中がプラスかマイナスか」を考えます。

例:x+2+x1=5|x + 2| + |x - 1| = 5

分岐点は x=2x = -2x=1x = 1。3つの範囲に分けます:

場合1x<2x < -2 のとき(どちらも中身がマイナス)

(x+2)+(x1)=5-(x+2) + -(x-1) = 52x1=5-2x - 1 = 5x=3x = -3 ✓(x<2x < -2 を満たす)

場合22x<1-2 \leq x < 1 のとき(左はプラス、右はマイナス)

(x+2)+(x1)=5(x+2) + -(x-1) = 53=53 = 5矛盾(解なし)

場合3x1x \geq 1 のとき(どちらも中身がプラス)

(x+2)+(x1)=5(x+2) + (x-1) = 52x+1=52x + 1 = 5x=2x = 2

解:x=3x = -3 または x=2x = 2


三角不等式

a+ba+b|a + b| \leq |a| + |b|

これを三角不等式と言います。等号成立は aabb が同符号(または一方が0)のとき。

幾何学的意味

「2辺の和は1辺より長い(または等しい)」——三角形の法則そのものです。まっすぐ行くより、寄り道すると距離が伸びます。

複素数(またはベクトル)でも同様:

z1+z2z1+z2|z_1 + z_2| \leq |z_1| + |z_2|

よく使う形

|a| - |b| ≤ |a - b| ≤ |a| + |b|
||a| - |b|| ≤ |a - b|
|x-a| + |x-b| の最小値は |a-b|(2点間の距離):マウスで x を動かして確認
var pa = -2, pb = 2;

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

var x = -5 + (mx/W)*10;
var sumDist = Math.abs(x - pa) + Math.abs(x - pb);
var minDist = Math.abs(pa - pb);

ctx.fillStyle='#94a3b8'; ctx.font='14px monospace'; ctx.textAlign='center';
ctx.fillText('|x - a| + |x - b| の最小値を確認', W/2, 26);
ctx.fillText('a = ' + pa + ',  b = ' + pb + ',  x = ' + x.toFixed(2), W/2, 46);

var ny=130, nx0=60, nx1=W-60, nrange=12, nscale=(nx1-nx0)/nrange, ncx=(nx0+nx1)/2;

ctx.strokeStyle='#475569'; ctx.lineWidth=2;
ctx.beginPath(); ctx.moveTo(nx0,ny); ctx.lineTo(nx1,ny); ctx.stroke();
for (var tick=-6; tick<=6; tick++) {
  var tx=ncx+tick*nscale;
  ctx.beginPath(); ctx.moveTo(tx,ny-5); ctx.lineTo(tx,ny+5); ctx.stroke();
  ctx.fillStyle='#64748b'; ctx.font='11px monospace'; ctx.textAlign='center';
  ctx.fillText(tick, tx, ny+18);
}

// Points a and b
var pax=ncx+pa*nscale, pbx=ncx+pb*nscale, xx=ncx+x*nscale;

ctx.fillStyle='#3b82f6';
ctx.beginPath(); ctx.arc(pax,ny,7,0,Math.PI*2); ctx.fill();
ctx.fillStyle='#93c5fd'; ctx.font='bold 13px monospace'; ctx.textAlign='center';
ctx.fillText('a', pax, ny-16);

ctx.fillStyle='#ef4444';
ctx.beginPath(); ctx.arc(pbx,ny,7,0,Math.PI*2); ctx.fill();
ctx.fillStyle='#fca5a5'; ctx.font='bold 13px monospace'; ctx.textAlign='center';
ctx.fillText('b', pbx, ny-16);

// x point
ctx.fillStyle='#fbbf24';
ctx.beginPath(); ctx.arc(xx,ny,7,0,Math.PI*2); ctx.fill();
ctx.fillStyle='#fde68a'; ctx.font='bold 13px monospace';
ctx.fillText('x', xx, ny-16);

// Distance lines
ctx.strokeStyle='#3b82f6'; ctx.lineWidth=2;
ctx.beginPath(); ctx.moveTo(xx, ny+28); ctx.lineTo(pax, ny+28); ctx.stroke();
ctx.fillStyle='#93c5fd'; ctx.font='12px monospace'; ctx.textAlign='center';
ctx.fillText(Math.abs(x-pa).toFixed(2), (xx+pax)/2, ny+44);

ctx.strokeStyle='#ef4444'; ctx.lineWidth=2;
ctx.beginPath(); ctx.moveTo(xx, ny+52); ctx.lineTo(pbx, ny+52); ctx.stroke();
ctx.fillStyle='#fca5a5'; ctx.font='12px monospace'; ctx.textAlign='center';
ctx.fillText(Math.abs(x-pb).toFixed(2), (xx+pbx)/2, ny+68);

var isMin = x >= pa && x <= pb;
ctx.fillStyle = isMin ? '#22c55e' : '#f59e0b';
ctx.font='bold 14px monospace'; ctx.textAlign='center';
ctx.fillText('合計 = ' + sumDist.toFixed(2) + '  最小値 = ' + minDist + (isMin ? '  ✓最小!' : ''), W/2, 225);
ctx.fillStyle='#64748b'; ctx.font='12px monospace';
ctx.fillText('x が a と b の間にあるとき最小値 |a-b| = ' + minDist + ' を達成', W/2, 245);

requestAnimationFrame(loop);
}
loop();

絶対値を含む不等式:練習

  1. x4<3|x - 4| < 31<x<71 < x < 7——「4から距離3以内」

  2. 2x+15|2x + 1| \geq 5x3x \leq -3 または x2x \geq 2——「距離5以上の外側」

  3. x+x2<4|x| + |x - 2| < 4 場合分け(x<0x < 00x<20 \leq x < 2x2x \geq 2)で解くと 1<x<3-1 < x < 3


まとめ

  • xa|x - a| = 「aa からの距離」→ これが問題を解く最大の視点——「計算式ではなく距離の問題」
  • xa<r|x - a| < rar<x<a+ra - r < x < a + raa の周囲の区間)——「中心から半径 rr の内側」
  • xa>r|x - a| > rx<arx < a - r または x>a+rx > a + r(外側の領域)——「中心から半径 rr の外側」
  • 複雑な式は分岐点で場合分けして各区間で解く——「絶対値の中身がどこでプラス・マイナスが変わるか」
  • 三角不等式 a+ba+b|a+b| \leq |a|+|b| は頻出——「寄り道すると距離が伸びる」

次回は二項定理とパスカルの三角形を学びます。第1回で登場した (a+b)n(a+b)^n の係数パターンの深い構造が明らかになります。