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

三角関数の合成

三角関数の合成とは

音楽のスピーカーから複数の楽器の音が同時に鳴るとき、空気の振動はすべての音が「足し合わさった」波になっています。「sin\sin の波」と「cos\cos の波」が混ざり合うとき、それは一つの「ずれたsin波」として表せます——これが三角関数の合成(または波の合成)です。

asinθ+bcosθa\sin\theta + b\cos\theta のような「sin\sincos\cos の和」は、1つの sin\sin 関数にまとめることができます。

asinθ+bcosθ=Rsin(θ+φ)\boxed{a\sin\theta + b\cos\theta = R\sin(\theta + \varphi)}

ここで

R=a2+b2,tanφ=baR = \sqrt{a^2 + b^2}, \qquad \tan\varphi = \frac{b}{a}

a>0a > 0 のとき φ(π2,π2)\varphi \in \left(-\dfrac{\pi}{2}, \dfrac{\pi}{2}\right)

「振幅 RR と位相ずれ φ\varphi の一つのsin波になる」——2つの違う波が、一つの「きれいな波」にまとまります。


合成の導出

「なぜこんな形になるの?」——加法定理を逆に使うだけです。

加法定理の展開:

Rsin(θ+φ)=Rcosφsinθ+RsinφcosθR\sin(\theta + \varphi) = R\cos\varphi\sin\theta + R\sin\varphi\cos\theta

これを asinθ+bcosθa\sin\theta + b\cos\theta と比較すると、sinθ\sin\theta の係数同士、cosθ\cos\theta の係数同士を対応させます:

Rcosφ=a,Rsinφ=bR\cos\varphi = a, \quad R\sin\varphi = b

両辺を2乗して加えると R2(cos2φ+sin2φ)=a2+b2R^2(\cos^2\varphi + \sin^2\varphi) = a^2 + b^2——sin2+cos2=1\sin^2 + \cos^2 = 1 を使うと:

R=a2+b2R = \sqrt{a^2 + b^2}

tanφ=RsinφRcosφ=ba\tan\varphi = \dfrac{R\sin\varphi}{R\cos\varphi} = \dfrac{b}{a}

「直角三角形の斜辺が RR、横が aa、縦が bb」——まるでピタゴラスの定理そのままです。


インタラクティブデモ:2つの波の合成

マウスを左右に動かすと a:ba : b の比率が変わります。 薄い青が asinθa\sin\theta、薄い緑が bcosθb\cos\theta、明るい黄色が合成波 Rsin(θ+φ)R\sin(\theta+\varphi) です。黄色の波の振幅(点線で表示)が R=a2+b2R = \sqrt{a^2 + b^2} に等しくなっていることを確認してください。

