0% found this document useful (0 votes)
19 views6 pages

Sympolic

The document contains examples of using symbolic math functions in MATLAB such as limit, diff, solve, dsolve, int, and symsum to evaluate limits, derivatives, integrals, and infinite series. It demonstrates evaluating limits, derivatives, and integrals of simple functions, solving differential equations, and finding infinite series solutions.

Uploaded by

Quang Minh Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views6 pages

Sympolic

The document contains examples of using symbolic math functions in MATLAB such as limit, diff, solve, dsolve, int, and symsum to evaluate limits, derivatives, integrals, and infinite series. It demonstrates evaluating limits, derivatives, and integrals of simple functions, solving differential equations, and finding infinite series solutions.

Uploaded by

Quang Minh Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

2.

1
1.
syms x;
f = sin(sqrt(x+1)) - sin(sqrt(x));
limit(f,inf)

ans =

0
2.
syms x a;
f = (sin(x)-sin(a))/(x - a);
limit(f,x,a)

ans =

cos(a)
3.
syms x;
f = (sin(3*x)/sin(4*x));
limit(f,x,pi)

ans =

-3/4
4.
syms x;
f = ((1-cos(x))/x^2);
limit(f,x,pi)

ans =

2/pi^2
5.
syms a b x;
f = (log(cos(a*x)))/log(cos(b*x));
limit(f,x,0)

ans =

a^2/b^2
2.2
syms x;
f = x^5 + 3*x^4 - 3*x + 7;
1.
g = diff(f)

g=

5*x^4 + 12*x^3 – 3
2.
subs(f,x,4)

ans =

1787
subs(g,x,4)

ans =

2045
3.
solve(f,x)

ans =

root(z^5 + 3*z^4 - 3*z + 7, z, 1)


root(z^5 + 3*z^4 - 3*z + 7, z, 2)
root(z^5 + 3*z^4 - 3*z + 7, z, 3)
root(z^5 + 3*z^4 - 3*z + 7, z, 4)
root(z^5 + 3*z^4 - 3*z + 7, z, 5)
2.3
syms x;
fzero(@(x) 4*sin(x) - x, -2)

ans =

-2.4746

fzero(@(x) 4*sin(x) - x, 0)

ans =

fzero(@(x) 4*sin(x) - x, 2)

ans =

2.4746
2.4
1. int
Syms x;
double(int(sqrt(1+sin(x)^2),0,pi))

ans =

3.8202

double(int(sqrt(1+sin(x)^4),0,pi))

ans =
3.6525
2. quadl
quadl(@(x) sqrt(1+sin(x).^2),0,pi)

ans =

3.8202

quadl(@(x) sqrt(1+sin(x).^4),0,pi)

ans =

3.6525
2.5
1.
syms t;
y = 1 + exp(-t^2/2);
vt = diff(y) + t*y – t ;
simplify(vt)

ans =

0
2.
syms t;
y = 1/(t-3);
vt = diff(y) + y^2;
simplify(vt)

ans =

0
2.6
1.
Syms y(t) t
dy = diff(y);
vt = dy + t*y;
nghiem1 = dsolve(vt == t)
C2 = 2
nghiem1 = subs(nghiem1)
for i = 1:length(nghiem1)
figure(i);
ezplot(nghiem1(i))
2.
Syms y(x) x
dy = diff(y)
vt = (x + y^2)*dy;
nghiem2 = dsolve(vt == y)
C5 = 2
nghiem2 = subs(nghiem2)
for i = 1:length(nghiem2)
figure(i);
ezplot(nghiem2(i))
3.
Syms y(t) t
dy = diff(y)
vt = y*dy + t*y;
nghiem3 = dsolve(vt == 0);
C2 = 2
nghiem3 = subs(nghiem3)
for i = 1:length(nghiem3)
figure(i);
ezplot(nghiem3(i))
4.
Syms y(x) x
dy = diff(y)
vt = (2*exp(y) - x)*dy;
nghiem4 = dsolve(vt == 1)
C5 = 2
nghiem4 = subs(nghiem4)
for i = 1:length(nghiem4)
figure(i);
ezplot(nghiem4(i))
end
5.
Syms y(x) x
dy = diff(y)
vt = dy + y^2;
nghiem5 = dsolve(vt == 0);
C3 = 2
nghiem5 = subs(nghiem5)
for i = 1:length(nghiem5)
figure(i);
ezplot(nghiem5(i))
6.
Syms y(x) x
dy = diff(y)
vt = (dy - y)*x;
nghiem6 = dsolve(vt == exp(x));
C2 = 2
nghiem6 = subs(nghiem6)
for i = 1:length(nghiem6)
figure(i);
ezplot(nghiem6(i))
2.7
1.
Syms y(t) t;
dy = diff(y);
nghiem1 = dsolve(dy + t*y == t, y(0) == -1)
ezplot(nghiem1, -4, 4)
2.
Syms y(t) t;
dy = diff(y);
nghiem1 = dsolve(dy + y^2 == 0, y(0) == 2)
ezplot(nghiem1, 0, 5)
3.
Syms y(x) x;
dy = diff(y);
nghiem1 = dsolve(dy* (x + y^2) == y, y(0) == 4)
ezplot(nghiem1, -4, 6)
4.
Syms y(x) x;
dy = diff(y);
nghiem1 = dsolve( (2*exp(y) - x == 1, y(0) == 0)
ezplot(nghiem1, -5, 5)
5.
Syms y(t) t;
dy = diff(y);
nghiem1 = dsolve(y*dy + t*y == 0, y(1) == 4)
ezplot(nghiem1, -4, 4)
6.
Syms y(x) x;
dy = diff(y);
nghiem1 = dsolve(x*(dy – y) == exp(x), y(1) == 4*exp)
ezplot(nghiem1, 0.001, 1)

2.8
1.
syms x y;
z = y*log(x^2 - y^2);
vt = diff(z,x)/x + diff(z,y)/y;
vt = simplify(vt);
vp = z/(y^2);
if vt == vp
disp('z la nghiem cua pt da cho')
else
disp('z khong la nghiem cua pt da cho')
end
2.
syms x y;
z = y^(y/x)*sin(y/x);
vt = (x^2)*diff(z,x) + x*y*diff(z,y);
vt = simplify(vt);
vp = y*z;
if vt == vp
disp('z la nghiem cua pt da cho')
else
disp('z khong la nghiem cua pt da cho')
end

2.9
1.
syms x y;
f=x+y
tp1 = int(f,y, x^2, 1)
tp = int(tp1, 0, 1)
5.
symsxyz;
f = x + y^2 + z^3
tp1 = int(f,z, 1, 3)
tp2 = int(tp1,y, -1, 2)
tp = int(tp2, 0, 1)
2.10
1.
syms k;
symsum(1/k^2,1, inf)
2.
syms k;
symsum(1/k^4,1, inf)
3.
syms k;
symsum(1/2^k,1, inf)

You might also like