## 2019年6月29日土曜日

### 数学 - Python - 解析学 - 級数 - テイラーの公式 - 累乗根(立方根)、直線、累乗(べき乗、平方)、和、差、商、極限

1. $\begin{array}{l}f\left(x\right)={\left(1-x\right)}^{\frac{1}{3}}-1+\frac{1}{3}x\\ \frac{d}{\mathrm{dx}}f\left(x\right)\\ =\frac{1}{3}{\left(1-x\right)}^{-\frac{2}{3}}\left(-1\right)+\frac{1}{3}\\ =-\frac{1}{3}{\left(1-x\right)}^{-\frac{2}{3}}+\frac{1}{3}\\ \frac{{d}^{2}}{d{x}^{2}}f\left(x\right)\\ =\frac{2}{{3}^{2}}{\left(1-x\right)}^{-\frac{5}{3}}\left(-1\right)\\ =-\frac{2}{{3}^{2}}{\left(1-x\right)}^{-\frac{5}{3}}\\ \frac{{d}^{3}}{d{x}^{3}}f\left(x\right)\\ =-\frac{2·5}{{3}^{3}}{\left(1-x\right)}^{-\frac{8}{3}}\\ f\left(x\right)\\ =-\frac{1}{2!}·\frac{2}{{3}^{2}}{x}^{2}-\frac{1}{3!}·\frac{2·5}{{3}^{3}}{x}^{3}-\dots \\ \underset{x\to 0}{\mathrm{lim}}\frac{{\left(1-x\right)}^{\frac{1}{3}}-1+\frac{1}{3}x}{{x}^{2}}\\ =-\frac{1}{2!}\frac{2}{{3}^{2}}\\ =-\frac{1}{9}\end{array}$

コード

Python 3

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

print('32.')

x = symbols('x')
f = ((1 - x) ** Rational(1, 3) - 1 + x / 3) / x ** 2

for d in ['+', '-']:
l = Limit(f, x, 0, dir=d)
for o in [l, l.doit()]:
pprint(o)
print()

p = plot((1 - x) ** Rational(1, 3), x / 3,
(1 - x) ** Rational(1, 3) - 1 + x / 3, x ** 2,
((1 - x) ** Rational(1, 3) - 1 + x / 3) / x ** 2,
(x, -1.5, 1.5),
ylim=(-2, 2),
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('sample32.png')


C:\Users\...>py sample32.py
32.
⎛x   3 _______    ⎞
⎜─ + ╲╱ 1 - x  - 1⎟
⎜3                ⎟
lim ⎜─────────────────⎟
x─→0⁺⎜         2       ⎟
⎝        x        ⎠

-1/9

⎛x   3 _______    ⎞
⎜─ + ╲╱ 1 - x  - 1⎟
⎜3                ⎟
lim ⎜─────────────────⎟
x─→0⁻⎜         2       ⎟
⎝        x        ⎠

-1/9

C:\Users\...>