#15 ふれてみよう高校数学 関数

関数と方程式・不等式

グラフと方程式の関係

x22=x+1x^2 - 2 = x + 1 を解け」——これを純粋に代数で解くこともできますが、「y=x22y = x^2 - 2 というグラフと y=x+1y = x + 1 という直線が交わる場所」と考えると、答えが視覚的に見えてきます。

方程式 f(x)=g(x)f(x) = g(x) の解は、y=f(x)y = f(x)y=g(x)y = g(x)交点の xx 座標です。

グラフを描くことで:

  • 解の個数が視覚的にわかる——「交点が2個なら解が2つ」
  • 解のおおよその値(概算)がわかる——「交点の xx 座標を読み取る」
  • 解が存在しない場合(交点なし)もすぐわかる——「グラフが重ならなければ解なし」

グラフと不等式の関係

「どちらのグラフが上にあるか?」——不等式の解はこれだけです。

不等式 f(x)>g(x)f(x) > g(x) の解は、y=f(x)y = f(x) のグラフが y=g(x)y = g(x) のグラフより上にある xx の範囲です。

f(x)>g(x)    y=f(x) が y=g(x) より上f(x) > g(x) \iff \text{$y = f(x)$ が $y = g(x)$ より上}

これを「h(x)=f(x)g(x)h(x) = f(x) - g(x) として h(x)>0h(x) > 0 を解く」と読み替えることもできます——「差が正になる区間」を探す、という見方です。


インタラクティブデモ:2曲線の交点と不等式領域

y=x22y = x^2 - 2(青の放物線)と y=x+1y = x + 1(オレンジの直線)を描画します。マウスを左右に動かすと、現在の xx 値での2つの関数値が比較され、f(x)>g(x)f(x) > g(x) の領域(緑)と f(x)<g(x)f(x) < g(x) の領域(赤)が色で表示されます。黄色の点(交点)を境に色が変わるのを確認してください。

