## 2019年7月30日火曜日

### 数学 - Python - 解析学 - 各種の初等関数 - 対数関数・指数関数 - 指数関数、対数関数、ニュートン商、極限、微分

1. $\begin{array}{l}\underset{h\to 0}{\mathrm{lim}}\frac{{\mathrm{log}}_{a}\left(1+h\right)}{h}\\ =\underset{h\to 0}{\mathrm{lim}}\frac{1}{\mathrm{log}a}\frac{\mathrm{log}\left(1+h\right)}{h}\\ =\frac{1}{\mathrm{log}a}\underset{h\to 0}{\mathrm{lim}}\frac{\mathrm{log}\left(1+h\right)-\mathrm{log}1}{h}\\ =\frac{1}{\mathrm{log}a}\frac{1}{1}\\ =\frac{1}{\mathrm{log}a}\end{array}$

2. $\begin{array}{l}\underset{h\to 0}{\mathrm{lim}}\frac{{a}^{h}-1}{h}\\ =\underset{h\to 0}{\mathrm{lim}}\frac{{a}^{0+h}-{a}^{0}}{h}\\ ={a}^{0}\mathrm{log}a\\ =\mathrm{log}a\end{array}$

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, plot, Limit, log, oo, exp

print('10.')

a, h = symbols('a, h')
fs = [log(1 + h, a) / h,
(exp(h * log(a)) - 1) / h]

for i, f in enumerate(fs, 1):
print(f'({i})')
for d in ['+', '-']:
l = Limit(f, h, 0, dir=d)
for o in [l, l.doit()]:
pprint(o)
print()

nums = [0.5, 1.5]
p = plot(*[f.subs({a: a0})
for f in fs + [1 / log(a), log(a)]
for a0 in nums],
(h, -0.5, 0.5),
legend=False,
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('sample10.png')


C:\Users\...>py sample10.py
10.
(1)
⎛log(h + 1)⎞
lim ⎜──────────⎟
h─→0⁺⎝ h⋅log(a) ⎠

1
──────
log(a)

⎛log(h + 1)⎞
lim ⎜──────────⎟
h─→0⁻⎝ h⋅log(a) ⎠

1
──────
log(a)

(2)
⎛ h⋅log(a)    ⎞
⎜ℯ         - 1⎟
lim ⎜─────────────⎟
h─→0⁺⎝      h      ⎠

log(a)

⎛ h⋅log(a)    ⎞
⎜ℯ         - 1⎟
lim ⎜─────────────⎟
h─→0⁻⎝      h      ⎠

log(a)

C:\Users\...>