Line Integral and Greens Theorem
Line Integral and Greens Theorem
Definition: let ⃗
F be a continuous vector filed defined on a smooth curve C given by a
vector function r⃗ ( t ) , a ≤ t ≤ b. Then the line integral of ⃗
F along C is integral
❑ b
Matlab code
clc
clear
syms t x y
f=input('enter the f vector as i and j order in vector
form:');
rbar = input('enter the r vector as i and j order in vector
form:');
lim=input('enter the limit of integration:');
vecfi=input('enter the vector field range'); % knowledge of
the curve is essential
drbar=diff(rbar,t);
sub = subs(f,[x,y],rbar);
f1=dot(sub,drbar)
int(f1,t,lim(1),lim(2))
P = inline(vectorize(f(1)), 'x', 'y');
Q = inline(vectorize(f(2)), 'x', 'y')
x = linspace(vecfi(1),vecfi(2), 10); y = x;
[X,Y] = meshgrid(x,y);
U = P(X,Y);
V = Q(X,Y);
quiver(X,Y,U,V)
hold on
fplot(rbar(1),rbar(2),[lim(1),lim(2)])
axis on
xlabel('x')
ylabel('y')
Example 1
2⃗ ⃗j in moving a particle along the
Find the work done by the force field ⃗
F (x , y )=x i−xy
π
quarter – circle r⃗ (t )=cos ( t ) ⃗i + sin (t) ⃗j , 0≤ t ≤
2
Sol:
π π
❑
2 2
∫ ⃗F ∙ d r⃗=¿ ∫ ⃗F (⃗r (t))∙ ⃗r ❑'❑ ( t ) dt=∫ ¿¿
C
0 0
Example 2
❑
Exercise
1. Find the work done by the force field ⃗ F ( x , y )=( y+ z , x+ z , x+ y) on a particle that moves
along the line segment (1, 0, 0) to (3, 4, 2)
Example 1
❑
Evaluate ∮ ( 3 y −e
sin ( x )
) dx + ( 7 x + √ y 4 +1 ) dy , where C is the circle x 2+ y 2=9.
C
clc
clear all
syms x y r t
F=input('enter the F vector as i and j order in vector form:');
integrand=diff(F(2),x)-diff(F(1),y);
polarint=r*subs(integrand,[x,y],[r*cos(t),r*sin(t)]);
sol=int(int(polarint,r,0,3),t,0,2*pi);
P = inline(vectorize(F(1)), 'x', 'y');
Q = inline(vectorize(F(2)), 'x', 'y')
x = linspace(-3.2,3.2, 10); y = x;
[X,Y] = meshgrid(x,y);
U = P(X,Y);
V = Q(X,Y);
quiver(X,Y,U,V)
hold on
fplot(3*cos(t),3*sin(t),[0,2*pi])
axis equal
Matlab code
clc
clear all
syms x y r t
F=input('enter the F vector as i and j order in vector form:');
integrand=diff(F(2),x)-diff(F(1),y);
polarint=r*subs(integrand,[x,y],[r*cos(t),r*sin(t)]);
sol=int(int(polarint,r,1,2),t,0,pi);
P = inline(vectorize(F(1)), 'x', 'y');
Q = inline(vectorize(F(2)), 'x', 'y')
x = linspace(-3.2,3.2,10); y = x;
[X,Y] = meshgrid(x,y);
U = P(X,Y);
V = Q(X,Y);
quiver(X,Y,U,V)
hold on
fplot(1*cos(t),1*sin(t),[0,pi])
fplot(2*cos(t),2*sin(t),[0,pi])
axis equal
enter the F vector as i and j order in vector form:
[y^2 3*x*y]
sol = 14/3