## 2019年7月23日火曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 対数関数・指数関数 - 累乗(べき乗)、対数関数、積、n階微分、帰納法、階乗、逆数

1. $\begin{array}{l}\frac{{d}^{n+1}}{{\mathrm{dx}}^{n+1}}\left({x}^{n}\mathrm{log}x\right)\\ =\frac{{d}^{n}}{d{x}^{n}}\left(\frac{d}{\mathrm{dx}}{x}^{n}\mathrm{log}x\right)\\ =\frac{{d}^{n}}{d{x}^{n}}\left(n{x}^{n-1}\mathrm{log}x+{x}^{n}·\frac{1}{x}\right)\\ =n\frac{{d}^{n}}{d{x}^{n}}\left({x}^{n-1}\mathrm{log}x\right)+\frac{{d}^{n}}{d{x}^{n}}{x}^{n-1}\\ =n·\frac{\left(n-1\right)!}{x}\\ =\frac{n!}{x}\end{array}$

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

（証明終）

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, log, Derivative, factorial

print('5.')

x = symbols('x')
n = symbols('n', nonnegative=True, integer=True)
f = x ** n * log(x)
g = factorial(n) / x
d = Derivative(f, x)
for n0 in range(10):
print(f'n = {n0}')
fn = f.subs({n: n0})
d = Derivative(fn, x, n0 + 1)
gn = g.subs({n: n0})
for o in [fn, gn, d, d.doit(), d.doit() == gn]:
pprint(o)
print()

ns = range(5)
p = plot(*[x ** n0 for n0 in ns],
log(x),
*[x ** n0 * log(x) for n0 in ns],
(x, 0.1, 5.1),
ylim=(0, 5),
legend=True,
show=False)
colors = ['red', 'green', 'blue', 'brown', 'orange',
'purple', 'pink', 'gray', 'skyblue', 'yellow']

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

p.show()
p.save('sample5.png')


C:\Users\...>py sample5.py
5.
n = 0
log(x)

1
─
x

d
──(log(x))
dx

1
─
x

True

n = 1
x⋅log(x)

1
─
x

2
d
───(x⋅log(x))
2
dx

1
─
x

True

n = 2
2
x ⋅log(x)

2
─
x

3
d ⎛ 2       ⎞
───⎝x ⋅log(x)⎠
3
dx

2
─
x

True

n = 3
3
x ⋅log(x)

6
─
x

4
d ⎛ 3       ⎞
───⎝x ⋅log(x)⎠
4
dx

6
─
x

True

n = 4
4
x ⋅log(x)

24
──
x

5
d ⎛ 4       ⎞
───⎝x ⋅log(x)⎠
5
dx

24
──
x

True

n = 5
5
x ⋅log(x)

120
───
x

6
d ⎛ 5       ⎞
───⎝x ⋅log(x)⎠
6
dx

120
───
x

True

n = 6
6
x ⋅log(x)

720
───
x

7
d ⎛ 6       ⎞
───⎝x ⋅log(x)⎠
7
dx

720
───
x

True

n = 7
7
x ⋅log(x)

5040
────
x

8
d ⎛ 7       ⎞
───⎝x ⋅log(x)⎠
8
dx

5040
────
x

True

n = 8
8
x ⋅log(x)

40320
─────
x

9
d ⎛ 8       ⎞
───⎝x ⋅log(x)⎠
9
dx

40320
─────
x

True

n = 9
9
x ⋅log(x)

362880
──────
x

10
d   ⎛ 9       ⎞
────⎝x ⋅log(x)⎠
10
dx

362880
──────
x

True

C:\Users\...>