## 2019年7月24日水曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 対数関数・指数関数 - 指数関数、積、n階微分、帰納法

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

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

（証明終）

コード

Python 3

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

print('6.')

x = symbols('x')
n = symbols('n', nonnegative=True, integer=True)
f = x * exp(x)
g = (x + n) * exp(x)
d = Derivative(f, x)
for n0 in range(10):
print(f'n = {n0}')
fn = f.subs({n: n0})
d = Derivative(fn, x, n0)
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, exp(x), f,
ylim=(0, 20),
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('sample6.png')


C:\Users\...>py sample6.py
6.
n = 0
x
x⋅ℯ

x
x⋅ℯ

x
x⋅ℯ

x
x⋅ℯ

True

n = 1
x
x⋅ℯ

x
(x + 1)⋅ℯ

d ⎛   x⎞
──⎝x⋅ℯ ⎠
dx

x    x
x⋅ℯ  + ℯ

False

n = 2
x
x⋅ℯ

x
(x + 2)⋅ℯ

2
d ⎛   x⎞
───⎝x⋅ℯ ⎠
2
dx

x
(x + 2)⋅ℯ

True

n = 3
x
x⋅ℯ

x
(x + 3)⋅ℯ

3
d ⎛   x⎞
───⎝x⋅ℯ ⎠
3
dx

x
(x + 3)⋅ℯ

True

n = 4
x
x⋅ℯ

x
(x + 4)⋅ℯ

4
d ⎛   x⎞
───⎝x⋅ℯ ⎠
4
dx

x
(x + 4)⋅ℯ

True

n = 5
x
x⋅ℯ

x
(x + 5)⋅ℯ

5
d ⎛   x⎞
───⎝x⋅ℯ ⎠
5
dx

x
(x + 5)⋅ℯ

True

n = 6
x
x⋅ℯ

x
(x + 6)⋅ℯ

6
d ⎛   x⎞
───⎝x⋅ℯ ⎠
6
dx

x
(x + 6)⋅ℯ

True

n = 7
x
x⋅ℯ

x
(x + 7)⋅ℯ

7
d ⎛   x⎞
───⎝x⋅ℯ ⎠
7
dx

x
(x + 7)⋅ℯ

True

n = 8
x
x⋅ℯ

x
(x + 8)⋅ℯ

8
d ⎛   x⎞
───⎝x⋅ℯ ⎠
8
dx

x
(x + 8)⋅ℯ

True

n = 9
x
x⋅ℯ

x
(x + 9)⋅ℯ

9
d ⎛   x⎞
───⎝x⋅ℯ ⎠
9
dx

x
(x + 9)⋅ℯ

True

C:\Users\...>