オイラーの公式は、指数関数と三角関数を結びつける数学史上最も美しい公式の一つです。物理学、電気工学、信号処理、量子力学など、理工学のあらゆる分野で不可欠な役割を果たしています。
本記事では、オイラーの公式の定義からテイラー展開による導出、幾何学的意味、そして応用までを丁寧に解説します。
本記事の内容
- オイラーの公式の定義
- テイラー展開による導出
- 複素平面上での幾何学的意味
- オイラーの等式
- フーリエ変換との関係
- Pythonでの可視化
オイラーの公式
オイラーの公式は、次の等式で表されます。
$$ e^{j\theta} = \cos\theta + j\sin\theta $$
ここで、$j$ は虚数単位($j^2 = -1$)です。工学分野では虚数単位を $j$ で表すことが多いですが、数学では $i$ を使うこともあります。
また、$e$ はネイピア数(自然対数の底)であり、次のように定義される定数です。
$$ e = \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n \approx 2.71828 $$
テイラー展開による導出
オイラーの公式は、$e^x$, $\cos x$, $\sin x$ のテイラー展開から導出できます。
各関数のテイラー展開
$x = 0$ まわりのテイラー展開を思い出しましょう。
$$ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} + \cdots $$
$$ \cos x = 1 – \frac{x^2}{2!} + \frac{x^4}{4!} – \frac{x^6}{6!} + \cdots $$
$$ \sin x = x – \frac{x^3}{3!} + \frac{x^5}{5!} – \frac{x^7}{7!} + \cdots $$
導出
$e^x$ に $x = j\theta$ を代入します。
$$ e^{j\theta} = 1 + j\theta + \frac{(j\theta)^2}{2!} + \frac{(j\theta)^3}{3!} + \frac{(j\theta)^4}{4!} + \frac{(j\theta)^5}{5!} + \cdots $$
$j$ の冪を整理します。$j^2 = -1$, $j^3 = -j$, $j^4 = 1$, $j^5 = j$, … なので、
$$ e^{j\theta} = 1 + j\theta – \frac{\theta^2}{2!} – j\frac{\theta^3}{3!} + \frac{\theta^4}{4!} + j\frac{\theta^5}{5!} – \cdots $$
実部と虚部に分けると、
$$ \begin{align} e^{j\theta} &= \left(1 – \frac{\theta^2}{2!} + \frac{\theta^4}{4!} – \cdots\right) + j\left(\theta – \frac{\theta^3}{3!} + \frac{\theta^5}{5!} – \cdots\right) \\ &= \cos\theta + j\sin\theta \end{align} $$
これがオイラーの公式です。
複素平面での幾何学的意味
$e^{j\theta}$ は、複素平面上で原点を中心とする単位円上の点を表します。
- 実部: $\cos\theta$($x$ 座標)
- 虚部: $\sin\theta$($y$ 座標)
- 絶対値: $|e^{j\theta}| = \sqrt{\cos^2\theta + \sin^2\theta} = 1$
- 偏角: $\theta$
つまり、$e^{j\theta}$ は実軸から角度 $\theta$ だけ回転した、単位円上の点です。
複素数の極形式
任意の複素数 $z$ は、絶対値 $r = |z|$ と偏角 $\theta = \arg(z)$ を用いて、
$$ z = r e^{j\theta} $$
と表せます。これが複素数の極形式であり、オイラーの公式に基づいています。
オイラーの等式
$\theta = \pi$ を代入すると、数学で最も美しいとされるオイラーの等式が得られます。
$$ e^{j\pi} + 1 = 0 $$
この等式には、数学の5つの重要な定数 $e$, $j$, $\pi$, $1$, $0$ が全て含まれています。
$e^{j\pi} = \cos\pi + j\sin\pi = -1$ なので、確かに $e^{j\pi} + 1 = 0$ が成り立ちます。
便利な公式
三角関数の指数関数表示
オイラーの公式と、$\theta$ を $-\theta$ に置き換えた $e^{-j\theta} = \cos\theta – j\sin\theta$ を連立すると、
$$ \cos\theta = \frac{e^{j\theta} + e^{-j\theta}}{2} $$
$$ \sin\theta = \frac{e^{j\theta} – e^{-j\theta}}{2j} $$
ド・モアブルの定理
$$ (\cos\theta + j\sin\theta)^n = \cos(n\theta) + j\sin(n\theta) $$
これはオイラーの公式を使えば $(e^{j\theta})^n = e^{jn\theta}$ として自明です。
三角関数の加法定理
$e^{j(\alpha+\beta)} = e^{j\alpha} \cdot e^{j\beta}$ を展開すると、
$$ \cos(\alpha+\beta) + j\sin(\alpha+\beta) = (\cos\alpha + j\sin\alpha)(\cos\beta + j\sin\beta) $$
右辺を展開して実部・虚部を比較すると、加法定理が得られます。
$$ \cos(\alpha + \beta) = \cos\alpha\cos\beta – \sin\alpha\sin\beta $$
$$ \sin(\alpha + \beta) = \sin\alpha\cos\beta + \cos\alpha\sin\beta $$
フーリエ変換との関係
フーリエ変換はオイラーの公式なしには成り立ちません。
$$ \hat{f}(\omega) = \int_{-\infty}^{\infty} f(t) \, e^{-j\omega t} \, dt $$
ここで $e^{-j\omega t} = \cos(\omega t) – j\sin(\omega t)$ であり、信号 $f(t)$ を各周波数 $\omega$ の正弦波・余弦波成分に分解する操作がフーリエ変換です。
Pythonでの可視化
オイラーの公式を複素平面上で可視化し、テイラー展開の収束も確認します。
import numpy as np
import matplotlib.pyplot as plt
fig, axes = plt.subplots(1, 3, figsize=(16, 5))
# 左: 複素平面上の e^(jθ)
theta = np.linspace(0, 2*np.pi, 100)
z = np.exp(1j * theta)
axes[0].plot(z.real, z.imag, 'b-', linewidth=2, label='$e^{j\\theta}$')
# 特定のθの値を強調
angles = [0, np.pi/6, np.pi/4, np.pi/3, np.pi/2, np.pi, 3*np.pi/2]
labels = ['0', '$\\pi/6$', '$\\pi/4$', '$\\pi/3$', '$\\pi/2$', '$\\pi$', '$3\\pi/2$']
for ang, lab in zip(angles, labels):
z_pt = np.exp(1j * ang)
axes[0].plot(z_pt.real, z_pt.imag, 'ro', markersize=8)
axes[0].annotate(lab, (z_pt.real, z_pt.imag), textcoords="offset points",
xytext=(10, 10), fontsize=9)
axes[0].plot([0, z_pt.real], [0, z_pt.imag], 'r--', alpha=0.3)
axes[0].axhline(y=0, color='k', linewidth=0.5)
axes[0].axvline(x=0, color='k', linewidth=0.5)
axes[0].set_xlabel('Real (cos $\\theta$)')
axes[0].set_ylabel('Imaginary (sin $\\theta$)')
axes[0].set_title("Euler's Formula: $e^{j\\theta} = \\cos\\theta + j\\sin\\theta$")
axes[0].set_aspect('equal')
axes[0].grid(True, alpha=0.3)
axes[0].legend()
# 中: テイラー展開の収束
theta_test = np.pi / 3 # 60度
terms_real = []
terms_imag = []
partial_real = 0
partial_imag = 0
for n in range(15):
term = (1j * theta_test)**n / np.math.factorial(n)
partial_real += term.real
partial_imag += term.imag
terms_real.append(partial_real)
terms_imag.append(partial_imag)
exact_real = np.cos(theta_test)
exact_imag = np.sin(theta_test)
axes[1].plot(range(15), terms_real, 'bo-', label=f'Real part (exact={exact_real:.4f})')
axes[1].plot(range(15), terms_imag, 'rs-', label=f'Imag part (exact={exact_imag:.4f})')
axes[1].axhline(exact_real, color='blue', linestyle='--', alpha=0.5)
axes[1].axhline(exact_imag, color='red', linestyle='--', alpha=0.5)
axes[1].set_xlabel('Number of terms')
axes[1].set_ylabel('Partial sum')
axes[1].set_title(f'Taylor Series Convergence ($\\theta = \\pi/3$)')
axes[1].legend(fontsize=9)
axes[1].grid(True, alpha=0.3)
# 右: 信号のフーリエ変換(オイラーの公式の応用)
t = np.linspace(0, 2, 1000)
# 2つの周波数を持つ信号
f1, f2 = 5, 12 # Hz
signal = np.sin(2*np.pi*f1*t) + 0.5*np.sin(2*np.pi*f2*t)
# FFT
N = len(t)
dt = t[1] - t[0]
freq = np.fft.fftfreq(N, d=dt)[:N//2]
spectrum = 2/N * np.abs(np.fft.fft(signal))[:N//2]
axes[2].plot(freq, spectrum, 'g-', linewidth=2)
axes[2].set_xlabel('Frequency [Hz]')
axes[2].set_ylabel('Amplitude')
axes[2].set_title('FFT using $e^{-j\\omega t}$ (Euler\'s Formula)')
axes[2].set_xlim(0, 30)
axes[2].grid(True, alpha=0.3)
plt.tight_layout()
plt.show()
# オイラーの等式の数値検証
z_euler = np.exp(1j * np.pi) + 1
print(f"e^(jπ) + 1 = {z_euler}")
print(f"|e^(jπ) + 1| = {abs(z_euler):.2e} (≈ 0)")
# ド・モアブルの定理の検証
theta_dm = np.pi / 4
n_dm = 5
lhs = (np.cos(theta_dm) + 1j*np.sin(theta_dm))**n_dm
rhs = np.cos(n_dm*theta_dm) + 1j*np.sin(n_dm*theta_dm)
print(f"\nド・モアブルの定理 (θ=π/4, n=5):")
print(f"左辺: {lhs:.6f}")
print(f"右辺: {rhs:.6f}")
print(f"差: {abs(lhs - rhs):.2e}")
左のグラフでは、$e^{j\theta}$ が複素平面上の単位円を描くことが確認できます。中央のグラフでは、テイラー展開の項数を増やすと $e^{j\theta}$ の実部と虚部に収束する様子が見えます。右のグラフでは、オイラーの公式に基づくFFTにより信号の周波数成分が抽出されています。
まとめ
本記事では、オイラーの公式について解説しました。
- オイラーの公式 $e^{j\theta} = \cos\theta + j\sin\theta$ は、指数関数と三角関数を結びつける
- テイラー展開を用いて $e^{j\theta}$ の実部が $\cos\theta$、虚部が $\sin\theta$ になることが導出できる
- 幾何学的には、$e^{j\theta}$ は複素平面上の単位円上の点であり、角度 $\theta$ の回転を表す
- 三角関数の加法定理、ド・モアブルの定理など、多くの公式がオイラーの公式から自然に導出される
- フーリエ変換の基盤として、信号処理や物理学に不可欠な公式である