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

方程式の基本

方程式とは何か

「ある数を2倍して3を足すと11になる。元の数は?」——こういう問いに答えるための道具が方程式です。

方程式とは「特定の値のときだけ成り立つ等式」です。

2x + 3 = 11   →   x = 4 のとき成立
x² = 9        →   x = 3 または x = -3 のとき成立

方程式を解くとは、等式を成り立たせる未知数の値(解)を求めることです。

方程式の「黄金ルール」は1つだけ:

両辺に同じ操作を施しても等式は保たれる

想像してみてください——天秤で左右の重さが釣り合っているとき(等式が成立しているとき)、両側に同じ重さを足しても、同じだけ引いても、同じ数で割っても、天秤は釣り合ったままです。この「天秤の原理」が方程式を解くすべての操作の根拠です。


1次方程式の解き方

基本手順

  1. 括弧を展開する
  2. 文字の項を一方に、数字の項を他方に移項する
  3. 係数で割る

例:3(x2)=2x+13(x - 2) = 2x + 1

3x - 6 = 2x + 1    ← 展開
3x - 2x = 1 + 6    ← 移項(符号が変わることに注意)
x = 7              ← 解

検算:3(72)=153(7-2) = 152(7)+1=152(7)+1 = 15 ✓——「答えを元の式に代入して確認する」習慣が大切です。

例:係数に分数がある場合

x12+x+33=2\dfrac{x-1}{2} + \dfrac{x+3}{3} = 2

「分数があって面倒」と感じたら、両辺に分母の最小公倍数を掛けると分数が消えます。

LCD = 6 を両辺に掛ける:

3(x-1) + 2(x+3) = 12
3x - 3 + 2x + 6 = 12
5x + 3 = 12
5x = 9
x = 9/5
天秤モデル:2x+3=11 を解くステップ。クリックで次のステップへ
var step = 0;
var maxStep = 3;

document.querySelector('canvas').addEventListener('click', function() {
step = (step + 1) % (maxStep + 1);
});

var steps = [
{ left: '2x + 3', right: '11', note: '元の方程式:2x + 3 = 11', op: '' },
{ left: '2x + 3 - 3', right: '11 - 3', note: '両辺から 3 を引く', op: '− 3' },
{ left: '2x', right: '8', note: '整理すると 2x = 8', op: '' },
{ left: 'x', right: '4', note: '両辺を 2 で割ると  x = 4  ✓', op: '÷ 2' }
];

function drawBalance(leftText, rightText, balanced) {
var cx = W / 2, base = 250;
var armLen = 160;
var tilt = balanced ? 0 : 0.08;

// Pole
ctx.strokeStyle = '#64748b';
ctx.lineWidth = 4;
ctx.beginPath();
ctx.moveTo(cx, base + 20);
ctx.lineTo(cx, base - 20);
ctx.stroke();

// Triangle support
ctx.fillStyle = '#475569';
ctx.beginPath();
ctx.moveTo(cx - 18, base + 22);
ctx.lineTo(cx + 18, base + 22);
ctx.lineTo(cx, base + 4);
ctx.closePath();
ctx.fill();

// Arm
ctx.strokeStyle = '#64748b';
ctx.lineWidth = 4;
ctx.beginPath();
ctx.moveTo(cx - armLen, base - tilt * armLen);
ctx.lineTo(cx + armLen, base + tilt * armLen);
ctx.stroke();

// Left pan
var lx = cx - armLen, ly = base - tilt * armLen + 35;
ctx.fillStyle = '#1e3a5f';
ctx.fillRect(lx - 60, ly, 120, 10);
ctx.strokeStyle = '#3b82f6';
ctx.lineWidth = 1;
ctx.strokeRect(lx - 60, ly, 120, 10);
ctx.strokeStyle = '#475569'; ctx.lineWidth = 1;
ctx.beginPath(); ctx.moveTo(lx, base - tilt * armLen); ctx.lineTo(lx, ly); ctx.stroke();

ctx.fillStyle = '#93c5fd';
ctx.font = 'bold 14px monospace';
ctx.textAlign = 'center';
ctx.fillText(leftText, lx, ly - 10);

// Right pan
var rx = cx + armLen, ry = base + tilt * armLen + 35;
ctx.fillStyle = '#1e3a5f';
ctx.fillRect(rx - 60, ry, 120, 10);
ctx.strokeStyle = '#22c55e';
ctx.lineWidth = 1;
ctx.strokeRect(rx - 60, ry, 120, 10);
ctx.strokeStyle = '#475569'; ctx.lineWidth = 1;
ctx.beginPath(); ctx.moveTo(rx, base + tilt * armLen); ctx.lineTo(rx, ry); ctx.stroke();

ctx.fillStyle = '#86efac';
ctx.font = 'bold 14px monospace';
ctx.textAlign = 'center';
ctx.fillText(rightText, rx, ry - 10);
}

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

var s = steps[step];
drawBalance(s.left, s.right, true);

ctx.fillStyle = '#fbbf24';
ctx.font = 'bold 15px monospace';
ctx.textAlign = 'center';
ctx.fillText(s.note, W/2, 42);

if (s.op) {
  ctx.fillStyle = '#f59e0b';
  ctx.font = '13px monospace';
  ctx.fillText('操作:' + s.op, W/2, 64);
}

ctx.fillStyle = '#64748b';
ctx.font = '12px monospace';
ctx.fillText('クリックで次のステップへ  (' + (step+1) + ' / ' + (maxStep+1) + ')', W/2, H - 14);