交点が方程式の解。上下の色分けが不等式の解の範囲
function loop() {
ctx.clearRect(0, 0, W, H);

var ox = W / 2, oy = H / 2 + 40;
var scale = 55;
var xVal = (mx / W) * 8 - 4;

function toScreen(x, y) {
  return { sx: ox + x * scale, sy: oy - y * scale };
}
function f(x) { return x * x - 2; }   // parabola
function g(x) { return x + 1; }       // line
// Intersection: x^2 - 2 = x + 1 => x^2 - x - 3 = 0
// x = (1 ± sqrt(13)) / 2
var disc = 1 + 12;
var x1int = (1 - Math.sqrt(disc)) / 2;  // ≈ -1.303
var x2int = (1 + Math.sqrt(disc)) / 2;  // ≈ 2.303

// Grid
ctx.strokeStyle = 'rgba(255,255,255,0.06)';
ctx.lineWidth = 1;
for (var gx = -5; gx <= 5; gx++) {
  var gs = toScreen(gx, 0);
  ctx.beginPath(); ctx.moveTo(gs.sx, 0); ctx.lineTo(gs.sx, H); ctx.stroke();
}
for (var gy = -3; gy <= 5; gy++) {
  var gs2 = toScreen(0, gy);
  ctx.beginPath(); ctx.moveTo(0, gs2.sy); ctx.lineTo(W, gs2.sy); ctx.stroke();
}

// Shade region where f(x) < g(x) (between intersections) — green (parabola below line)
ctx.fillStyle = 'rgba(102,187,106,0.15)';
ctx.beginPath();
var s1s = toScreen(x1int, g(x1int));
ctx.moveTo(s1s.sx, s1s.sy);
for (var xi = x1int; xi <= x2int; xi += 0.03) {
  var sg = toScreen(xi, g(xi));
  ctx.lineTo(sg.sx, sg.sy);
}
var s2s = toScreen(x2int, f(x2int));
ctx.lineTo(s2s.sx, s2s.sy);
for (var xi2 = x2int; xi2 >= x1int; xi2 -= 0.03) {
  var sf = toScreen(xi2, f(xi2));
  ctx.lineTo(sf.sx, sf.sy);
}
ctx.closePath();
ctx.fill();
ctx.fillStyle = 'rgba(102,187,106,0.6)';
ctx.font = '12px sans-serif';
ctx.fillText('f < g の領域', toScreen(0.5, 0.5).sx, toScreen(0.5, 0.5).sy);

// Axes
ctx.strokeStyle = 'rgba(255,255,255,0.3)';
ctx.lineWidth = 1.5;
ctx.beginPath(); ctx.moveTo(0, oy); ctx.lineTo(W, oy); ctx.stroke();
ctx.beginPath(); ctx.moveTo(ox, 0); ctx.lineTo(ox, H); ctx.stroke();

// Axis labels
ctx.fillStyle = 'rgba(255,255,255,0.4)';
ctx.font = '12px sans-serif';
for (var lx = -4; lx <= 4; lx++) {
  if (lx === 0) continue;
  var ls = toScreen(lx, 0);
  ctx.fillText(lx, ls.sx - 4, oy + 16);
}
for (var ly = -2; ly <= 4; ly++) {
  if (ly === 0) continue;
  var ls2 = toScreen(0, ly);
  ctx.fillText(ly, ox + 5, ls2.sy + 4);
}

// g(x) = x+1 line (orange)
ctx.strokeStyle = '#ffb74d';
ctx.lineWidth = 2.5;
ctx.beginPath();
var sG1 = toScreen(-4, g(-4)), sG2 = toScreen(4, g(4));
ctx.moveTo(sG1.sx, sG1.sy); ctx.lineTo(sG2.sx, sG2.sy); ctx.stroke();
ctx.fillStyle = '#ffb74d';
ctx.font = 'bold 13px sans-serif';
ctx.fillText('y = x + 1', toScreen(2.5, 4.2).sx, toScreen(2.5, 4.2).sy);

// f(x) = x^2 - 2 parabola (blue)
ctx.strokeStyle = '#4fc3f7';
ctx.lineWidth = 2.5;
ctx.beginPath();
var stF = false;
for (var xi3 = -4; xi3 <= 4; xi3 += 0.03) {
  var yi3 = f(xi3);
  if (Math.abs(yi3) > 6) { stF = false; continue; }
  var sF = toScreen(xi3, yi3);
  if (!stF) { ctx.moveTo(sF.sx, sF.sy); stF = true; } else ctx.lineTo(sF.sx, sF.sy);
}
ctx.stroke();
ctx.fillStyle = '#4fc3f7';
ctx.font = 'bold 13px sans-serif';
ctx.fillText('y = x² - 2', toScreen(2.2, 5.5).sx, toScreen(2.2, 5.5).sy);

// Intersection points
var si1 = toScreen(x1int, g(x1int));
var si2 = toScreen(x2int, g(x2int));
ctx.fillStyle = '#ffeb3b';
ctx.beginPath(); ctx.arc(si1.sx, si1.sy, 7, 0, Math.PI*2); ctx.fill();
ctx.beginPath(); ctx.arc(si2.sx, si2.sy, 7, 0, Math.PI*2); ctx.fill();
ctx.fillStyle = '#ffeb3b';
ctx.font = '12px sans-serif';
ctx.fillText('(' + x1int.toFixed(2) + ', ' + g(x1int).toFixed(2) + ')', si1.sx - 60, si1.sy - 12);
ctx.fillText('(' + x2int.toFixed(2) + ', ' + g(x2int).toFixed(2) + ')', si2.sx + 8, si2.sy - 12);

// Vertical scan line
var xCl = Math.max(-3.5, Math.min(3.5, xVal));
var scanSx = toScreen(xCl, 0).sx;
ctx.strokeStyle = 'rgba(255,235,59,0.4)';
ctx.lineWidth = 1;
ctx.setLineDash([4,3]);
ctx.beginPath(); ctx.moveTo(scanSx, 0); ctx.lineTo(scanSx, H); ctx.stroke();
ctx.setLineDash([]);

// Points on curves at xCl
var fV = f(xCl), gV = g(xCl);
if (Math.abs(fV) <= 6) {
  var pF = toScreen(xCl, fV);
  ctx.fillStyle = '#4fc3f7';
  ctx.beginPath(); ctx.arc(pF.sx, pF.sy, 5, 0, Math.PI*2); ctx.fill();
}
var pG = toScreen(xCl, gV);
ctx.fillStyle = '#ffb74d';
ctx.beginPath(); ctx.arc(pG.sx, pG.sy, 5, 0, Math.PI*2); ctx.fill();

// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.7)';
ctx.beginPath(); ctx.roundRect(10, 10, 270, 110, 8); ctx.fill();
ctx.fillStyle = '#ffeb3b';
ctx.font = 'bold 13px monospace';
ctx.fillText('x = ' + xCl.toFixed(2), 18, 32);
ctx.fillStyle = '#4fc3f7';
ctx.font = '13px monospace';
ctx.fillText('f(x) = x²-2 = ' + fV.toFixed(2), 18, 52);
ctx.fillStyle = '#ffb74d';
ctx.fillText('g(x) = x+1 = ' + gV.toFixed(2), 18, 70);
var rel = fV > gV ? 'f(x) > g(x)' : fV < gV ? 'f(x) < g(x)' : 'f(x) = g(x)';
var relColor = fV > gV ? '#ef5350' : (fV < gV ? '#66bb6a' : '#ffeb3b');
ctx.fillStyle = relColor;
ctx.font = 'bold 14px sans-serif';
ctx.fillText(rel, 18, 90);
ctx.fillStyle = 'rgba(255,255,255,0.6)';
ctx.font = '11px sans-serif';
ctx.fillText('交点: x ≈ ' + x1int.toFixed(3) + ', ' + x2int.toFixed(3), 18, 108);

requestAnimationFrame(loop);
}
loop();

