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

二次不等式の解法

2次不等式とは

「ある商品の利益が x2+4x3-x^2 + 4x - 3 円で表されるとき、利益が0より大きくなるのはいつか?」——こういった問いに答えるのが2次不等式です。

ax2+bx+c>0ax^2 + bx + c > 0(または <0,0,0< 0, \geq 0, \leq 0)の形の不等式を2次不等式と言います。

解法の鍵は:

  1. y=ax2+bx+cy = ax^2 + bx + c のグラフを(頭の中で)描く
  2. y>0y > 0」なら xx 軸よりの領域、「y<0y < 0」ならxx 軸よりの領域
  3. 判別式 DD によって解の形が変わる

「グラフで考える」——これが2次不等式を解く最大のポイントです。


a>0a > 0 の場合(上に開く放物線)

a>0a > 0 のとき、放物線は下に凸(上に開く)です——「谷形の曲線」です。

ケース1:D>0D > 0xx 軸と2点で交わる)

α<β\alpha < \beta を2つの実数解とすると、「谷の底」が xx 軸より下なので:

ax²+bx+c > 0  →  x < α  または  x > β   (外側)
ax²+bx+c < 0  →  α < x < β               (谷の中)

ケース2:D=0D = 0xx 軸に接する、重解 α\alpha

ax²+bx+c > 0  →  x ≠ α のすべての実数(x < α または x > α)
ax²+bx+c < 0  →  解なし
ax²+bx+c ≥ 0  →  すべての実数

ケース3:D<0D < 0xx 軸と交わらない)

a>0a > 0 のとき、グラフ全体が xx 軸より上——「全部プラス」です:

ax²+bx+c > 0  →  すべての実数
ax²+bx+c < 0  →  解なし

a<0a < 0 の場合(下に開く放物線)

「山形の曲線」では上記の >><< の解が逆転します。

x2+4x3<0-x^2 + 4x - 3 < 0a=1a = -1)の場合:

まず 1-1 を掛けて a>0a > 0 に変換(不等号逆転)——「両辺にマイナスを掛けると不等号が逆」:

x24x+3>0x^2 - 4x + 3 > 0

(x1)(x3)>0(x-1)(x-3) > 0x<1x < 1 または x>3x > 3


解法フローチャート

ax² + bx + c > 0 を解く


  a > 0 か a < 0 か?
       ↓        ↓
  (上凸)      (下凸:両辺に-1を掛けて向き逆転)

  D を計算
  ↙    ↓    ↘
D>0   D=0   D<0
  ↓     ↓     ↓
根α,β  重解α  解なし
  ↓     ↓     ↓
x<α   全域   全域
x>β  (xはα除く)
DDa>0a>0>0>0の解a>0a>0<0<0の解
D>0D>0x<αx<\alpha or x>βx>\betaα<x<β\alpha < x < \beta
D=0D=0xαx \neq \alpha(全域)解なし
D<0D<0全実数解なし

インタラクティブ:放物線と2次不等式

マウスのX座標で係数 aa を変えながら、ax24x+3>0ax^2 - 4x + 3 > 0 の解がどう変わるか確認しましょう。緑に塗られた部分が「y>0y > 0、つまり xx 軸より上」の領域です。

ax²-4x+3>0 の解の変化:マウスで a を変えると放物線の形と解が変わる
function loop() {
ctx.clearRect(0, 0, W, H);

var a = -3 + (mx / W) * 6;
if (Math.abs(a) < 0.1) a = 0.1;
var b = -4, c = 3;
var D = b*b - 4*a*c;

var cx = W/2, cy = 200;
var scaleX = 55, scaleY = 14;

// 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); }

// Shade regions where ax²-4x+3 > 0
var shade = [];
if (D > 0.001) {
  var r1 = (-b - Math.sqrt(D))/(2*a);
  var r2 = (-b + Math.sqrt(D))/(2*a);
  var alpha = Math.min(r1,r2), beta = Math.max(r1,r2);
  if (a > 0) {
    shade.push({from: -10, to: alpha});
    shade.push({from: beta, to: 10});
  } else {
    shade.push({from: alpha, to: beta});
  }
} else if (D < -0.001) {
  if (a > 0) shade.push({from: -10, to: 10});
  // a<0: no solution
} else {
  // D=0
  if (a > 0) shade.push({from: -10, to: 10});
}

for (var si = 0; si < shade.length; si++) {
  var sx0 = Math.max(0, cx + shade[si].from * scaleX);
  var sx1 = Math.min(W, cx + shade[si].to * scaleX);
  ctx.fillStyle = '#22c55e';
  ctx.globalAlpha = 0.18;
  ctx.fillRect(sx0, 0, sx1-sx0, H);
  ctx.globalAlpha = 1;
}

// Parabola
var curveColor = a > 0 ? '#3b82f6' : '#ef4444';
ctx.strokeStyle = curveColor; ctx.lineWidth = 2.5;
ctx.beginPath();
var started = false;
for (var px = 0; px <= W; px += 2) {
  var xv = (px-cx)/scaleX;
  var yv = a*xv*xv + b*xv + c;
  var py = cy - yv * scaleY;
  if (py < -100 || py > H+100) { started=false; continue; }
  if (!started) { ctx.moveTo(px,py); started=true; } else ctx.lineTo(px,py);
}
ctx.stroke();

// Roots
if (D >= 0) {
  var sqD = Math.sqrt(Math.max(0,D));
  var roots = [(-b-sqD)/(2*a), (-b+sqD)/(2*a)];
  for (var ri=0; ri<roots.length; ri++) {
    ctx.fillStyle = '#fbbf24';
    ctx.beginPath();
    ctx.arc(cx+roots[ri]*scaleX, cy, 7, 0, Math.PI*2);
    ctx.fill();
  }
}

// Info
ctx.fillStyle = '#0f172a'; ctx.fillRect(8, 8, 280, 90);
ctx.strokeStyle = '#334155'; ctx.lineWidth=1; ctx.strokeRect(8,8,280,90);
ctx.font='12px monospace'; ctx.textAlign='left';
ctx.fillStyle = '#e2e8f0';
ctx.fillText('f(x) = ' + a.toFixed(2) + 'x² - 4x + 3', 18, 28);
ctx.fillStyle = D > 0 ? '#22c55e' : D < 0 ? '#ef4444' : '#fbbf24';
ctx.fillText('D = ' + D.toFixed(2) + (D>0?' (2解)':D<0?' (解なし)':' (重解)'), 18, 48);
ctx.fillStyle = '#94a3b8';
ctx.fillText('a = ' + a.toFixed(2) + (a>0?' (上向き)':' (下向き)'), 18, 68);
ctx.fillStyle = '#86efac';
ctx.fillText('緑網掛け = f(x) > 0 の領域', 18, 88);

requestAnimationFrame(loop);
}
loop();

