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

対数関数

対数関数の定義

23=82^3 = 8 だから 3=log283 = \log_2 8」——対数とは「何乗すればその数になるか」を表す記号です。

「何乗すれば?」という問いは日常でも出てきます。「銀行の金利が年率10%で、預金が2倍になるのは何年後?」——これは 1.1x=21.1^x = 2 を解く問題で、答えは x=log1.127.3x = \log_{1.1} 2 \approx 7.3 年です。

指数関数 y=axy = a^x逆関数が対数関数です。「aaを何乗すれば yy になるか」がわかれば、逆向きに「yy から指数を求める」ことができます。

y=ax    x=logayy = a^x \iff x = \log_a y

つまり、「aa の何乗が yy か」を表す関数です:

y=logax(a>0,  a1,  x>0)\boxed{y = \log_a x \quad (a > 0,\; a \neq 1,\; x > 0)}

「定義域が x>0x > 0 だけ」という点に注意——マイナスの数や0の対数は定義されません(「aa の何乗が0以下になるか?」というのは答えがない問いだからです)。


対数の基本性質

「掛け算は対数にすると足し算になる」——これが対数の最大の便利さです。昔の天文学者たちは巨大な数の掛け算を対数を使って足し算に変換して計算していました。

loga1=0,logaa=1\log_a 1 = 0, \quad \log_a a = 1 logaxy=logax+logay\log_a xy = \log_a x + \log_a y logaxy=logaxlogay\log_a \frac{x}{y} = \log_a x - \log_a y logaxr=rlogax\log_a x^r = r\log_a x logab=logcblogca(底の変換公式)\log_a b = \frac{\log_c b}{\log_c a} \quad \text{(底の変換公式)}

インタラクティブデモ:指数関数と対数関数の対称性

y=2xy = 2^x(青)と y=log2xy = \log_2 x(オレンジ)は直線 y=xy = x について対称です(逆関数の関係)——「一方のグラフを y=xy = x に対して折り返すともう一方になる」という鏡のような関係です。マウスを左右に動かすと、xx 座標が変わり、対称点が強調表示されます。

青: y=2ˣ オレンジ: y=log₂x 緑点線: y=x(対称軸)
function loop() {
ctx.clearRect(0, 0, W, H);

var ox = W / 2 - 60, oy = H / 2 + 60;
var scale = 45;
var xVal = (mx / W) * 5 - 0.5;

function toScreen(x, y) {
  return { sx: ox + x * scale, sy: oy - y * scale };
}

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

// 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 = -1; lx <= 6; lx++) {
  if (lx === 0) continue;
  var ls = toScreen(lx, 0);
  ctx.fillText(lx, ls.sx - 4, oy + 16);
}
for (var ly = -1; ly <= 6; ly++) {
  if (ly === 0) continue;
  var ls2 = toScreen(0, ly);
  ctx.fillText(ly, ox + 6, ls2.sy + 4);
}

// y=x line (green dashed)
ctx.strokeStyle = 'rgba(102,187,106,0.5)';
ctx.lineWidth = 1.5;
ctx.setLineDash([6,4]);
ctx.beginPath();
var s1 = toScreen(-1, -1), s2 = toScreen(7, 7);
ctx.moveTo(s1.sx, s1.sy); ctx.lineTo(s2.sx, s2.sy);
ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = 'rgba(102,187,106,0.7)';
ctx.font = '13px sans-serif';
ctx.fillText('y = x', toScreen(5.5, 5.8).sx, toScreen(5.5, 5.8).sy);

// y=2^x - blue
ctx.strokeStyle = '#4fc3f7';
ctx.lineWidth = 2.5;
ctx.beginPath();
var st1 = false;
for (var xi = -2; xi <= 7; xi += 0.03) {
  var yi = Math.pow(2, xi);
  if (yi > 8 || yi < -2) { st1 = false; continue; }
  var s = toScreen(xi, yi);
  if (!st1) { ctx.moveTo(s.sx, s.sy); st1 = true; } else ctx.lineTo(s.sx, s.sy);
}
ctx.stroke();
ctx.fillStyle = '#4fc3f7';
ctx.font = 'bold 13px sans-serif';
ctx.fillText('y = 2ˣ', toScreen(2.6, 7.5).sx, toScreen(2.6, 7.5).sy);

// y=log2(x) - orange
ctx.strokeStyle = '#ffb74d';
ctx.lineWidth = 2.5;
ctx.beginPath();
var st2 = false;
for (var xi2 = 0.05; xi2 <= 7; xi2 += 0.03) {
  var yi2 = Math.log2(xi2);
  if (yi2 < -2 || yi2 > 8) { st2 = false; continue; }
  var s2b = toScreen(xi2, yi2);
  if (!st2) { ctx.moveTo(s2b.sx, s2b.sy); st2 = true; } else ctx.lineTo(s2b.sx, s2b.sy);
}
ctx.stroke();
ctx.fillStyle = '#ffb74d';
ctx.fillText('y = log₂x', toScreen(6.5, 2.7).sx, toScreen(6.5, 2.7).sy);

// Symmetric pair highlight
var xCl = Math.max(0.1, Math.min(4.5, xVal));
var yExp = Math.pow(2, xCl);
var yLog = Math.log2(Math.max(0.1, xCl));

