Maple计算微积分问题
在前面,我已经介绍了用Maple计算函数的导数问题。本文,进一步学习Maple处理微积分的问题。
不定积分的计算
1、计算sin(x)的原函数。f:=x->sin(x);Integrate(f(x),x)=integrate(f(x),x);Maple也把后面的常数项C忽略了。
2、加上常数项:f:=x->sin(x);Integrate(f(x),x)=integrate(f(x),x)+C;对比一下。
3、有些函数是求不出原函数的:f:=x->1/sin(x^2);Integrate(f(x),x)=integrate(f(x),x)+C;
4、还有些函数的原函数很复杂,不能表示为初等函数:g:=x->sin(x^2);Integrate(g(x),x)=integrate(g(x)荑樊综鲶,x)+C;和g:=x->sin(x^3);Integrate(g(x),x)=integrate(g(x),x)+C:simplify(%);
定积分的计算
1、计算sin(x)在a到b之间的定积分:f := x-> sin猾诮沓靥(x) ;Integrate(f(x), x = a .. b) = integrate(f(x), x = 锾攒揉敫a .. b)a..b,就是a到b的意思。
2、给a和b赋上具体的数值:f := x-> sin(x) ;a:=0:b:=pi:Integrate(f(x), x = a .. b) = integrate(f(x), x = a .. b)
3、一般都有定积分:f := x-> sin(x^2) ;a:=0:b:=pi:Integrate(f(x), x = a .. b) = integrate(f(x), x = a .. b)
4、除非函数值出界:f := x-> 1/sin(x) ;a:=0:b:=pi:Integrate(f(x), x = a .. b) = integrate(f(x), x = a .. b)
5、调整一下求积区间:f := x-> 1/(1+sin(x+1)) ;a:=1:b:=2:Integrate(f(x), x = a .. b) = integrate(f(x), x = a .. b)
6、给出数值解:f := x-> 1/(1+sin猾诮沓靥(x+1)) ;a:=1:b:=2.:Integrate(f(x), x = a .. b) = integrate(f(x)荑樊综鲶, x = a .. b)大家看看上下文的代码有什么区别吗?
7、计算广义积分:f:=x->1/(c^2+x^2):a:=-in酆璁冻嘌finity:b:=infinity:Integrate(f(x),x=a..b)=integrate(f(x),x=a..b);答案是:π/abs(c)。
8、integrate(1/(1-x^2),x=a..b);出界了。
解简单的一阶微分方程
1、求y'(x)= 2*x*y(x)的通解:with(DEtools):de:=diff(y(x),x)=2*x*y(x);dsolve(de, y(x));通解是:y(x) = C1*e^(x^2)。
2、求y'(x)=exp(a*x-y(x))满足y(0)=0的特解:with(DEtools):de:= diff(y(x),x)=exp(2*x-y(x));dsolve({de,y(0)=0}, y(x));