## 2019年12月3日火曜日

### 数学 - Python - 解析学 - 積分法 - 不定積分、広義積分 - 無限級数、累乗、リーマン和の極限としての積分

1. $\begin{array}{l}\underset{n\to \infty }{\mathrm{lim}}\frac{{\left(\sum _{k=1}^{n}{k}^{\alpha }\right)}^{\beta +1}}{{\left(\sum _{k=1}^{n}{k}^{\beta }\right)}^{\alpha +1}}\\ =\underset{n\to \infty }{\mathrm{lim}}\frac{{\left(\frac{1}{n}\sum _{k=1}^{n}n{k}^{\alpha }\right)}^{\beta +1}}{{\left(\frac{1}{n}\sum _{k=1}^{n}n{k}^{\beta }\right)}^{\alpha +1}}\\ =\underset{n\to \infty }{\mathrm{lim}}\frac{{\left(\frac{1}{n}·{n}^{\alpha +1}\sum _{k=1}^{n}{\left(\frac{k}{n}\right)}^{\alpha }\right)}^{\beta +1}}{{\left(\frac{1}{n}·{n}^{\beta +1}\sum _{k=1}^{n}{\left(\frac{k}{n}\right)}^{\beta }\right)}^{\alpha +1}}\\ =\underset{n\to \infty }{\mathrm{lim}}\frac{{\left(\frac{1}{n}\sum _{k=1}^{n}{\left(\frac{k}{n}\right)}^{\alpha }\right)}^{\beta +1}}{{\left(\frac{1}{n}\sum _{k=1}^{n}{\left(\frac{k}{n}\right)}^{\beta }\right)}^{\alpha +1}}\\ =\frac{{\left({\int }_{0}^{1}{x}^{\alpha }\mathrm{dy}\right)}^{\beta +1}}{{\left({\int }_{0}^{1}{x}^{\beta }\mathrm{dx}\right)}^{\alpha +1}}\\ =\frac{{\left(\frac{1}{\alpha +1}\right)}^{\beta +1}}{{\left(\frac{1}{\beta +1}\right)}^{\alpha +1}}\\ =\frac{{\left(\beta +1\right)}^{\alpha +1}}{{\left(\alpha +1\right)}^{\beta +1}}\end{array}$

コード

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

print('3.')

alpha = Rational(1, 2)
beta = Rational(1, 3)

def f(n):
return sum([k ** alpha for k in range(1, n + 1)]) ** (beta + 1) / sum([k ** beta for k in range(1, n + 1)]) ** (alpha + 1)

ys = [f(n) for n in range(1, 10)]
p = plot((beta + 1) ** (alpha + 1) / (alpha + 1) ** (beta + 1),
*ys,
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 y, color in zip(ys, colors[1:]):
print(float(y), color)
p.show()
p.save('sample3.png')


% ./sample3.py
3.
1.0 green
0.9532957994611398 blue
0.9350998943140988 brown
0.9254455890669422 orange
0.9194925383887663 purple
0.9154724465993183 pink
0.912585744016701 gray
0.9104186897421439 skyblue
0.9087360661929579 yellow
%