## 2019年9月15日日曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 三角関数(続き)、逆三角関数 - 正弦と余弦、指数関数、微分、等式

1. $\begin{array}{l}\frac{d}{\mathrm{dx}}\left({e}^{x}\mathrm{sin}x\right)\\ ={e}^{x}\mathrm{sin}x+{e}^{x}\mathrm{cos}x\\ ={e}^{x}\left(\mathrm{sin}x+\mathrm{cos}x\right)\\ ={e}^{x}\sqrt{2}\left(\frac{1}{\sqrt{2}}\mathrm{sin}x+\frac{1}{\sqrt{2}}\mathrm{cos}x\right)\\ ={\left(\sqrt{2}\right)}^{1}{e}^{x}\left(\mathrm{sin}x\mathrm{cos}\frac{\pi }{4}+\mathrm{cos}x\mathrm{sin}\frac{\pi }{4}\right)\\ ={\left(\sqrt{2}\right)}^{1}{e}^{x}\mathrm{sin}\left(x+\frac{1·\pi }{4}\right)\end{array}$

また、

$\begin{array}{l}\frac{{d}^{n}}{{\mathrm{dx}}^{n}}\left({e}^{x}\mathrm{sin}x\right)\\ =\frac{d}{\mathrm{dx}}\left({\left(\sqrt{2}\right)}^{n-1}{e}^{x}\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\right)\\ ={\left(\sqrt{2}\right)}^{n-1}\left({e}^{x}\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}\right)+{e}^{x}\mathrm{cos}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\right)\\ ={\left(\sqrt{2}\right)}^{n-1}{e}^{x}\left(\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}\right)+\mathrm{cos}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\right)\\ ={\left(\sqrt{2}\right)}^{n}{e}^{x}\left(\frac{1}{\sqrt{2}}\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}\right)+\frac{1}{\sqrt{2}}\mathrm{cos}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\right)\\ ={\left(\sqrt{2}\right)}^{n}{e}^{x}\left(\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\mathrm{cos}\frac{\pi }{4}+\mathrm{sin}\frac{\pi }{4}\mathrm{cos}\left(x+\frac{\left(n-1\right)\pi }{4}\right)\right)\\ ={\left(\sqrt{2}\right)}^{n}{e}^{x}\mathrm{sin}\left(x+\frac{\left(n-1\right)\pi }{4}+\frac{\pi }{4}\right)\\ ={\left(\sqrt{2}\right)}^{n}{e}^{x}\mathrm{sin}\left(x+\frac{n\pi }{4}\right)\end{array}$

よって帰納法により 成り立つ。

（証明終）

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, sqrt, sin, exp, Derivative, pi, plot

print('4.')

x = symbols('x')
n = symbols('n', integer=True)
f = exp(x) * sin(x)
d = Derivative(f, x, 1)
d1 = d.doit()
g = sqrt(2) ** n * exp(x) * sin(x + n * pi / 4)

for o in [d, d1]:
pprint(o.factor())
print()

ns = range(1, 6)
p = plot(*[d1.subs({n: n0}) for n0 in ns],
*[g.subs({n: n0}) for n0 in ns],
(x, -5, 5),
ylim=(-5, 5),
show=False,
legend=False)

colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

for o, color in zip(p, colors):
o.line_color = color

for t in zip(p, colors):
pprint(t)
print()
p.show()
p.save('sample4.png')


C:\Users\...>py sample4.py
4.
d ⎛ x       ⎞
──⎝ℯ ⋅sin(x)⎠
dx

x
(sin(x) + cos(x))⋅ℯ

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), red)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), green)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), blue)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), brown)

(cartesian line: exp(x)*sin(x) + exp(x)*cos(x) for x over (-5.0, 5.0), orange)

(cartesian line: sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), purple)

(cartesian line: 2*exp(x)*cos(x) for x over (-5.0, 5.0), pink)

(cartesian line: 2*sqrt(2)*exp(x)*cos(x + pi/4) for x over (-5.0, 5.0), gray)

(cartesian line: -4*exp(x)*sin(x) for x over (-5.0, 5.0), skyblue)

(cartesian line: -4*sqrt(2)*exp(x)*sin(x + pi/4) for x over (-5.0, 5.0), yello
w)

C:\Users\...>