第一单元 用python学习微积分(三) 求导四则运算及三角函数(上)- 三角函数

本文内容来自学习麻省理工学院公开课:单变量微积分-求导四则运算及三角函数导数-网易公开课

开发环境准备:CSDN

目录

一、需要用到的公式:

二、求导特殊三角函数

1、​

2、 ​

三、三角函数基础公式的几何意义


一、需要用到的公式:

f(x) = \frac{1}{x}, f'(x) = \frac{-1}{x^2}

f(x) = x^n, f'(x) = n\times x^{n-1}

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

(cu)' = c(u)' c是常数

sin(a+b) = sina * cosb + cosa * sinb

cos(a+b) = cosa * cosb - sina * sinb

二、求导特殊三角函数

1、\frac{d}{dx}sinx = \frac {sin(x+\Delta x)-sinx}{\Delta x} = \frac{sinx\times cos\Delta x +cosx\times sin\Delta x - sinx}{\Delta x}

                    =\frac{sinx\times(cos\Delta x -1)}{\Delta x} + \frac{cosx\times sin\Delta x}{\Delta x}

这时回顾一下上节课关于三角函数的内容

当x趋近于0时\frac{sinx\times(cos\Delta x -1)}{\Delta x} = sinx\times 0(考虑1-cos(x)/x 在x趋近0时的极限值, 不正是\frac{(cos\Delta x -1)}{\Delta x} 的变形,上图红线在x趋近0时函数的值趋近0)

\frac{cosx\times sin\Delta x}{\Delta x} = cosx \times 1(考虑x/sin(x) 在x趋近0时的极限值, 不正是\frac{sin\Delta x}{\Delta x} 的变形,上图l蓝线在x趋近0时函数的值趋近1)

=\frac{sinx\times(cos\Delta x -1)}{\Delta x} + \frac{cosx\times sin\Delta x}{\Delta x} = cosx

所以 \frac{d}{dx}sinx =cosx

当然用工具的话:

from sympy import *
x = Symbol('x')
f = sin(x)
derivative_f = f.diff(x)
derivative_f

2、 \frac{d}{dx}cosx =\frac{cos(x+\Delta x) - cosx}{\Delta x} = \frac{(cosx\times cos\Delta x - sinx\times sin\Delta x) - cosx}{\Delta x}

                    =\frac{cosx\times (cos\Delta x-1)}{\Delta x} - \frac{sinx\times sin\Delta x}{\Delta x}

                    =cosx\times 0 - sinx\times 1

                    = -sinx

from sympy import *
x = Symbol('x')
f = cos(x)
derivative_f = f.diff(x)
derivative_f

得到2公式 (sinx)' = cosx & (cosx)' = -sinx

三、三角函数基础公式的几何意义

公式B、\lim_{ \Delta X \rightarrow 0}{\frac{sin\Delta x}{\Delta x}} = 1

import numpy as np 
import matplotlib.pyplot as plt 
 
angle = np.linspace( 0 , 2 * np.pi , 150 ) 
 
radius = 1
 
x = radius * np.cos( angle ) 
y = radius * np.sin( angle ) 
 
figure, axes = plt.subplots( 1 ) 
 
axes.plot( x, y, label='circle radius:'+format(radius) ) 

angleArc = np.linspace( -30/180*np.pi , 30/180*np.pi , 150 ) 
xArc = radius * np.cos( angleArc ) 
yArc = radius * np.sin( angleArc ) 

axes.plot( xArc, yArc,color='r', label='length:(2*30*180/pi)' + format(60/180*np.pi) ) 

angleInner = np.linspace( 30/180*np.pi , 0 , 150 ) 
xArcInner = radius /10 * np.cos( angleInner ) 
yArcInner = radius /10 * np.sin( angleInner ) 

angleInner1 = np.linspace( -30/180*np.pi , 0 , 150 ) 
xArcInner1 = radius /10 * np.cos( angleInner1 ) 
yArcInner1 = radius /10 * np.sin( angleInner1 ) 

axes.plot( xArcInner, yArcInner,color='b' ,label='θ=30*180/pi') 
axes.plot( xArcInner1, yArcInner1,color='b' ) 

plt.text(0.18, 0.03, 'θ', fontsize=9)
plt.text(0.18, -0.08, 'θ', fontsize=9)
#ax = plt.gca()
#axes.annotate('your_lable', (xArcθ,yArcθ)) 
#axes.scatter(xArcθ+0.1*radius,yArcθ+0.1*radius )
#axes.annotate('a', (xArcθ+0.1*radius,yArcθ+0.1*radius ))

axes.set_aspect( 1 ) 
 
x1 = np.cos( 30/180*np.pi )
y1 = np.sin( 30/180*np.pi ) 

plt.plot(x1,y1,lw=0, marker='o', fillstyle='none', color='b')

x2 = np.cos( -30/180*np.pi )
y2 = np.sin( -30/180*np.pi )

plt.plot(x2,y2,lw=0, marker='o', fillstyle='none', color='b')

xarr = [x1,x2]
yarr = [y1,y2] 
plt.plot(xarr, yarr,'gray',linestyle='-',marker='',label='length:(2*sin(30*180/pi))' + format(2*np.sin( 30/180*np.pi )))

xarr1 = [0,x1]
yarr1 = [0,0]
plt.plot(xarr1, yarr1,'orange',linestyle='-',marker='', label='length:cos(30*180/pi)')

xarr1 = [x1,1]
yarr1 = [0,0]
plt.plot(xarr1, yarr1,'yellow',linestyle='-',marker='', label='gap length:1-cos(30*180/pi)')

xarr2 = [0,x1]
yarr2 = [0,y1]
plt.plot(xarr2, yarr2,'black',linestyle='-',marker='')

xarr3 = [0,x2]
yarr3 = [0,y2]
plt.plot(xarr3, yarr3,'black',linestyle='-',marker='')


plt.title( 'Parametric Equation Circle' ) 
plt.legend(loc='upper left')
plt.show() 

可以观察到,当θ值越小时,灰线和红线(sinθ和θ)的长度相差越来越小。而当deltaX趋近于0时,这两条线的长度的比值趋近于1。(曲线中长度很小的一段趋近于直线)

公式A、 \lim_{ \Delta X \rightarrow 0}{\frac{1-cos\Delta x}{\Delta x}}=0

可以观察到,上图中当θ值越小时,灰色线会越发靠近圆弧,黄色的gap( 1-cos\Delta x )的比例会越来越小,同时桔黄色的线( cos\Delta x )会越来越接近半径 1, 所以公式A的分母趋近于0, 同时由于角度θ和红色弧长相等,可以看出虽然θ趋近于0,但远远大于黄色gap的长度,所以公式A等于0。

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bullseye

您的鼓励是我最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值