本文内容来自于学习麻省理工学院公开课:单变量微积分-反向变量替换,配方-网易公开课
开发环境准备:CSDN
目录
3、如上题去除表达式 " tan(arccsc(x)) " 中三角函数
一、公式梳理
1、
(secant)
2、
(cosecant)
3、
(tangent)
4、
(cotangent)
5、 ![sec^2(\theta) = \frac{cos^2(\theta)+sin^2(\theta)}{cos^2(\theta)} =1+tan^2(\theta)](https://latex.csdn.net/eq?sec%5E2%28%5Ctheta%29%20%3D%20%5Cfrac%7Bcos%5E2%28%5Ctheta%29+sin%5E2%28%5Ctheta%29%7D%7Bcos%5E2%28%5Ctheta%29%7D%20%3D1+tan%5E2%28%5Ctheta%29)
6、 ![tan'(\theta) = (\frac{sin(\theta)}{cos(\theta)})' = \frac{cos^2(\theta)+sin^2(\theta)}{cos^2(\theta)} = \frac{1} {cos^2(\theta)} = sec^2(\theta)](https://latex.csdn.net/eq?tan%27%28%5Ctheta%29%20%3D%20%28%5Cfrac%7Bsin%28%5Ctheta%29%7D%7Bcos%28%5Ctheta%29%7D%29%27%20%3D%20%5Cfrac%7Bcos%5E2%28%5Ctheta%29+sin%5E2%28%5Ctheta%29%7D%7Bcos%5E2%28%5Ctheta%29%7D%20%3D%20%5Cfrac%7B1%7D%20%7Bcos%5E2%28%5Ctheta%29%7D%20%3D%20sec%5E2%28%5Ctheta%29)
7、 ![sec'(\theta) = (\frac{1}{cos(\theta)})' = \frac{-(-sin(\theta))} {cos^2(\theta)} = tan(\theta)sec(\theta)](https://latex.csdn.net/eq?sec%27%28%5Ctheta%29%20%3D%20%28%5Cfrac%7B1%7D%7Bcos%28%5Ctheta%29%7D%29%27%20%3D%20%5Cfrac%7B-%28-sin%28%5Ctheta%29%29%7D%20%7Bcos%5E2%28%5Ctheta%29%7D%20%3D%20tan%28%5Ctheta%29sec%28%5Ctheta%29)
8、 ![\int tan(x)dx = \int \frac{sin(x)}{cos(x)}dx](https://latex.csdn.net/eq?%5Cint%20tan%28x%29dx%20%3D%20%5Cint%20%5Cfrac%7Bsin%28x%29%7D%7Bcos%28x%29%7Ddx)
设 u = cos(x), u' =du = -sin(x)dx
9、 ![\int sec(x) dx](https://latex.csdn.net/eq?%5Cint%20sec%28x%29%20dx)
设
由公式 6, 7
二、例题
1、 ![\int sec^4(x)dx = \int (1+tan^2(x))sec^2(x)dx](https://latex.csdn.net/eq?%5Cint%20sec%5E4%28x%29dx%20%3D%20%5Cint%20%281+tan%5E2%28x%29%29sec%5E2%28x%29dx)
用定积分做个简单的验算,取值 ,结果是符合的
import numpy as np
from sympy import *
import matplotlib.pyplot as plt
def DrawXY(xFrom,xTo,steps,expr,color,label,plt):
yarr = []
xarr = np.linspace(xFrom ,xTo, steps)
for xval in xarr:
yval = expr.subs(x,xval)
yarr.append(yval)
y_nparr = np.array(yarr)
plt.plot(xarr, y_nparr, c=color, label=label)
def DrawTrapezoidal(xFrom,xTo,steps,expr,color,plt, label=''):
width = (xTo - xFrom)/steps
xarrRect = []
yarrRect = []
area = 0
xprev = xFrom
yvalAll = 0
for step in range(steps):
yval1 =expr.subs(x,xprev)
yval2 = expr.subs(x,xprev + width)
xarrRect.append(xprev)
xarrRect.append(xprev)
xarrRect.append(xprev + width)
xarrRect.append(xprev + width)
xarrRect.append(xprev)
yarrRect.append(0)
yarrRect.append(yval1)
yarrRect.append(yval2)
yarrRect.append(0)
yarrRect.append(0)
area += width * (yval1+yval2)/2
plt.plot(xarrRect, yarrRect, c=color)
xprev= xprev + width
print('============================')
if len(label)!=0:
print(label)
print('============================')
print('width = ', width)
print('area = ',area)
x = symbols('x')
expr = sec(x)**4
DrawXY (0,np.pi/3,1000, expr, 'c', label='sec(x)',plt=plt)
print(integrate(expr,(x,0,np.pi/3)))
print(tan(np.pi/3)+tan(np.pi/3)**3/3 - tan(0)+tan(0)**3/3)
plt.legend(loc='upper left')
plt.show()
添加图片注释,不超过 140 字(可选)
2、 ![\int \frac{dx}{x^2\sqrt{1+x^2}}](https://latex.csdn.net/eq?%5Cint%20%5Cfrac%7Bdx%7D%7Bx%5E2%5Csqrt%7B1+x%5E2%7D%7D)
由于tan取值范围从负无穷一直到正无穷, 所以可以进行三角替换
设
另由
设
还原三角替换
在上图中直角三角形中, 设 的对边长为x, 则根据前面假设tan(\theta) = x , 有 临边长为1,另斜边长则为
或由
用定积分验算下, 用梯形法得到的结果和计算出的结果近似。
x = symbols('x')
expr = 1/ (x**2*(1+x**2)**0.5)
DrawXY (2,5,100, expr, 'c', label='',plt=plt)
DrawTrapezoidal(2,5,100,expr,'c',plt, label='1/ (x**2*(1+x**2)**0.5)')
#print(integrate(expr,(x,2,5)))
print('result with arc tangent=', float(-csc(atan(5)) + csc(atan(2))))
print('result = ', -((1+5**2)**0.5)/5 + ((1+2**2)**0.5)/2 )
3、如上题去除表达式 " tan(arccsc(x)) " 中三角函数
theta = 45
angle = np.linspace( 0 , 2 * np.pi , 150 )
radius = 1
xarr = radius * np.cos( angle )
yarr = radius * np.sin( angle )
figure, axes = plt.subplots( 1 )
axes.plot( xarr, yarr, label='radius='+format(radius) )
angleInner = np.linspace( theta/180*np.pi , 0 , 150 )
xArcInner = radius /10 * np.cos( angleInner )
yArcInner = radius /10 * np.sin( angleInner )
axes.plot( xArcInner, yArcInner,color='b')
plt.text(0.18, 0.03, 'θ', fontsize=9)
plt.text(cos(theta)-0.18, -0.08, 'adj', fontsize=9)
plt.text(cos(theta)+0.22, sin(theta)-0.48, 'opp', fontsize=9)
plt.text(cos(theta)-0.3, sin(theta)-0.48, 'hyp', fontsize=9)
axes.set_aspect( 1 )
x1 = np.cos( theta/180*np.pi )
y1 = np.sin( theta/180*np.pi )
xarr1 = [0,1]
yarr1 = [0,0]
plt.plot(xarr1, yarr1,'r',linestyle='-',marker='')
xarr2 = [0,x1]
yarr2 = [0,y1]
plt.plot(xarr2, yarr2,'orange',linestyle='-',marker='')
plt.plot([x1,x1], [0,y1],'green',linestyle='-',marker='')
plt.plot([0,x1], [0,0],'green',linestyle='-',marker='')
plt.text(x1+0.05, y1+0.05, '(cosθ ,sinθ)', fontsize=9)
plt.text(-0.1, -0.1, 'O', fontsize=9)
plt.legend(loc='upper left')
plt.show()
设斜边(hyp)为x,则对边(opp)为1, 临边(adj)为
三、三角替换的小结
1、表
如果积分包含 -- 要做的替换 -- 得到
--
or
--
or
当 ,
当 ,
--
--
--
--
--
--
2、例题
设
设 ,
由
由公式9:
由
由