# 6

> restart : with(linalg): i:= [1,0,0] : j := [0,1,0] : k := [0,0,1]:

Warning, new definition for norm

Warning, new definition for trace

> G_1 := (1+x)* exp(x+y);

> G_2 := x* exp(x+y);

> G_3 := 5*y ;

> G := [G_1, G_2, G_3 ] ;

> curl_G := curl( G, [x,y,z] ) ;

> curl_G := [ dotprod(curl_G,i) , dotprod(curl_G,j) , simplify(dotprod(curl_G,k)) ];

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> F_1 := G_1 ;

> F_2 := G_2 ;

> F_3 := 0;

> F := [F_1, F_2, F_3 ];

> curl_F := curl( F, [x,y,z] ) ;

> curl_F := [ dotprod(curl_F,i) , dotprod(curl_F,j) , simplify(dotprod(curl_F,k)) ];

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

So int_c G dot ds = [ int_c (G - F) dot ds ] + [ int_c F dot ds ]

>

For the [ int_c (G - F) dot ds] part:

>

> G_minus_F := [ G_1 - F_1 ,G_2 - F_2, G_3 - F_3 ];

[Maple Math]

> c_1 := (2-t)*exp(t);

> c_2 := t ;

> c_3 := 2*t ;

> c := [c_1, c_2, c_3 ];

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> G_minus_F_on_c := subs( {x=c_1, y=c_2, z=c_3 }, G_minus_F );

> c_prime := [diff(c_1, t), diff(c_2, t), diff(c_3, t) ];

> integrand := dotprod(G_minus_F_on_c, c_prime);

[Maple Math]

[Maple Math]

[Maple Math]

> integral_1 := int(integrand, t = 0 .. 2) ;

[Maple Math]

>

For the [ int_c F dot ds ] part:

since F is conservative, the integral is independent of path ...

so we can use any path from c(0) to c(2) ...

so let's use the straight line segment ....

go back to informal summary - equation of a line - if you need:

> c_start := simplify( subs( {t = 0} , c ) ) ;

> c_end := subs( {t=2} , c ) ;

> v := c_end - c_start;

> p := c_start + t * v ;

> p := matadd( c_start , scalarmul( v , t) ) ;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> p_1 := dotprod(p, [1,0,0] );

> p_2 := dotprod(p, [0,1,0] );

> p_3 := dotprod(p, [0,0,1] );

> F_on_p := subs( {x=p_1, y=p_2, z=p_3} , F );

> p_prime := [diff(p_1, t), diff(p_2, t), diff(p_3, t) ];

> integrand := dotprod( F_on_p, p_prime) ;

> integrand := simplify( dotprod( F_on_p, p_prime) ) ;

> integral_2 := int(integrand, t = 0 .. 1) ;

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

>

adding we get:

> integral := integral_1 + integral_2 ;

[Maple Math]

>

>