Let C be the closed curve that is the intersection of the surfaces x^2+y^2=x and z=x.
Related Sage pages: Example 1 Line Integral of Work Type - SOLVER
Formula Sheet Let \vec s(t)= \lt x(t), \,y(t), \, z(t) \gt, \,\,\,\, t \in [t_1,t_2] be a parameterization of the curve. Then ds=\sqrt{{\dot{x}}^2 + {\dot{y}}^2 + {\dot{z}}^2} \, dt and
Formula for 1: L=\int_C \, ds = \int_{t_1}^{t_2}\, \sqrt{{\dot{x}}^2 + {\dot{y}}^2 + {\dot{z}}^2} \, dt
Formula for 2: I=\int_C \, (2x-1)y \,ds = \int_{t_1}^{t_2}\, (2\,x(t)-1)\cdot y(t) \cdot \sqrt{{\dot{x}}^2 + {\dot{y}}^2 + {\dot{z}}^2} \, dt
Preparation for using the SOLVER. We must parameterize the curve and find the interval for t.
Surface 1: x^2+y^2=x Notice that there is no z in the first surface. That means we draw the curve on the x0y plane (z=0) and then go vertically up and down to get the surface.
The curve is an off-center circle (the extra x makes it off-center). We complete the square: x^2-x+y^2=0 \Rightarrow (x-\frac{1}{2})^2-\frac{1}{4}+y^2=0 \Rightarrow (x-\frac{1}{2})^2+y^2=\frac{1}{4}.
So the curve is a circle with center (\frac{1}{2},0) and radius R=\sqrt{\frac{1}{4}}=\frac{1}{2}.
Moving this circle vertically, we see that the surface 1 is a cylinder.
Surface 2: z=x Since all variables are first degree, the surface 2 is a plane.
So the curve C is the intersection of a cylinder and a plane. Visualization below.
|
|
We parameterize C. We should have one parameter! KEY: You need to see that the cylinder-circle describes the x and y coordinates; the plane describes the z coordinate.
We parameterize a circle (x-p)^2+(y-q)^2=R^2 with x=Rcos(t)+p and y=Rsin(t)+q and the interval is t \in [0,2 \pi ].
The plane is z=x, so we set z=x=Rcos(t)+p
From above, we have: (p,q)=(\frac{1}{2},0) and radius R=\frac{1}{2}.
So: C = \vec s(t) = \left\{ \begin{array}{l}x = {\textstyle{1 \over 2}}\cos t + {\textstyle{1 \over 2}}\\y = {\textstyle{1 \over 2}}\sin t\\z = {\textstyle{1 \over 2}}\cos t + {\textstyle{1 \over 2}}\end{array} \right.\,\,\,\,\,t \in [0,2\pi ]
We check this parametrization.
|
|
For fun, we draw points on the curve that are evenly spaced with respect to t.
Notice that they do NOT appear to be evenly spaced on the curve itself. This is because ds \ne constant dt
|
|
SOLVER: Our program follows the hand solution method. Everything in red requires something particular to your problem!
\newcommand{\Bold}[1]{\mathbf{#1}}t \newcommand{\Bold}[1]{\mathbf{#1}}\left(x, y, z\right) \newcommand{\Bold}[1]{\mathbf{#1}}t \newcommand{\Bold}[1]{\mathbf{#1}}\left(x, y, z\right) |
|
|
Step 2: The program finds the vector function with the partial derivatives: d \vec s(t)=\lt {\dot{x}},\, {\dot{y}},\, {\dot{z}} \gt
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-0.500000000000000 \, \sin\left(t\right),\,0.500000000000000 \, \cos\left(t\right),\,-0.500000000000000 \, \sin\left(t\right)\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-0.500000000000000 \, \sin\left(t\right),\,0.500000000000000 \, \cos\left(t\right),\,-0.500000000000000 \, \sin\left(t\right)\right)
|
Step 3: The program calculates the magnitude of the vector function ds(t): \left\| {ds} \right\| = norm of ds = nds= \sqrt{{\dot{x}}^2 + {\dot{y}}^2 + {\dot{z}}^2}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
|
Our problem - look carefully at this: nds=0.5 \cdot \sqrt{sin^2(t)+1}\ne constant as we predicted from the "non-evenly spaced" points.
Step 4: The program defines a standard sage function for "change of variables" for a 1-variable parametrization (surface).
The program changes the variables of f from a function of (x,y,z) to a function of t using s(t).
|
|
\newcommand{\Bold}[1]{\mathbf{#1}}1
\newcommand{\Bold}[1]{\mathbf{#1}}1
|
Step 5: Then program finds the product of f and ds (the magnitude from step 3).
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
|
\newcommand{\Bold}[1]{\mathbf{#1}}\int_{0}^{2 \, \pi} \sqrt{0.5 \, {\left| \sin\left(t\right) \right|}^{2} + 0.25 \, {\left| \cos\left(t\right) \right|}^{2}}\,{d t}
\newcommand{\Bold}[1]{\mathbf{#1}}\int_{0}^{2 \, \pi} \sqrt{0.5 \, {\left| \sin\left(t\right) \right|}^{2} + 0.25 \, {\left| \cos\left(t\right) \right|}^{2}}\,{d t}
|
\newcommand{\Bold}[1]{\mathbf{#1}}3.82019778903
\newcommand{\Bold}[1]{\mathbf{#1}}3.82019778903
|
Answer: The length of the curve C is: L\approx 3.82
Notice that the integrand is NOT an elementary integral, so there is no "exact" result. Only the numeric result.
We graph the integral. The length of the curve is the "area" captured by the vertical lines (divided by the vector scale).
Here the vector scale = vs = 1. Since f=1, height of the lines is the "rate of curve per unit t".
Notice the height of the vertical lines is NOT constant. This is nds; it does NOT have to be constant, but it must be positive. Why?
We see that the average height of the lines is \approx 0.6 Multiplied this by the length of the interval 2\pi, we get \approx 3.82 which is the length of the curve.
|
|
Problem 2 Find line integral of the function f(x,y,z)=(2x-1)y over C.
For our amusement, we map f=(2x-1)y as a z-component along C in the graph below. Click and drag to rotate.
Technically we need to draw f perpendicular to C with respect to t, but that is alot of work.
Notice that the arrows are evenly spaced with respect to t, but not with respect to the circle. (Again this is because of ds.)
More importantly, notice though that the arrows are "symmetric" with as many arrows pointing positively (up) as negatively (down). Remember this!
|
|
Symbolic Solution to Problem 2 (or go down to the SOLVER)
The line integral is: \int\limits_C {(2x - 1)y\,ds} = \int_{{t_1}}^{{t_2}} {f(t)\sqrt {\dot x{{(t)}^2} + \dot y{{(t)}^2} + \dot z{{(t)}^2}} } \,dt where:
f(t) = (2({\textstyle{1 \over 2}}\cos (t) + {\textstyle{1 \over 2}}) - 1) \cdot {\textstyle{1 \over 2}}\sin (t) = {\textstyle{1 \over 4}}\sin (t)\cos (t) and
ds(t) = \,\left\{ \begin{array}{l}\dot x = - {\textstyle{1 \over 2}}\sin t\\\dot y = {\textstyle{1 \over 2}}\cos t\\\dot z = - {\textstyle{1 \over 2}}\sin t\end{array} \right. so \sqrt {\dot x{{(t)}^2} + \dot y{{(t)}^2} + \dot z{{(t)}^2}}=\frac{1}{2}\sqrt{1+sin^2(t)}
(As before in 1., this is the source of the uneven spacing of the f-arrows in the above picture.)
So: \int_C {(2x - 1)y\,ds} = \int_0^{2\pi } {{\textstyle{1 \over 8}}} \,\sin t \cdot \cos t\sqrt {1 + {{\sin }^2}t} dt = {\textstyle{1 \over 8}} \cdot {\textstyle{1 \over 2}}\dfrac{(1+sin^2x)^{3/2}}{3/2} \bigg|_0^{2 \pi}=0 (Recall: (1+sin^2(t))'=2sin(t)cos(t)dt.
Unfortunately any function f that gives a reasonable integral for symbolic solution also gives a result of 0 :))
SOLVER: Problem 2 So that SAGE does not get confused we concat a "1" to every variable name (even the ones that don't change).
Step 1: We define C as vector function \vec s(t), input our interval on t and define f(x,y,z). Changes with problem; you must input your parametrization in C as s(t), your interval for t and your function of f(x,y,z).
|
|
Step 2: The program finds the vector function with the partial derivatives: d \vec s(t)=\lt {\dot{x}},\, {\dot{y}},\, {\dot{z}} \gt
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-0.500000000000000 \, \sin\left(t\right),\,0.500000000000000 \, \cos\left(t\right),\,-0.500000000000000 \, \sin\left(t\right)\right)
\newcommand{\Bold}[1]{\mathbf{#1}}\left(-0.500000000000000 \, \sin\left(t\right),\,0.500000000000000 \, \cos\left(t\right),\,-0.500000000000000 \, \sin\left(t\right)\right)
|
Step 3: The program calculates the magnitude of the vector function Cprime: \left\| {ds} \right\| = norm of ds = nds= \sqrt{{\dot{x}}^2 + {\dot{y}}^2 + {\dot{z}}^2}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
\newcommand{\Bold}[1]{\mathbf{#1}}\sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}}
|
Step 4: The program defines a standard sage function for "change of variables" for a 1-variable parametrization (surface).
The program changes the variables of f from a function of (x,y,z) to a function of t using s(t).
|
|
\newcommand{\Bold}[1]{\mathbf{#1}}0.500000000000000 \, \sin\left(t\right) \cos\left(t\right)
\newcommand{\Bold}[1]{\mathbf{#1}}0.500000000000000 \, \sin\left(t\right) \cos\left(t\right)
|
Step 5: Then program finds the product of f and ds (the magnitude from step 3).
\newcommand{\Bold}[1]{\mathbf{#1}}0.500000000000000 \, \sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}} \sin\left(t\right) \cos\left(t\right)
\newcommand{\Bold}[1]{\mathbf{#1}}0.500000000000000 \, \sqrt{2 \, {\left| -0.500000000000000 \, \sin\left(t\right) \right|}^{2} + {\left| 0.500000000000000 \, \cos\left(t\right) \right|}^{2}} \sin\left(t\right) \cos\left(t\right)
|
Step 6: The program computes the integral.
\newcommand{\Bold}[1]{\mathbf{#1}}0.0
\newcommand{\Bold}[1]{\mathbf{#1}}0.0
|
\newcommand{\Bold}[1]{\mathbf{#1}}0.000000000000000
\newcommand{\Bold}[1]{\mathbf{#1}}0.000000000000000
|
Answer: The line integral of the function f(x,y,z)=(2x-1)y over the curve C is: = 0
Notice that this is an elementary integral that we can (and did) solve symbolically.
Below is a proper image of the line integral which corresponds to the integral on the interval t \in [0,2pi] of the function corresponding to the endpoints of the arrows. The arrow lengths are f(t) \cdot ds(t) and are evenly spaced.
Notice that the integral = 0 has nothing to do with the curve being closed, but rather it is because the function f varies "symmetrically" positively and negatively with respect to the curve. Recall the arrows being symmetrically up and down!
|
|
We sometimes think of f as giving the "thickness" of the curve. However here f has both positive and negative values.
For fun, we draw a "sort of" representation of this by mapping f vertically. Notice that the "positive" thickness cancels the "negative" thickness and we are left with no area.
|
|
|
|