đáp án cho các ví dụ của matlab full
Trang 1Ví dụ 75: tính các giới hạn
a
>> syms hx
>> limit((cos(x+h)-cos(x))/h,h,0)
ans =
-sIn(X)
b
>> syms n xX
>> limit((1+x/n)“n,n, inf)
ans =
exp(x)
vi du 76: tinh giéi han m6t phia (abs /d tri tuyét đối của x)
>> Syms X
>> limit(x/abs(x),x,0,'left’)
ans =
-]
>> Syms X
>> limit(x/abs(x),x,0,'right')
ans =
I
Vi du 77: tinh dao ham
>> Syms X
>> f=sin(5*x);
>> diffi
ans =
5*cos(5*x)
>> g=exp(x)*cos(x);
>> difffg)
ans =
exp(x)*cos(x) - exp(x)*sin(x)
>> diff(g,2)
Trang 2ans =
(-2)*exp(x)*sin(x)
>> syms xna
>> fa*xn;
>> dif(Ð
ans =
a*n*x’(n - 1)
>> syms x ab
>> g=sin(a*xt+b);
>> diff(g)
ans =
a*cos(b + a*x)
>> Syms X y
>> f=sin(x*y);
>> dif(£x)
ans =
y*cos(x*y)
>> diff(fy)
ans =
x*cos(x*y)
We das 8+ và đã WE CEES SFL VE Goes Cài hàng CESS SSSR ESS
>> Syms X
>> a=sym(1/2);
>> Eexp(-a*x^2);
>> ezplot(f)
Trang 3Ví dụ 81:cho hàm -
Tính giá trị của hàm tai x=1 và tính tích phân của hàm f(x) tir -© dén 1
Vẽ đô thị hàm sô
>> Syms X
>> fF 1/sqrt(2*pi)*exp(x*2/2);
>> C_tri = solve(diff(f))
C tri=
0
>>Y_C tri=subs(fx,0)
Y C tri=
0.3989
>> D_uon = solve(diff(f,2))
D_uon =
i
-i
>> Y_uon_1 = subs(f,x, 1)
Y_uon |=
0.6577
>> Y_uon 2 =subs(f,x,-1)
Y uon 2=
0.6577
>> Y_t_can = limit(f,x,inf)
Y t can=
Inf
>> T_p = double(int(f-inf, 1))
Trang 4T p=
Inf
>> ezplot(f)
>> hold on
>> plot(double(D_uon),double(subs(f,D_uon)),'ro’)
Warning: Imaginary parts of complex X and/or Y arguments ignored
>>
Mod Ÿ hss Rs Sieh gxesasxrf2ss Ẩs À sex
Š WI SN Ca Ÿa¿ QÃ SXSX SERESE VY LOSE SSSR SSS *
>> syms a b x
>> f1=1/(x*log(x));
>> int(fl)
ans =
log(log(x))
>> f2=exp(a*x)*cos(b*x);
>> int(f2,x)
ans =
(exp(a*x)*(a*cos(b*x) + b*sin(b*x)))/(a*2 + b^2)
>> f3=l/(x*(x^2+1));
>> int(f3)
ans =
log(%) - log(x^2 + 1)/2
>> f4=cos(a*x)*sin(b*x):
>> int(f4)
ans =
(a*sin(a*x)*sin(b*x) + b*cos(a*x)*cos(b*x))/(a%2 - b^2)
Trang 5>> int(sin(x)*2,0,p1/2)
ans =
pi/4
>> int(exp(-x”2),0, inf)
ans =
pi(1/2)/2
a x ap ay a Ñ = 22.8 BT oe a
>> Syms X
>> fl=exp(-x^2);
>> int(f1,0,inf)
ans =
pi(1/2)/2
>> f2=l1l/(x^2+2*x+2);
>> int(f2,-inf,inf)
ans =
pi
>> f3=log(x)/x;
>> int(f3, 1,inf)
ans =
Inf
°
Rass Bony BESS fk OEP NS TEEN 3 ants sweecosws 8 TH XS ki Geaeces ¬ te Sy Sy fee BAS ees 8 oe oe 2 Cor es o we a feo" Z COR We es ae “ We “%z tan v2 sees oP
>> syms abc x
>> S=a*x^2+b*x+c;
>> solve(S,x)
ans =
-(b + (b’2 - 4*a*c)*(1/2))/(2*a)
-(b - (b^2 - 4*a*c)*(1/2))/(2*a)
>> solve(S,b)
ans =
Trang 6-(a*x^2 + c)/x
x+y- xy =3 Vxt1l+/jyt+l =4 2,Giải hệ phương trình:
>> Sym§ X VY
>> [x y|=solve(x+y-sqrt(x*y)-3,sqrt(x+1)+sqrt(y+1)-4)
xX =
3
y =
3
Vi du 92: tính tông các chuôi: ⁄ m
=l
>> syms k
>> S=symsum(1/k^2,I,nÐ
S=
pi2/6
a!
^, ta KÍX +L)(W + 2)
>> syms k
>> S=symsum(1/k*(k+1)*(k+2),1,inf)
S =
Inf
dx
k=0
>> syms x k
>> S=symsum(x”k,0, inf)
S =
piecewise([Re(k) < -1, zeta(-k) + 0“k])
vi du 93: Viet 8 từ đầu của khai triển Mac Laurin của hàm f = C0S2X; Viết 4 từ đầu cho khai triên Taylor của hàm gø = 1/x tại lần cận x = 2
Trang 7>> Syms X
>> f(cos(x))2;
>> T1=taylor(f,8)
TI
- (2*x^6)/45 + x^4/3 - x^2 + l
>> Syms X
>> g=1/x;
>> T2=taylor(g,4,2)
>> f=(sin(x))2; >
>> taylortool(f)
We sixes GR os YS ARES FF go QERER SHRSSS ‘ Ses anh SC RSERE ELS Laksd Nersssetar ese ose have Usk Skee ass
>> Syms X
>> Eexp(-x^2);
>> F=fourier(f)
F
pi 1/2)/exp(w’2/4)
>> Syms X
>> f=x*exp(-abs(x));
>> F=fourier(f)
F
-(4*i*w)/(w^2 + 1)^2
>> Syms X
>> F=exp(-abs(x));
>> f=ifourier(F)
4 z4
Hs fry e
#⁄% Hư nas? Poy hee ere oS gre es es
S24 ed we
#5 OE:
vd %
Trang 81⁄pi*2 + 1)
>> syms t
>> fFt4;
>> L=laplace(f)
L =
24/s*5
>> syms at
>> fexp(a*t);
>> L=laplace(f)
L =
-l/(a - S)
>> syms ax
>> f=x*sin(a*x);
>> L=laplace(f)
L =
(2*a*s)/(a^2 + s^2)^2
NÑ/Z§ J ¢ gẳng ON « Siee N OE LL eric brave SERS CESS xa ¬ ` baa Xã goss Š
WE CARS Coch SARSS Lash š§s3§§ẽ VÀ $JY: $ §
^
>> syms Ss
>>L=1/s^2;
>> f=ilaplace(L)
f=
t
>> SVM§ S
>> L=s/(s*2-2*s+5);
>> f=ilaplace(L)
f=
exp(t)*(cos(2*t) + sin(2*t)/2)