1

解答:

>> clear

>> syms x

>> int((x^2-4*x)/(x^2-2*x-3))

 

ans =

 x-5/4*log(x+1)-3/4*log(x-3)

所以,原式= x-5/4*log(x+1)-3/4*log(x-3)+C
 

 

 

2

解答:

>> clear

>> syms x

>> int(exp(2*x)*sin(2*x)^2,-pi,2*pi)

 

ans =

 1/5*(exp(pi)^6-1)/exp(pi)^2

 

 

 

 

3

 

 

解答:

>> clear

>> syms x

>> int(exp(-x^2)*cos(x^3),0,pi)

Warning: Explicit integral could not be found.

> In sym.int at 58

 

ans =

 int(exp(-x^2)*cos(x^3),x = 0 .. pi)

>> quad('exp(-x.^2).*cos(x.^3)',0,pi)

 

ans =

    0.6941

 

 

4

 

解答:

>> clear

>> x=1:0.1:5;

>> y=exp(-(x-3).^2).*cos(4*(x-3));

>> plot(x,y)

>> syms  x

>> v=int(pi*(exp(-(x-3)^2)*cos(4*(x-3)))^2,1,5);

>> simplify(v)

 

ans =

 

1/16*pi^(3/2)*2^(1/2)*(exp(-8)*erf(2*2^(1/2)-2*i*2^(1/2))+4*erf(2*2^(1/2))+exp(-8)*erf(2*2^(1/2)+2*i*2^(1/2))-exp(-8)*erf(-2*2^(1/2)-2*i*2^(1/2))-exp(-8)*erf(-2*2^(1/2)+2*i*2^(1/2)))

>> quad('pi*(exp(-(x-3).^2).*cos(4*(x-3))).^2',1,5)

 

ans =

 

    1.9693