首页 > 编程知识 正文

matlab求上限无穷积分,函数定积分的导数

时间:2023-05-05 07:01:53 阅读:195620 作者:1395

极限、导数和积分 01 求极限

调用格式为:

求当x趋近于a时函数f的极限;(当a=Inf或-Inf时,求x趋近于正无穷或负无穷的极限)limit(f,x,a)

实践

求数列 lim ⁡ x → ∞ ( 1 + 1 n ) n lim_{x to infty}{(1+frac{1}{n})^n} limx→∞​(1+n1​)n syms n;x_n=(1+1/n)^n;limit(x_n,n,Inf)

运行

>> syms n;x_n=(1+1/n)^n;limit(x_n,n,Inf) ans = exp(1) 02 求导

调用格式为:

求以var为自变量f的导数diff(f,var)求以var为自变量的f的n阶导数diff(f,var,n)

实践

已知函数 f ( x , y ) = x 3 + 2 y 2 + a s i n x f(x,y)=x^3+2y^2+asinx f(x,y)=x3+2y2+asinx,求 ∂ f ∂ x frac{partial f}{partial x} ∂x∂f​, ∂ f ∂ y frac{partial f}{partial y} ∂y∂f​,并求 f ( x , y ) f(x,y) f(x,y)参数a的导数 ∂ f ∂ a frac{partial f}{partial a} ∂a∂f​ syms a x y;f=x^3+2*y^2+a*sin(x)g1=diff(f) %就近原则g2=diff(f,y)g3=diff(f,a)

运行

>>g1 = a*cos(x) + 3*x^2 g2 = 4*y g3 = sin(x)

2.求函数 f ( x ) = e x c o s x f(x)=e^xcosx f(x)=excosx 的 f ′ ( x ) , f ′ ′ ( x ) , f ( 10 ) ( x ) f'(x),f''(x),f^{(10)}(x) f′(x),f′′(x),f(10)(x)

syms x;f=exp(x)*cos(x);d1=diff(f)d2=diff(f,2)d3=diff(f,10)

运行

d1 = exp(x)*cos(x) - exp(x)*sin(x) d2 = -2*exp(x)*sin(x) d3 = -32*exp(x)*sin(x) 03 不定积分

调用格式为:

f对指定自变量var的不定积分int(f,var)f对指定自变量var在区间[a,b]上的不定积分,a,b可取-Inf和Inf,负无穷到正无穷。为缺省值。int(f,var,a,b)

实践

求函数 f ( x ) = x 3 + s i n x f(x)=x^3+sinx f(x)=x3+sinx的不定积分和在区间[a,b]的定积分。 syms x a b;f=x^3+sin(x);g1=int(f)g2=int(f,a,b)

运行

g1 = x^4/4 - cos(x) g2 = cos(a) - cos(b) - a^4/4 + b^4/4 计算反常积分 ∫ − ∞ ∞ d x 1 + x 2 int^{infty}_{-infty}{frac{dx}{1+x^2}} ∫−∞∞​1+x2dx​ 和 ∫ 0 ∞ d x 1 + x 2 int^{infty}_{0}{frac{dx}{1+x^2}} ∫0∞​1+x2dx​ syms xf=1/(1+x^2);g1=int(f,-Inf,Inf)g2=int(f,0,Inf)

运行

g1 = pi g2 = pi/2 计算摆线 x = a ( t − s i n t ) ; y = a ( 1 − c o s t ) ; x=a(t-sint); y=a(1-cost); x=a(t−sint);y=a(1−cost);的一拱 0 ≤ t ≤ 2 π 0 leq t leq 2pi 0≤t≤2π的长度;

求解: 由于 d s = ( d x ) 2 + ( d y ) 2 ds=sqrt{(dx)^2+(dy)^2} ds=(dx)2+(dy)2 ​,弧长 s = ∫ 0 2 π d s s=int^{2pi}_{0}ds s=∫02π​ds

syms t a;x=a*(t-sin(t));y=a*(1-cos(t));dx=diff(x,t);dy=diff(y,t);ds=(dx^2+dy^2)^(1/2);s=int(ds,t,0,2*pi)

运行

s = 8*(a^2)^(1/2)

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。