グリーンの定理は、2次元平面における線積分と面積分の関係を示す定理であり、ストークスの定理の2次元版です。曲線に囲まれた領域の面積計算や、複雑な線積分の計算を面積分に帰着させるなど、実用的にも重要です。
本記事の内容
- グリーンの定理の主張と導出
- ストークスの定理との関係
- 面積計算への応用
- 具体例とPythonでの数値検証
前提知識
グリーンの定理
$xy$ 平面上の単連結閉領域 $D$ とその正の向き(反時計回り)の境界曲線 $\partial D$ に対して、
$$ \boxed{\oint_{\partial D} (P \, dx + Q \, dy) = \iint_D \left(\frac{\partial Q}{\partial x} – \frac{\partial P}{\partial y}\right) dA} $$
ここで $P(x,y)$, $Q(x,y)$ は $D$ 上で連続な偏導関数を持つとします。
導出のアイデア
簡単な場合($D$ が $y$ 方向に単純な領域)で示します。
$D$: $a \leq x \leq b$, $g_1(x) \leq y \leq g_2(x)$ のとき、
$$ \begin{align} \iint_D \frac{\partial P}{\partial y} dA &= \int_a^b \int_{g_1(x)}^{g_2(x)} \frac{\partial P}{\partial y} dy \, dx \\ &= \int_a^b [P(x, g_2(x)) – P(x, g_1(x))] dx \\ &= -\oint_{\partial D} P \, dx \end{align} $$
最後の等号は、境界の向きを考慮した結果です。同様に $\iint_D \frac{\partial Q}{\partial x} dA = \oint_{\partial D} Q \, dy$ が示せます。
面積計算への応用
グリーンの定理で $P = -y/2$, $Q = x/2$ とすると、
$$ \frac{\partial Q}{\partial x} – \frac{\partial P}{\partial y} = \frac{1}{2} + \frac{1}{2} = 1 $$
よって、
$$ \boxed{\text{Area}(D) = \frac{1}{2}\oint_{\partial D} (x \, dy – y \, dx)} $$
これは閉曲線のパラメータ表示から面積を直接計算できる便利な公式です。
具体例
例1: $\bm{F} = (xy, x^2)$ の単位円に沿った線積分
直接計算は面倒ですが、グリーンの定理を使うと、
$$ \begin{align} \oint (xy \, dx + x^2 \, dy) &= \iint_D \left(\frac{\partial(x^2)}{\partial x} – \frac{\partial(xy)}{\partial y}\right) dA \\ &= \iint_D (2x – x) \, dA \\ &= \iint_D x \, dA = 0 \quad (\text{対称性より}) \end{align} $$
例2: 楕円の面積
楕円 $x = a\cos t, y = b\sin t$ ($0 \leq t \leq 2\pi$) の面積:
$$ \begin{align} A &= \frac{1}{2}\oint (x \, dy – y \, dx) \\ &= \frac{1}{2}\int_0^{2\pi} [a\cos t \cdot b\cos t – b\sin t \cdot (-a\sin t)] \, dt \\ &= \frac{ab}{2}\int_0^{2\pi} (\cos^2 t + \sin^2 t) \, dt \\ &= \pi ab \end{align} $$
Pythonでの実装
import numpy as np
import matplotlib.pyplot as plt
# グリーンの定理の検証: ∮(xy dx + x^2 dy) over unit circle
# 左辺: 線積分
N = 10000
t = np.linspace(0, 2*np.pi, N+1)
dt_val = t[1] - t[0]
x = np.cos(t)
y = np.sin(t)
dx = -np.sin(t) * dt_val
dy = np.cos(t) * dt_val
P = x * y # xy
Q = x**2 # x^2
line_int = np.sum(P[:-1]*dx[:-1] + Q[:-1]*dy[:-1])
# 右辺: 面積分 ∬(2x-x)dA = ∬x dA = 0 (対称性)
print(f"線積分: {line_int:.6f}")
print(f"面積分(解析解): 0")
# 面積計算の検証: 楕円
a, b = 3, 2
x_e = a * np.cos(t)
y_e = b * np.sin(t)
dx_e = -a * np.sin(t) * dt_val
dy_e = b * np.cos(t) * dt_val
area = 0.5 * np.sum(x_e[:-1]*dy_e[:-1] - y_e[:-1]*dx_e[:-1])
print(f"\n楕円面積(数値計算): {area:.6f}")
print(f"楕円面積(解析解 πab): {np.pi*a*b:.6f}")
# 可視化
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
# グリーンの定理の図解
theta = np.linspace(0, 2*np.pi, 100)
axes[0].fill(np.cos(theta), np.sin(theta), alpha=0.2, color='blue')
axes[0].plot(np.cos(theta), np.sin(theta), 'b-', linewidth=2)
axes[0].annotate('', xy=(0.7, 0.7), xytext=(0.0, 1.0),
arrowprops=dict(arrowstyle='->', color='red', lw=2))
xg = np.linspace(-1.2, 1.2, 8)
yg = np.linspace(-1.2, 1.2, 8)
Xg, Yg = np.meshgrid(xg, yg)
axes[0].quiver(Xg, Yg, Xg*Yg, Xg**2, alpha=0.4, color='green')
axes[0].set_title('$\\oint(xy\\,dx + x^2\\,dy) = \\iint(2x-x)\\,dA$')
axes[0].set_aspect('equal')
axes[0].grid(True, alpha=0.3)
axes[0].set_xlabel('x')
axes[0].set_ylabel('y')
# 楕円の面積
axes[1].fill(a*np.cos(theta), b*np.sin(theta), alpha=0.3, color='orange')
axes[1].plot(a*np.cos(theta), b*np.sin(theta), 'r-', linewidth=2)
axes[1].set_title(f'楕円の面積 $= \\pi ab = {np.pi*a*b:.2f}$')
axes[1].set_aspect('equal')
axes[1].grid(True, alpha=0.3)
axes[1].set_xlabel('x')
axes[1].set_ylabel('y')
plt.tight_layout()
plt.savefig('greens_theorem.png', dpi=150, bbox_inches='tight')
plt.show()
まとめ
- グリーンの定理: $\oint(P\,dx+Q\,dy)=\iint(\partial Q/\partial x – \partial P/\partial y)\,dA$
- ストークスの定理の2次元特殊ケース
- 面積公式: $A = \frac{1}{2}\oint(x\,dy – y\,dx)$
- 線積分→面積分(またはその逆)の変換に便利
次のステップとして、以下の記事も参考にしてください。