## 2019年2月10日日曜日

### 数学 - Python - 解析学 - 積分 - 積分の応用 - 面積(三角関数(余弦)、3倍角、置換積分法、極座標表示)

1. $\begin{array}{}\theta =-\frac{\pi }{6},\frac{\pi }{6},\frac{3}{6}\pi ,\frac{5}{6}\pi \\ \int \frac{\pi {r}^{2}}{2\pi }d\theta \\ =\frac{1}{2}\int {\mathrm{cos}}^{2}\left(3\theta \right)d\theta \\ t=3\theta \\ \frac{\mathrm{dt}}{d\theta }=3\\ \pi =-\frac{\pi }{2},\frac{5}{2}\pi \\ \frac{1}{2}\int {\mathrm{cos}}^{2}t·\frac{1}{3}\mathrm{dt}\\ =\frac{1}{6}\left(\frac{1}{2}\mathrm{sin}t\mathrm{cos}t+\frac{1}{2}\int 1\mathrm{dt}\right)\\ =\frac{1}{12}\left(\mathrm{sin}t\mathrm{cos}t+t\right)\\ \frac{1}{12}{\left[\mathrm{sin}t\mathrm{cos}t+t\right]}_{\left(-\frac{\pi }{2}\right)}^{\left(\frac{5}{2}\pi \right)}\\ =\frac{1}{12}·3\pi \\ =\frac{\pi }{4}\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Integral, cos, sin, pi, exp, sqrt
from sympy.plotting import plot_parametric

theta = symbols('θ')
r = cos(3 * theta)
x = r * cos(theta)
y = r * sin(theta)

I = Integral(r ** 2 / 2, (theta, -pi / 6, 5 * pi / 6))
for o in [I, I.doit()]:
pprint(o.simplify())
print()

p = plot_parametric((x, y, (theta, -pi / 6, pi / 6)),
(x, y, (theta, pi / 6, 3 * pi / 6)),
(x, y, (theta, 3 * pi / 6, 5 * pi / 6)),
show=False)

colors = ['red', 'green', 'blue', 'brown', 'orange', 'pink']
for i, s in enumerate(p):
s.line_color = colors[i]
p.save('sample9.png')


C:\Users\...> py -3 sample9.py
5⋅π
───
6
⌠
⎮     2
⎮  cos (3⋅θ)
⎮  ───────── dθ
⎮      2
⌡
-π
───
6

π
─
4

C:\Users\...>