// Mirror point: (xCl, yExp) and (yExp, xCl)
var pExp = toScreen(xCl, yExp);
var pMirror = toScreen(yExp, xCl);
var pLog = toScreen(xCl, yLog);
var pLogMirror = toScreen(yLog, xCl);

// Arrow connecting mirror pair
if (yExp < 8) {
  ctx.strokeStyle = 'rgba(255,235,59,0.5)';
  ctx.lineWidth = 1.5;
  ctx.setLineDash([3,3]);
  ctx.beginPath(); ctx.moveTo(pExp.sx, pExp.sy); ctx.lineTo(pMirror.sx, pMirror.sy); ctx.stroke();
  ctx.setLineDash([]);
  ctx.fillStyle = '#4fc3f7';
  ctx.beginPath(); ctx.arc(pExp.sx, pExp.sy, 6, 0, Math.PI*2); ctx.fill();
  ctx.fillStyle = '#ffb74d';
  ctx.beginPath(); ctx.arc(pMirror.sx, pMirror.sy, 6, 0, Math.PI*2); ctx.fill();
}

// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.65)';
ctx.beginPath(); ctx.roundRect(10, 10, 220, 90, 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('2ˣ = ' + (yExp <= 9 ? yExp.toFixed(3) : '>8'), 18, 52);
ctx.fillStyle = '#ffb74d';
ctx.fillText('log₂(x) = ' + yLog.toFixed(3), 18, 72);
ctx.fillStyle = 'rgba(102,187,106,0.8)';
ctx.font = '11px sans-serif';
ctx.fillText('↔ 対称(y=x に関して)', 18, 90);

requestAnimationFrame(loop);
}
loop();

底の変換公式

log210\log_2 10 を電卓で計算したい」——でも電卓のボタンは log10\log_{10}ln\ln しかない。そこで使うのが底の変換公式:

logab=log10blog10a=lnblna\log_a b = \frac{\log_{10} b}{\log_{10} a} = \frac{\ln b}{\ln a}

「どんな底の対数も、常用対数か自然対数に変換できる」——これで電卓でどんな対数も計算できます。

log210=log1010log102=1log10210.30103.32\log_2 10 = \frac{\log_{10} 10}{\log_{10} 2} = \frac{1}{\log_{10} 2} \approx \frac{1}{0.3010} \approx 3.32

対数の計算例

例① log232\log_2 32 を計算する

2?=322^{?} = 32」を考えます——25=322^5 = 32 なので log232=5\log_2 32 = 5

例② log48\log_4 8 を計算する

「4を何乗すると8になるか」——底の変換で解決します:

log48=log28log24=32\log_4 8 = \frac{\log_2 8}{\log_2 4} = \frac{3}{2}

例③ log36+log332\log_3 6 + \log_3 \dfrac{3}{2} を計算する

「対数の足し算は中身の掛け算」——この性質を使います:

=log3 ⁣(632)=log39=2= \log_3\!\left(6 \cdot \frac{3}{2}\right) = \log_3 9 = 2

常用対数の応用:桁数の計算

2102^{10} は何桁か?」——実際に計算しなくても対数で桁数がわかります:

log10210=10log10210×0.3010=3.010\log_{10} 2^{10} = 10\log_{10} 2 \approx 10 \times 0.3010 = 3.010

3<3.010<43 < 3.010 < 4 なので 103<210<10410^3 < 2^{10} < 10^4、つまり4桁(実際 210=10242^{10} = 1024)。

一般に、正の整数 nn の桁数は log10n+1\lfloor \log_{10} n \rfloor + 1 です——「桁数を知りたいときは log10\log_{10} を取って切り捨てに1を足す」という便利な公式です。


練習問題

  1. log3127\log_3 \dfrac{1}{27} を求めよ。
  2. log23+log243\log_2 3 + \log_2 \dfrac{4}{3} を計算せよ。
  3. 3x=103^x = 10 のとき xx を常用対数で表せ(log103=0.4771\log_{10} 3 = 0.4771)。

解答

  1. 33=1273^{-3} = \dfrac{1}{27} なので log3127=3\log_3 \dfrac{1}{27} = -3
  2. log2 ⁣(343)=log24=2\log_2\!\left(3 \cdot \dfrac{4}{3}\right) = \log_2 4 = 2
  3. x=log310=log1010log103=10.47712.096x = \log_3 10 = \dfrac{\log_{10} 10}{\log_{10} 3} = \dfrac{1}{0.4771} \approx 2.096

まとめ

  • y=logaxy = \log_a xy=axy = a^x の逆関数(y=xy = x に関して対称)——「鏡像の関係」
  • 定義域:x>0x > 0、値域:すべての実数
  • a>1a > 1 で単調増加、0<a<10 < a < 1 で単調減少
  • loga1=0\log_a 1 = 0logaa=1\log_a a = 1(1,0)(1,0)(a,1)(a,1) を必ず通る)
  • 底の変換:logab=lnblna\log_a b = \dfrac{\ln b}{\ln a}——「常用対数か自然対数に変換して計算」

次回は指数・対数を使った方程式と不等式を解きます。「底をそろえて比較する」という考え方が基本です。