マウスを左右に動かすと a:b の比が変わります
function loop() {
ctx.clearRect(0, 0, W, H);

var ox = W / 2, oy = H / 2 + 10;
var scaleX = 50, scaleY = 65;
var ratio = mx / W;
var a = 2 * Math.cos(ratio * Math.PI);
var b = 2 * Math.sin(ratio * Math.PI);
var R = Math.sqrt(a * a + b * b);
var phi = Math.atan2(b, a);

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

// Grid
ctx.strokeStyle = 'rgba(255,255,255,0.06)';
ctx.lineWidth = 1;
for (var gi = -4; gi <= 4; gi++) {
  var gs = toScreen(gi * Math.PI, 0);
  ctx.beginPath(); ctx.moveTo(gs.sx, 0); ctx.lineTo(gs.sx, H); ctx.stroke();
}
for (var gy2 = -2; gy2 <= 2; gy2++) {
  var gs2 = toScreen(0, gy2);
  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();

// Pi labels
ctx.fillStyle = 'rgba(255,255,255,0.4)';
ctx.font = '12px sans-serif';
var plbls = [[-2,'-2π'],[-1,'-π'],[1,'π'],[2,'2π']];
for (var li = 0; li < plbls.length; li++) {
  var ls = toScreen(plbls[li][0] * Math.PI, 0);
  ctx.fillText(plbls[li][1], ls.sx - 8, oy + 16);
}

var range = W / (2 * scaleX);

// a*sin(x) - dim blue
ctx.strokeStyle = 'rgba(79,195,247,0.4)';
ctx.lineWidth = 1.5;
ctx.beginPath();
for (var xi = -range; xi <= range; xi += 0.03) {
  var s = toScreen(xi, a * Math.sin(xi));
  if (xi === -range) ctx.moveTo(s.sx, s.sy); else ctx.lineTo(s.sx, s.sy);
}
ctx.stroke();

// b*cos(x) - dim green
ctx.strokeStyle = 'rgba(102,187,106,0.4)';
ctx.lineWidth = 1.5;
ctx.beginPath();
for (var xi3 = -range; xi3 <= range; xi3 += 0.03) {
  var s3 = toScreen(xi3, b * Math.cos(xi3));
  if (xi3 === -range) ctx.moveTo(s3.sx, s3.sy); else ctx.lineTo(s3.sx, s3.sy);
}
ctx.stroke();

// Combined R*sin(x+phi) - bright yellow
ctx.strokeStyle = '#ffeb3b';
ctx.lineWidth = 3;
ctx.beginPath();
for (var xi4 = -range; xi4 <= range; xi4 += 0.03) {
  var s4 = toScreen(xi4, R * Math.sin(xi4 + phi));
  if (xi4 === -range) ctx.moveTo(s4.sx, s4.sy); else ctx.lineTo(s4.sx, s4.sy);
}
ctx.stroke();

// Amplitude R dotted lines
ctx.strokeStyle = 'rgba(255,235,59,0.25)';
ctx.lineWidth = 1;
ctx.setLineDash([4,4]);
ctx.beginPath(); ctx.moveTo(0, toScreen(0,R).sy); ctx.lineTo(W, toScreen(0,R).sy); ctx.stroke();
ctx.beginPath(); ctx.moveTo(0, toScreen(0,-R).sy); ctx.lineTo(W, toScreen(0,-R).sy); ctx.stroke();
ctx.setLineDash([]);
ctx.fillStyle = 'rgba(255,235,59,0.6)';
ctx.font = '12px sans-serif';
ctx.fillText('R=' + R.toFixed(2), ox + 4, toScreen(0,R).sy - 4);

// Info panel
ctx.fillStyle = 'rgba(0,0,0,0.65)';
ctx.beginPath(); ctx.roundRect(10, 10, 270, 95, 8); ctx.fill();
ctx.fillStyle = '#4fc3f7';
ctx.font = '12px monospace';
ctx.fillText('a·sinθ: a = ' + a.toFixed(2), 18, 32);
ctx.fillStyle = '#66bb6a';
ctx.fillText('b·cosθ: b = ' + b.toFixed(2), 18, 50);
ctx.fillStyle = '#ffeb3b';
ctx.font = 'bold 13px monospace';
ctx.fillText('R = √(a²+b²) = ' + R.toFixed(3), 18, 70);
var phiDeg = (phi * 180 / Math.PI).toFixed(1);
ctx.fillStyle = 'rgba(255,255,255,0.7)';
ctx.font = '12px monospace';
ctx.fillText('φ = ' + phiDeg + '°, R·sin(θ+φ)', 18, 90);

// Legend
ctx.fillStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath(); ctx.roundRect(W - 195, H - 60, 183, 48, 6); ctx.fill();
ctx.fillStyle = '#4fc3f7'; ctx.font = '12px sans-serif';
ctx.fillText('— a·sinθ', W - 185, H - 40);
ctx.fillStyle = '#66bb6a';
ctx.fillText('— b·cosθ', W - 185, H - 24);
ctx.fillStyle = '#ffeb3b';
ctx.fillText('— R·sin(θ+φ)  [合成波]', W - 185, H - 8);

requestAnimationFrame(loop);
}
loop();

手順のまとめ

3sinθ+4cosθ3\sin\theta + 4\cos\theta を合成する

「横3、縦4の直角三角形の斜辺を計算する」——ピタゴラスの定理で RR が出てきます。

手順① RR を計算:R=32+42=9+16=5R = \sqrt{3^2 + 4^2} = \sqrt{9 + 16} = 5

手順② φ\varphi を計算:tanφ=43\tan\varphi = \dfrac{4}{3}φ=arctan4353.1°\varphi = \arctan\dfrac{4}{3} \approx 53.1°

手順③ 合成:3sinθ+4cosθ=5sin(θ+φ)3\sin\theta + 4\cos\theta = 5\sin(\theta + \varphi)

「3と4から5が出てくる」——有名な「3-4-5の直角三角形」と同じです。


合成の応用:最大・最小

合成形 Rsin(θ+φ)R\sin(\theta + \varphi) の形にすると、最大値・最小値が一目でわかります。sinの値域は 1sin()1-1 \leq \sin(\cdot) \leq 1 なので:

RRsin(θ+φ)R-R \leq R\sin(\theta + \varphi) \leq R

なので asinθ+bcosθa\sin\theta + b\cos\theta の:

  • 最大値R=a2+b2R = \sqrt{a^2 + b^2}
  • 最小値R=a2+b2-R = -\sqrt{a^2 + b^2}

「どんなにsinとcosが混ざっていても、最大値はかならず a2+b2\sqrt{a^2+b^2}」——これが合成の最大の便利さです。

2sinθ3cosθ2\sin\theta - 3\cos\theta の最大値・最小値を求めよ。

R=4+9=13R = \sqrt{4 + 9} = \sqrt{13}

最大値 13\sqrt{13}、最小値 13-\sqrt{13}


練習問題

  1. sinθ+cosθ\sin\theta + \cos\thetaRsin(θ+φ)R\sin(\theta + \varphi) の形に合成せよ。
  2. 3sinθcosθ\sqrt{3}\sin\theta - \cos\theta の最大値と、そのときの θ\theta0θ<2π0 \leq \theta < 2\pi)を求めよ。
  3. sinθ+3cosθ=1\sin\theta + \sqrt{3}\cos\theta = 1 を解け(0θ<2π0 \leq \theta < 2\pi)。