requestAnimationFrame(loop);
}
loop();

連立方程式

xxyy の2つの未知数がある」——1つの式だけでは解けませんが、2つの式があれば解けます。これが連立方程式です。

{2x+y=7xy=2\begin{cases} 2x + y = 7 \\ x - y = 2 \end{cases}

加減法

2つの式を足すか引くかで一方の文字を消します——「yy をどちらかの式で消す」という発想です。

2x + y = 7   ①
x  - y = 2   ②

① + ② :  3x = 9  →  x = 3
② に代入:3 - y = 2  →  y = 1

代入法

一方の式を「y=y = \ldots」の形に変形して他方に代入します——「yy の代わりに xx の式を入れる」発想です。

y = 7 - 2x   (① より)
x - (7 - 2x) = 2
3x - 7 = 2
x = 3,  y = 1

グラフの意味

連立方程式の解は、2直線の交点です——「2本の道がどこで交わるか」を求めているのです。

場合グラフ解の数
2直線が交わる1交点唯一解
2直線が平行交点なし解なし
2直線が一致全体重なり無限に多い

3変数の連立方程式

{x+y+z=6x+2y+3z=142x+yz=3\begin{cases} x + y + z = 6 \\ x + 2y + 3z = 14 \\ 2x + y - z = 3 \end{cases}

「変数が3つなら方程式も3つ必要」——1つずつ変数を消していくと解けます。

解法の流れ

① ② から y+2z=8y + 2z = 8

① ③ から y3z=9-y - 3z = -9y+3z=9y + 3z = 9

この2式から z=1z = 1、逆算で y=6y = 6x=1x = -1


連立方程式 2x+y=7, x-y=2 の解(交点):直線のグラフを可視化
function loop() {
ctx.clearRect(0, 0, W, H);

var cx = W/2, cy = H/2;
var scale = 40;

// Grid
ctx.strokeStyle = '#1e293b';
ctx.lineWidth = 1;
for (var gx = -7; gx <= 7; gx++) {
  ctx.beginPath(); ctx.moveTo(cx+gx*scale,0); ctx.lineTo(cx+gx*scale,H); ctx.stroke();
}
for (var gy = -4; gy <= 4; gy++) {
  ctx.beginPath(); ctx.moveTo(0,cy+gy*scale); ctx.lineTo(W,cy+gy*scale); 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 = -6; n <= 6; n++) {
  if (n === 0) continue;
  ctx.fillText(n, cx + n*scale, cy + 14);
  ctx.fillText(n, cx + 5, cy - n*scale + 4);
}

// Line 1: 2x + y = 7  →  y = 7 - 2x
ctx.strokeStyle = '#3b82f6';
ctx.lineWidth = 2.5;
ctx.beginPath();
ctx.moveTo(0, cy - (7 - 2*(0 - cx/scale)) * scale);
var x1s = (0 - cx) / scale, x1e = (W - cx) / scale;
ctx.moveTo(0, cy - (7 - 2*x1s)*scale);
ctx.lineTo(W, cy - (7 - 2*x1e)*scale);
ctx.stroke();

// Line 2: x - y = 2  →  y = x - 2
ctx.strokeStyle = '#22c55e';
ctx.lineWidth = 2.5;
ctx.beginPath();
ctx.moveTo(0, cy - (x1s - 2)*scale);
ctx.lineTo(W, cy - (x1e - 2)*scale);
ctx.stroke();

// Intersection at (3, 1)
var ix = cx + 3*scale, iy = cy - 1*scale;
ctx.fillStyle = '#fbbf24';
ctx.beginPath();
ctx.arc(ix, iy, 8, 0, Math.PI*2);
ctx.fill();
ctx.strokeStyle = '#fff'; ctx.lineWidth = 2; ctx.stroke();

ctx.fillStyle = '#fbbf24';
ctx.font = 'bold 14px monospace';
ctx.textAlign = 'left';
ctx.fillText('解 (3, 1)', ix + 12, iy - 8);

ctx.fillStyle = '#93c5fd'; ctx.font = '13px monospace';
ctx.textAlign = 'left';
ctx.fillText('2x + y = 7', 12, 22);
ctx.fillStyle = '#86efac';
ctx.fillText('x - y = 2', 12, 40);

requestAnimationFrame(loop);
}
loop();

比例式

ab=cd\dfrac{a}{b} = \dfrac{c}{d} の形の方程式は外項の積 = 内項の積で解けます——「斜め同士を掛けると等しくなる」と覚えると便利です:

ad=bca \cdot d = b \cdot c

(x+1)/3 = (2x-1)/4
4(x+1) = 3(2x-1)
4x + 4 = 6x - 3
7 = 2x
x = 7/2

まとめ

  • 方程式の本質は「両辺に同じ操作」→ 天秤モデルで理解——「左右に同じことをする限り天秤は傾かない」
  • 1次方程式:移項 → 係数で割る——「文字を左、数を右に集める」
  • 係数が分数のとき:LCD を両辺に掛けて整数化——「分数を消してから解く」
  • 連立方程式:加減法または代入法で文字を消去——「1つずつ未知数を減らす」
  • グラフでは連立方程式の解 = 直線の交点——「2本の道がどこで交わるか」

次回はいよいよ2次方程式。因数分解・平方完成・解の公式という3つのアプローチを比較します。