代数的な解法

f(x)=g(x)f(x) = g(x) を解く

「2つのグラフが交わる場所を代数で求める」——右辺を左辺に移項して0と比較します。

x22=x+1x^2 - 2 = x + 1

x2x3=0x^2 - x - 3 = 0 x=1±1+122=1±132x = \frac{1 \pm \sqrt{1 + 12}}{2} = \frac{1 \pm \sqrt{13}}{2}

交点:x=11321.30x = \dfrac{1-\sqrt{13}}{2} \approx -1.30 および x=1+1322.30x = \dfrac{1+\sqrt{13}}{2} \approx 2.30


不等式 f(x)<g(x)f(x) < g(x) を解く

「放物線が直線の下にある区間」——交点を求めてから、放物線の形を考えます。

x22<x+1x^2 - 2 < x + 1x2x3<0x^2 - x - 3 < 0

h(x)=x2x3<0h(x) = x^2 - x - 3 < 0 を解く。

h(x)h(x) の零点が 1±132\dfrac{1 \pm \sqrt{13}}{2} なので、放物線(下に凸)が 00 より小さいのは:

1132<x<1+132\frac{1 - \sqrt{13}}{2} < x < \frac{1 + \sqrt{13}}{2}

これはグラフで「直線が放物線より上にある区間」と一致します——「代数の答えがグラフの見た目と一致する」のを確認する習慣が大切です。


よく使う解法パターン

パターン①:2次不等式

ax2+bx+c>0ax^2 + bx + c > 0 の解——「放物線の形と判別式で場合分けする」:

  • D>0D > 0 の場合、2根 α<β\alpha < \beta として:
    • a>0a > 0x<αx < \alpha または x>βx > \beta(谷型の外側)
    • a<0a < 0α<x<β\alpha < x < \beta(山型の内側)
  • D=0D = 0 の場合、重根 α\alpha として:
    • a>0a > 0xαx \neq \alpha の全実数(xαx \leq \alpha のとき =0= 0
  • D<0D < 0 の場合:
    • a>0a > 0:全実数(放物線が全部 xx 軸より上)
    • a<0a < 0:解なし(放物線が全部 xx 軸より下)

パターン②:グラフで考える(不等式の解)

x2>4x^2 > 4y=x2y = x^2y=4y = 4 より上にある xx の範囲——「直線を引いて放物線のどちら側かを見る」

x<2x < -2 または x>2x > 2


練習問題

  1. x23x+2<0x^2 - 3x + 2 < 0 を解け。
  2. 2x2x102x^2 - x - 1 \geq 0 を解け。
  3. y=x2+1y = x^2 + 1y=x+3y = -x + 3 の交点を求め、x2+1<x+3x^2 + 1 < -x + 3 を解け。
  4. x2<3|x - 2| < 3 を解け。

解答

  1. (x1)(x2)<0(x-1)(x-2) < 01<x<21 < x < 2
  2. (2x+1)(x1)0(2x+1)(x-1) \geq 0x12x \leq -\dfrac{1}{2} または x1x \geq 1
  3. x2+x2=0x^2 + x - 2 = 0(x+2)(x1)=0(x+2)(x-1) = 0 → 交点 x=2,1x = -2, 1。不等式の解:2<x<1-2 < x < 1
  4. 3<x2<3-3 < x - 2 < 31<x<5-1 < x < 5

シリーズのまとめ

このシリーズ「関数」では、以下のトピックを学びました:

テーマ
1–3二次関数(グラフ、最大・最小、判別式)
4–8三角関数(定義、グラフ、加法・倍角・合成)
9–11指数・対数関数(定義、方程式・不等式)
12–14関数の理論(合成・逆関数、分数・無理関数、変換)
15関数とグラフ(方程式・不等式への応用)

グラフを描いて視覚的に考える習慣が、関数の理解を深める最大の近道です——「式を解くだけでなく、グラフで確認する」という二段構えの思考が数学的直感を育てます。


まとめ

f(x)=g(x) の解    グラフの交点の x 座標f(x) = g(x) \text{ の解} \iff \text{グラフの交点の } x \text{ 座標} f(x)>g(x) の解    y=f(x) が y=g(x) より上にある x の範囲f(x) > g(x) \text{ の解} \iff y = f(x) \text{ が } y = g(x) \text{ より上にある } x \text{ の範囲}
  • 交点の個数は判別式で事前チェック可能——「計算前にグラフの形を想像する」
  • グラフ上で不等式の解が「色で塗られた領域」として確認できる——「視覚で確かめてから代数で証明する」