解答

  1. R=2R = \sqrt{2}tanφ=1\tan\varphi = 1φ=π4\varphi = \dfrac{\pi}{4}。合成:2sin ⁣(θ+π4)\sqrt{2}\sin\!\left(\theta + \dfrac{\pi}{4}\right)
  2. R=2R = 2φ=π6\varphi = -\dfrac{\pi}{6}。最大値 22θ+φ=π2\theta + \varphi = \dfrac{\pi}{2}θ=2π3\theta = \dfrac{2\pi}{3}
  3. 2sin ⁣(θ+π3)=12\sin\!\left(\theta + \dfrac{\pi}{3}\right) = 1sin ⁣(θ+π3)=12\sin\!\left(\theta + \dfrac{\pi}{3}\right) = \dfrac{1}{2}θ=0,2π3\theta = 0, \dfrac{2\pi}{3}

まとめ

asinθ+bcosθ=a2+b2sin(θ+φ)wheretanφ=baa\sin\theta + b\cos\theta = \sqrt{a^2+b^2}\,\sin(\theta + \varphi) \quad \text{where} \quad \tan\varphi = \frac{b}{a}
  • R=a2+b2R = \sqrt{a^2 + b^2} は合成波の振幅——「ピタゴラスの定理で計算する」
  • 最大値 RR、最小値 R-R——「合成すれば一目でわかる」
  • 合成すると最大・最小や方程式の解が求めやすくなる

次回は指数関数を学びます。「2x2^x」という式が表す爆発的な増加と、自然界の成長・減衰を記述する不思議な数 ee の話です。