## 2018年1月26日金曜日

### 数学 - Python - 解析学 - 多変数の関数 - 高次偏導関数、テイラーの定理(偏微分、連続性、極限、相加平均、相乗平均)

1. $\begin{array}{}{D}_{1}f\left(x,y\right)\\ =\frac{\left(y\left({x}^{2}-{y}^{2}\right)+xy\left(2x\right)\right)\left({x}^{2}+{y}^{2}\right)-xy\left({x}^{2}-{y}^{2}\right)2x}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{y\left(3{x}^{2}-{y}^{2}\right)\left({x}^{2}+{y}^{2}\right)-2{x}^{2}y\left({x}^{2}-{y}^{2}\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{y\left(\left(3{x}^{2}-{y}^{2}\right)\left({x}^{2}+{y}^{2}\right)-2{x}^{2}\left({x}^{2}-{y}^{2}\right)\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{y\left({x}^{4}+4{x}^{2}{y}^{2}-{y}^{4}\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{{x}^{4}y+4{x}^{2}{y}^{3}-{y}^{5}}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\end{array}$
$\begin{array}{}\left|{D}_{1}f\left(x,y\right)\right|\\ \le \frac{6{\left({x}^{2}+{y}^{2}\right)}^{\frac{5}{2}}}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =6{\left({x}^{2}+{y}^{2}\right)}^{\frac{1}{2}}\\ \underset{\left(x,y\right)\to \left(0,0\right)}{\mathrm{lim}}{D}_{1}f\left(x,y\right)=0\end{array}$
$\begin{array}{}{D}_{2}f\left(x,y\right)\\ =\frac{\left(x\left({x}^{2}-{y}^{2}\right)+xy\left(-2y\right)\right)\left({x}^{2}+{y}^{2}\right)-xy\left({x}^{2}-{y}^{2}\right)·2y}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{x\left(\left({x}^{2}-{y}^{2}-2{y}^{2}\right)\left({x}^{2}+{y}^{2}\right)-2{x}^{2}{y}^{2}+2{y}^{4}\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{x\left(\left({x}^{2}-3{y}^{2}\right)\left({x}^{2}+{y}^{2}\right)-2{x}^{2}{y}^{2}+2{y}^{4}\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\\ =\frac{x\left({x}^{4}-4{x}^{2}{y}^{2}-{y}^{2}\right)}{{\left({x}^{2}+{y}^{2}\right)}^{2}}\end{array}$
$\begin{array}{}\left|{D}_{2}f\left(x,y\right)\right|\le \frac{6{\left({x}^{2}+{y}^{2}\right)}^{\frac{5}{2}}}{{\left({x}^{2}+{y}^{2}\right)}^{2}}=6{\left({x}^{2}+{y}^{2}\right)}^{\frac{1}{2}}\\ \underset{\left(x,y\right)\to \left(0,0\right)}{\mathrm{lim}}{D}_{2}f\left(x,y\right)=0\end{array}$

よって、 ともに連続である。

コード(Emacs)

Python 3

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

x, y = symbols('x, y')

f = x * y * (x ** 2 - y ** 2) / (x ** 2 + y ** 2)
Ds = [Derivative(f, t, 1) for t in [x, y]]
f1s = [D.doit() for D in Ds]

for t, s in zip(Ds, f1s):
for u in [t, s]:
pprint(u)
print()
print()

for f1 in f1s:
for dir in ['+', '-']:
lx = Limit(f1, x, 0, dir=dir)
lxy = Limit(lx, y, 0, dir=dir)
for t in [lxy, lxy.doit()]:
pprint(t)
print()
print()
print()


$./sample1.py ⎛ ⎛ 2 2⎞⎞ ∂ ⎜x⋅y⋅⎝x - y ⎠⎟ ──⎜─────────────⎟ ∂x⎜ 2 2 ⎟ ⎝ x + y ⎠ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞ 2⋅x ⋅y⋅⎝x - y ⎠ 2⋅x ⋅y y⋅⎝x - y ⎠ - ──────────────── + ─────── + ─────────── 2 2 2 2 2 ⎛ 2 2⎞ x + y x + y ⎝x + y ⎠ ⎛ ⎛ 2 2⎞⎞ ∂ ⎜x⋅y⋅⎝x - y ⎠⎟ ──⎜─────────────⎟ ∂y⎜ 2 2 ⎟ ⎝ x + y ⎠ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞ 2⋅x⋅y ⋅⎝x - y ⎠ 2⋅x⋅y x⋅⎝x - y ⎠ - ──────────────── - ─────── + ─────────── 2 2 2 2 2 ⎛ 2 2⎞ x + y x + y ⎝x + y ⎠ ⎛ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞⎞ ⎜ 2⋅x ⋅y⋅⎝x - y ⎠ 2⋅x ⋅y y⋅⎝x - y ⎠⎟ lim lim ⎜- ──────────────── + ─────── + ───────────⎟ y─→0⁺x─→0⁺⎜ 2 2 2 2 2 ⎟ ⎜ ⎛ 2 2⎞ x + y x + y ⎟ ⎝ ⎝x + y ⎠ ⎠ 0 ⎛ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞⎞ ⎜ 2⋅x ⋅y⋅⎝x - y ⎠ 2⋅x ⋅y y⋅⎝x - y ⎠⎟ lim lim ⎜- ──────────────── + ─────── + ───────────⎟ y─→0⁻x─→0⁻⎜ 2 2 2 2 2 ⎟ ⎜ ⎛ 2 2⎞ x + y x + y ⎟ ⎝ ⎝x + y ⎠ ⎠ 0 ⎛ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞⎞ ⎜ 2⋅x⋅y ⋅⎝x - y ⎠ 2⋅x⋅y x⋅⎝x - y ⎠⎟ lim lim ⎜- ──────────────── - ─────── + ───────────⎟ y─→0⁺x─→0⁺⎜ 2 2 2 2 2 ⎟ ⎜ ⎛ 2 2⎞ x + y x + y ⎟ ⎝ ⎝x + y ⎠ ⎠ 0 ⎛ 2 ⎛ 2 2⎞ 2 ⎛ 2 2⎞⎞ ⎜ 2⋅x⋅y ⋅⎝x - y ⎠ 2⋅x⋅y x⋅⎝x - y ⎠⎟ lim lim ⎜- ──────────────── - ─────── + ───────────⎟ y─→0⁻x─→0⁻⎜ 2 2 2 2 2 ⎟ ⎜ ⎛ 2 2⎞ x + y x + y ⎟ ⎝ ⎝x + y ⎠ ⎠ 0$


macOS High Sierraの標準搭載されているグラフ作成ソフト、Grapher で作成。