求函數(shù)y=x^x的極值,通過求解二階導(dǎo)數(shù)為
(1)求導(dǎo)數(shù)f'(x);
(2)求方程f'(x)=0的根;
(3)檢查f'(x)在方程的左右的值的符號(hào),如果左正右負(fù),那么f(x)在這個(gè)根處取得極大值;如果左負(fù)右正那么f(x)在這個(gè)根處取得極小值。
通過上述方法的到極值點(diǎn)是1/e。
import matplotlib.pyplot as plt
import numpy as np
ext_point = 1/np.exp(1)
x = np.linspace(0.367, 0.369, 101)
plt.plot(x, x**x,'b')
plt.plot(ext_point, ext_point**ext_point, 'ro')
plt.show()

Paste_Image.png