具体的な計算例

例1:x25x+6>0x^2 - 5x + 6 > 0

(x2)(x3)>0(x-2)(x-3) > 0 → 解:x<2x < 2 または x>3x > 3——「山の外側」

例2:2x2+6x40-2x^2 + 6x - 4 \leq 0

両辺 2-2 で割る(不等号逆転):x23x+20x^2 - 3x + 2 \geq 0

(x1)(x2)0(x-1)(x-2) \geq 0 → 解:x1x \leq 1 または x2x \geq 2

例3:x2+2x+5>0x^2 + 2x + 5 > 0

D=420=16<0D = 4 - 20 = -16 < 0a=1>0a = 1 > 0すべての実数 が解——「放物線全体がx軸より上なので、どこでもプラス」

例4:x22x+10x^2 - 2x + 1 \geq 0

(x1)20(x-1)^2 \geq 0すべての実数=0= 0 のとき x=1x = 1)——「2乗は必ず0以上」


2次不等式を使う例:条件の範囲

ある数 xx について「x2<4x3x^2 < 4x - 3」が成り立つ xx の範囲を求めよ。

x² - 4x + 3 < 0
(x-1)(x-3) < 0
1 < x < 3
2次不等式の解の領域確認:数直線上にプロット。マウスで解の範囲を変化させる
function loop() {
ctx.clearRect(0, 0, W, H);

// x²+bx+c < 0 interactive
var b = -8 + (mx/W)*16;
var a = 1, c = 6;
var D = b*b - 4*a*c;

ctx.fillStyle='#94a3b8'; ctx.font='14px monospace'; ctx.textAlign='center';
ctx.fillText('x² + (' + b.toFixed(1) + ')x + 6 < 0 の解', W/2, 26);

var ny = 120, nx0=60, nx1=W-60, nrange=16, 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=-8; tick<=8; 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='10px monospace'; ctx.textAlign='center';
  ctx.fillText(tick, tx, ny+18);
}

if (D > 0) {
  var sqD = Math.sqrt(D);
  var alpha = (-b-sqD)/2, beta = (-b+sqD)/2;
  var ax = Math.max(nx0, ncx+alpha*nscale), bx2 = Math.min(nx1, ncx+beta*nscale);
  ctx.fillStyle='#3b82f6'; ctx.globalAlpha=0.45;
  ctx.fillRect(ax, ny-10, bx2-ax, 20);
  ctx.globalAlpha=1;
  ctx.fillStyle='#fbbf24';
  ctx.beginPath(); ctx.arc(ax, ny, 6,0,Math.PI*2); ctx.stroke();
  ctx.beginPath(); ctx.arc(bx2, ny, 6,0,Math.PI*2); ctx.stroke();
  ctx.fillStyle='#93c5fd'; ctx.font='13px monospace'; ctx.textAlign='center';
  ctx.fillText('解:' + alpha.toFixed(2) + ' < x < ' + beta.toFixed(2), W/2, 170);
  ctx.fillText('α = ' + alpha.toFixed(2) + '  β = ' + beta.toFixed(2), W/2, 190);
} else if (Math.abs(D) < 0.01) {
  ctx.fillStyle='#fbbf24'; ctx.font='13px monospace'; ctx.textAlign='center';
  ctx.fillText('D = 0 → 重解(解なし:x²+bx+c ≥ 0)', W/2, 170);
} else {
  ctx.fillStyle='#ef4444'; ctx.font='13px monospace'; ctx.textAlign='center';
  ctx.fillText('D < 0 → 解なし(放物線が x 軸と交わらない)', W/2, 170);
}

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

requestAnimationFrame(loop);
}
loop();

まとめ

  • 2次不等式の解法はグラフの形を把握することから始まる——「谷形か山形か」を先に確認
  • a>0a > 0(上向き放物線)と a<0a < 0(下向き放物線)で解の形が逆——「谷形と山形では上・下が逆」
  • 判別式 DD正・ゼロ・負で解の形が異なる
  • D<0,a>0D < 0, a > 0 のとき、ax2+bx+c>0ax^2+bx+c>0 の解は全実数——「放物線が全部x軸より上」
  • D<0,a>0D < 0, a > 0 のとき、ax2+bx+c<0ax^2+bx+c<0 の解はなし——「x軸より下の部分がない」

次回は絶対値を含む方程式と不等式を学びます。「距離」としての絶対値という解釈が問題を解くカギになります。