日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Python實(shí)現(xiàn)之一階二階導(dǎo)數(shù)

本文轉(zhuǎn)載自微信公眾號「python與大數(shù)據(jù)分析」,作者一只小小鳥鳥。轉(zhuǎn)載本文請聯(lián)系python與大數(shù)據(jù)分析公眾號。

成都網(wǎng)站建設(shè)公司更懂你!成都創(chuàng)新互聯(lián)只做搜索引擎喜歡的網(wǎng)站!成都網(wǎng)站制作前臺采用搜索引擎認(rèn)可的DIV+CSS架構(gòu),全站HTML靜態(tài),html5+CSS3網(wǎng)站,提供:網(wǎng)站建設(shè),微信開發(fā),小程序制作,商城網(wǎng)站制作,重慶APP軟件開發(fā),域名與空間,服務(wù)器租售,網(wǎng)站代托管運(yùn)營,微信公眾號代托管運(yùn)營。

函數(shù)的和、差、積、商的求導(dǎo)法則

u=u(x),v=v(x)

(u+v)'=u'+v'

(u-v)'=u'-v'

(Cu)'=Cu'

(uv)'=u'v+uv'

(u/v)'=(u'v-uv')/v^2

復(fù)合函數(shù)求導(dǎo)法則

y=f(u),u=φ(v)

復(fù)合函數(shù)y=f[φ(v)]的導(dǎo)數(shù)為

dy/dx=dy/du*du/dx=f'(u)*φ'(v)

(u-v+z)'=u'-v'+z',且(Cu)'=Cu'

exam1:

y =2*x*^3 -5*x^2+3*x-7

y'=6*x^2-10x+3+0

exam2:

f(x)=x^3+4cosx-sin(π/2)

f'(x)=(x^3)‘+(4cosx)‘-(sin(π/2))‘=3x^2-4sinx-0

f'(π/2)=f'(x)|x=(π/2)=3x^2-4sinx=3*(π/2)^2-4sin(π/2)=3/4π^2-4

exam3:

y=√x*lnx

y'=(√x)'*lnx+√x*(lnx)'=1/(2*√x)*lnx+√x*1/x=1/(√x)*(1/2*lnx+1)

exam4:

y=e^x(sinx+cosx)

y'=(e^x)'(sinx+cosx)+e^x(sinx+cosx)'=e^x(sinx+cosx)+e^x(cosx-sinx)=2e^xcosx

高階導(dǎo)數(shù)

y=f(x)

y'=f'(x)

y''=(y')'=d^2y/dx^2=d/dx(dy/dx)

導(dǎo)數(shù)的應(yīng)用:函數(shù)單調(diào)性

通過函數(shù)的導(dǎo)數(shù)的值,可以判斷出函數(shù)的單調(diào)性、駐點(diǎn)以及極值點(diǎn):

若導(dǎo)數(shù)大于0,則單調(diào)遞增;

若導(dǎo)數(shù)小于0,則單調(diào)遞減;

導(dǎo)數(shù)等于零d的點(diǎn)為函數(shù)駐點(diǎn)

曲線的凹凸性,設(shè)函數(shù)f(x) 在區(qū)間I 上有二階導(dǎo)數(shù)

(1) 在 I 內(nèi) f''(x)>0則 f(x)在 I 內(nèi)圖形是凹的 ;

(2) 在 I 內(nèi) f''(x)<0則 f(x)在 I 內(nèi)圖形是凸的 .

 
 
 
 
  1. #!/usr/bin/env python 
  2. # -*- coding: UTF-8 -*- 
  3. #                     _ooOoo_ 
  4. #                   o8888888o 
  5. #                    88" . "88 
  6. #                 ( | -  _  - | ) 
  7. #                     O\ = /O 
  8. #                 ____/`---'\____ 
  9. #                  .' \\| |// `. 
  10. #                 / \\|||:|||// \ 
  11. #               / _|||||-:- |||||- \ 
  12. #                | | \\\ - /// | | 
  13. #              | \_| ''\---/'' | _/ | 
  14. #               \ .-\__ `-` ___/-. / 
  15. #            ___`. .' /--.--\ `. . __ 
  16. #         ."" '< `.___\_<|>_/___.' >'"". 
  17. #       | | : `- \`.;`\  _ /`;.`/ - ` : | | 
  18. #          \ \ `-. \_ __\ /__ _/ .-` / / 
  19. #      ==`-.____`-.___\_____/___.-`____.-'== 
  20. #                     `=---=' 
  21. ''' 
  22. @Project :pythonalgorithms  
  23. @File :Nderivatives.py 
  24. @Author :不勝人生一場醉@Date :2021/8/3 1:17  
  25. ''' 
  26. import matplotlib.pyplot as plt 
  27. import numpy as np 
  28. import math 
  29. import sympy 
  30.  
  31. if __name__ == '__main__': 
  32.     nderivativeplot() 
 
 
 
 
  1. # f(x)=x^3+3x^2-24x-20 
  2. # f'(x)=3x^2+6x-24 
  3. # f''(x)=6x+6 
  4. def nderivativeplot(): 
  5.     plt.figure(figsize=(5, 8)) 
  6.     ax = plt.gca()  # 通過gca:get current axis得到當(dāng)前軸 
  7.     plt.rcParams['font.sans-serif'] = ['SimHei']  # 繪圖中文 
  8.     plt.rcParams['axes.unicode_minus'] = False  # 繪圖負(fù)號 
  9.     x = np.linspace(-10,10, 200) 
  10.     y = np.power(x,3)+3*np.power(x,2)-24*x-20 
  11.     yd = 3*np.power(x,2)+6*x-24 
  12.     ydd=6*x+6 
  13.     label = '函數(shù)f(x)=x^3+3x^2-24x-20的曲線' 
  14.     plt.plot(x, y, label=label) 
  15.     label = "導(dǎo)數(shù)f'(x)=3x^2+6x-24的曲線" 
  16.     plt.plot(x, yd, label=label) 
  17.     label = "導(dǎo)數(shù)f''(x)=6x+6的曲線" 
  18.     plt.plot(x, ydd, label=label) 
  19.  
  20.  
  21.     # 設(shè)置圖片的右邊框和上邊框?yàn)椴伙@示 
  22.     ax.spines['right'].set_color('none') 
  23.     ax.spines['top'].set_color('none') 
  24.  
  25.     # 挪動(dòng)x,y軸的位置,也就是圖片下邊框和左邊框的位置 
  26.     # data表示通過值來設(shè)置x軸的位置,將x軸綁定在y=0的位置 
  27.     ax.spines['bottom'].set_position(('data', 0)) 
  28.     # axes表示以百分比的形式設(shè)置軸的位置,即將y軸綁定在x軸50%的位置 
  29.     # ax.spines['left'].set_position(('axes', 0.5)) 
  30.     ax.spines['left'].set_position(('data', 0)) 
  31.     plt.title("函數(shù)、一階導(dǎo)數(shù)、二階導(dǎo)數(shù)") 
  32.     plt.legend(loc='upper right') 
  33.     plt.show() 


當(dāng)前標(biāo)題:Python實(shí)現(xiàn)之一階二階導(dǎo)數(shù)
網(wǎng)頁地址:http://www.5511xx.com/article/ccdcpgc.html