X Vector Algebra and Space Geometry
Usage Overview
Functions | Brief Usage Descriptions and Examples |
---|---|
vec,lnt,ang | The function "vec;f(i, j, k)" or "vec;f(u,v,w);u;uexpr;v;vexpr;w;wexpr" performs vector addition, subtractions, scalar multiplication, dot product, and cross product in R3. The function "vec;lnt(u);u;uexpr" calculates the length of u, and "vec;ang(u,v);u;uexpr;v;vexpr" returns the angle between vectors u and v. Examples vec;i**k || vec;i-2*j+3*k || vec;x*i-3*j+k/y || vec;2*u-5*v;u;i-2*j;v;4*k-7*j || vec;u/lnt(u);u;sin(x)*i+cos(x)*j+k || vec;lnt(i+2*j-2*k) || vec;ang(i,j) ||. |
prj,tnv | The function "vec;prj(u,v)" returns the projection of vectors u onto v, and "vec;tnv(x(t)*i+y(t)*j+z(t)*k,t)" returns a tangent vector of f(t) with respect to "t". Examples vec;prj(4*j-3*k,2*i+5*j) || vec;tnv(2*t*i+t**2*j-k/t,t) ||. |
cul,dvg,csv | The function "vec;cul(F(x,y,z),x,y,z)" returns the curl of a vector valued function (field) F(x,y,z) = f(x,y,z)*i+g(x,y,z)*j+h(x,y,z)*k, "vec;dvg(F(x,y,z),x,y,z)" returns the divergence of F(x,y,z), and "vec;csv(F(x,y,z),x,y,z)" determines if F(x,y,z) is conservative. Examples vec;cul(y*j-x*i+z*k,x,y,z) || vec;csv(-x*i+y*j-z*k,x,y,z) || vec;dvg(x**2*i-y*k+3*j,x,y,z) || vec;cul((x*i+y*j)/(x**2+y**2)**(1/2),x,y) ||. |
Table of Contents
1 Vector Algebra and Space Geometry
Points, Vectors, and Distances in Space: [ vec; a*i+b*j+c*k ], [ vec;lnt(a*i+b*j+c*j) ]
Suppose \(P(x_1,y_1,z_1)\) and \(Q(x_2,y_2,z_2)\) are two points in space \(R^3\). The distance between \(P\) and \(Q\) can be calculated by \(\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}\), which is the length or magnitude of the vector \(\overrightarrow{PQ}=⟨x_2-x_1,y_2-y_1,z_2-z_1⟩\)
\(=(x_2-x_1)i+(y_2-y_1)j+(z_2-z_1)k\).
Example The distance between (2, 1/3, 1) and (1, 1/2, 2/3) by ((2-1)**2+(1/3-1/2)**2+(1-2/3)**2)**(1/2) ||. Since the distance is also the length of vector \(\overrightarrow{PQ}=〈1, -\frac{1}{6}, \frac{1}{3}〉\), calculate the length by vec;lnt(i-j/6+k/3) ||.
Example Calculate the distance between two points on the coordinate plane in \(R^2\). The length of the line segment between (3, 7) and (1, -3) is by ((3-1)**2+(7+3)**2)**(1/2) ||, and the same result can be obtained by vec;lnt(2*i+10*j) ||.
Plane (2D) and space (3D) vector algebra: [vec; a*i+b*j+c*k]Use "vec; expr" to do vector operations including addition, subtraction, scalar multiplication, dot product, cross product, and their combinations. Vectors must be written as a linear combination of the standard basis vectors i = 〈1, 0, 0〉, j = 〈0, 1, 0〉, and k = 〈0, 0, 1〉. Use "vec;lnt(a*i+b*j+c*k)" to calculate the length \(\sqrt{a^2+b^2+c^2}\)of a vector u = ⟨a, b, c⟩, and use "vec;(a*i+b*j+c*k)/lnt(a*i+b*j+c*k)" to normalize the vector (or get the unit vector \(\frac{\bf u}{||\bf u||}\)).
Vector expressions Use operators +, -, *, ** (or ^) along with the standard basis vectors i, j, k to write a vector expression, where '*' stands for scalar multiplication or vector dot product, and '**' or "^" for vector cross product. Each vector expression must be a linear combination of i, j, k.
For example, the expression "i + 2*j" represents the vector with components 〈1, 2, 0〉. Without any basis vector i, j, k, an expression cannot be considered to be a valid vector expression. These expressions "2*u+v", "2*i-3", "2/3", and "4-5*k" are not vector expressions. Also be aware that vector division is not defined, and thus such an operation "i / j" is not defined.
Attention The expression "vec(vexpr)" does not work. For example, vec(i*i) = vec(i2) and the vector operatation i2 is not defined. Use "vec;i*i" to get the result 1.
Examples
(1) The code vec;i || gives the unit vector 〈1, 0, 0〉. Check vec;-j || vec;2*k || vec;3 ||.
(2) vec;2*i*(3*j+4*k) || performs vector addition, scalar multiplication and dot product, and gives the result of 0.
(3) vec;(3*i-2*j+4*k)**(4*j-6*k) || vec;(3*i-2*j+4*k)**(4*j-6*k) ||
give the vector components 〈-4, 18, 12〉 of the cross product u × v for vectors u = 3i - 2j + 4k and
v = 4j - 6k.
(4) vec;2*i*(3*j+4*k) || vec;2*i*(3*j+4*k) || compute the dot product of 〈2, 0, 0〉 and 〈0, 3, 4〉.
(5) vec;3*i-2*j+4*k-(4*j-6*k) || calculates the difference of 〈3, -2, 4〉 and 〈0, 4, -6〉.
(6) vec;(i+2*j-2*k)/lnt(i+2*j-2*k) || normalizes the vector ⟨1, 2, -2⟩.
Vector with variable components Vector components can be variables and functions. The module "vec; vexpr" also simplifies vector operations that involve variables and function components. For complicated operations among vector-valued functions, use the method described in Operation among vector-valued functions. For dot product of vectors in \(R^n\) and \(C^n\), refer to the "dot" function in the section Linear Algebra.
Dot product \({\bf u}·{\bf v}=\sum_{i=1}^nu_iv_i=||{\bf u}||||{\bf v}||\cosθ\), where \(θ\) is the angle between the two vectors. Check \({\bf u}·{\bf u}=||{\bf u}||^2\cos0=||{\bf u}||^2\) by "vec;u*u-lnt(u)^2;u;x*i+y*j+z*k". Thus, dot product can be used to find length, angle, and the component of a vector along a unit vector. If v is a unit vector, the component of u along v is u·v = ||u||cosθ, where θ is the angle between u and v. For example, the tangential and normal components of acceleration a are a·T and a·N, respectively (unit tangent vector T and unit normal vector N).
Examples vec;(a*i+b*k)*(x**2*i-y**(-2)*j+k/z) || gives the dot product of two vectors with variable components. Check more vec;a*i || vec;(x+y)*j || vec;a*i+b**2*j+c**(-2)*k ||.
Vector cross product Suppose v and w are nonparallel vectors. When the fingers of the right-hand curl from v to w, the thumb points in the direction of v × w, which is orthogonal to the plane spanned by v and w. Thus, v × w lies on the normal vector (or is parallel to the normal vector) of the plane containing v and w.
The length of v × w is ||v|| ||w||sinθ, the direction follows the right-hand rule, so v × w = (||v|| ||w||sinθ)n is the unique vector that is orthogonal to both v and w, where n is the unit vector of v × w, and 0 ≤ θ ≤ π is the angle between v and w.
In particular, if θ = 0 or θ = π, v and w are parallel and v × w = 0. By the same logic, we have v × v = -(v × v) = 0.
To show the orthogonality, we only need to show the vector triple product v · (v × w) = 0. This quantity is equivalent to the determinant of the matrix form by the vectors v, v, and w, which is known to be 0 because the first two rows are the same. Similarly, w · (v × w) = 0.
Note that either v × w or w × v is orthogonal to v and w, but they point in the opposite direction, and thus v × w = -(w × v).
Examples
(1) Show v × v = 0 by vec;(a*i+b*j+c*k)**(a*i+b*j+c*k) ||, which is 0.
(2) If u = v × w, then
u is orthogonal to both v and w by vec;((a*i+b*j+c*k)**(r*i+s*j+t*k))*(a*i+b*j+c*k) || vec;((a*i+b*j+c*k)**(r*i+s*j+t*k))*(r*i+s*j+t*k) ||. Both are 0.
(3) Show u × v = -v × u by vec;(a*i+b*j+c*k)**(r*i+s*j+t*k)+(r*i+s*j+t*k)**(a*i+b*j+c*k) ||, which is 0.
(4) Show u × (v + w) = u × v + u × w by vec;u**(v+w)-u**v-u**w;u;a*i+b*j+c*k;
v;r*i+s*j+t*k;w;f*i+g*j+h*k ||.
Geometric interpretation of cross product The magnitude of the cross product ||v × w|| = ||v|| ||w||sin(θ) represents the area of the parallelogram spanned by v and w (as adjacent sides). This is arrived by the cross product identity:
||v × w||² = ||v||²||w||² - ( v · w)² = ||v||²||w||² - ||v||²||w||²cos²(θ) = ||v||²||w||²sin²(θ) for 0 ≤ θ ≤ π.
Use "vec;uexpr**vexpr" to calculate cross product of the two vectors u and v, and use "vec;lnt(uexpr**vexpr)" to calculate the area by the two vectors.
Example Find the area spanned by 〈2, -3〉 and 〈5, 1〉. The area of the parallelogram spanned by these two vectors is 17 by vec;lnt((2*i-3*j)**(5*i+j)) ||. It is the magnitude of the vector cross product || (2i - 3j) × (5i + j) ||.
Triple scalar product The product (u × v)·w is called the triple scalar product (or vector triple product, or box product) of u, v, and w. The geometric interpretation of |(u × v)·w| is the volume of the parallelepiped determined by u, v, and w, which is the base area × height = ||u × v||·(w·n). Notice that the height w·n is the component of w along the unit vector n = u × v\(/\)||u × v||. Triple scalar product always results in a number rather than a vector.
The triple scale product (u × v)·w in this order can be calculated by the determinant of the matrix formed by rows of the components of each vector in that order. Thus, u·(v × w) = (u × v)·w, because the matrix is formed by the same components and in the same order. That is,
u·(v × w) = (u × v)·w = \(\begin{vmatrix} u_1&u_2&u_3 \\v_1&v_2&v_3\\w_1&w_2&w_3 \end{vmatrix}\).
Given dot product is commutative, u·(v × w) = (u × v)·w = (v × w)·u = w·(u × v). Similarly, (v × w)· u = v·(w × u) = w·(u × v) = (w × u)·v. Therefore, in the triple scalar product the dot and cross can be interchanged without altering its value.
Examples Show the above commutative identities of triple scalar product by vec;((a*i+b*j+c*k)**(r*i+s*j+t*k))*(f*i+g*j+h*k)-((r*i+s*j+t*k)**(f*i+g*j+h*k))*(a*i+b*j+c*k) ||. Or vec;u*(v**w)-(u**v)*w;u;a*i+b*j+c*k;v;r*i+s*j+t*k; w;f*i+g*j+h*k ||, which is 0.
Examples
(1) Find the triple scale product of u = 〈1, 0, -3〉, v = 〈4, -5, 6〉, w = 〈-1,2, 2〉. It is -31. Check vec;(i-3*k)*((4*i-5*j+6*k)**(-i+2*j+2*k)) || vec;((i-3*k)**(4*i-5*j+6*k))*(-i+2*j+2*k) || vec;((-i+2*j+2*k)**(i-3*k))*(4*i-5*j+6*k) ||.
(2) Find the volume of the parallelepiped with the three vectors u , v , and w as its adjacent edges. The magnitude of the triple scalar product ||u·(v × w)|| is the volume, and it is |-31| = 31.
(3) Find the volume of the parallelepiped whose edges are OA, OB, OC, where points O = (0, 0, 0), A = (2, 1, 5), B = (3, 2, 4), C = (3, 5, 6). Vectors OA = 2i + j + 5k, OB = 3i + 2j + 4k, and OC = 3i + 5j + 6k. The volume is ||OA · (OB × OC)|| by vec;(2*i+j+5*k)*((3*i+2*j+4*k)**(3*i+5*j+6*k)) ||, which is 23.
The projection of vectors u along v is calculated by uprj = \(\frac{\bf u· v}{||\bf v||}\frac{\bf v}{||\bf v||}\). Use "vec; prj(uexpr, vexpr)" to compute the projection of vector u onto v. Keep in mind that the order of u and v matters in the projection operation. For the projection of v onto u, use "vec; prj(vexpr, uexpr)". All vectors involved in the projection operation are in \(R^2\) or \(R^3\). Refer to the section Linear Algebra for orthogonal projection in \(R^n\) and \(C^n\).
Example The code vec;prj(10*i+2*j-6*k,2*i+2*j+k) || finds the projection of vectors u = 10i + 2j - 6k onto v = 2i + 2j + k which is 〈4, 4, 2〉.
Orthogonal decomposition The vector u can be uniquely written as the sum of its projection onto v (nonzero vectors), denoted by uprj, and a vector that is orthogonal to v, denoted by uoth, or u = uprj + uoth, where uoth = u - uprj.
Attention Use "vec; u - prj(u, v)" to obtain uoth.
Examples Let u = 〈2, 1, -3〉 and v = 〈1, 1, -1〉. Then the projection by vec;prj(2*i+j-3*k,i+j-k) || gives uprj = 〈2, 2, -2〉. Thus, u = 〈2, 2, -2〉 + 〈0, -1, -1〉, where uoth = 〈0, -1, -1〉 is orthogonal to v. Their dot product is 0. Check vec;(-j-k)*(i+j-k) || vec;2*i+j-3*k-prj(2*i+j-3*k,i+j-k) ||.
Angle between two vectors The dot product is u·v = ||u||||v||\(\cos\theta\), where \(0≤\theta ≤π\) is the angle between u and v. If \(\cos θ = k,θ=\cos^{-1}(k)\).
Use "vec;(u*v)/(lnt(u)*lnt(v))" to calculates the cos(θ), where 0 ≤ θ ≤ π is the angle between the two vectors u and v. Then use the value k = cos(θ) to calculate the angle θ = acos(k). Or use "vec;ang(u,v);u;uexpr;v;vexpr" to directly get the angle θ.
Example vec;(10*i+2*j-6*k)*(2*i+2*j+k)/(lnt(10*i+2*j-6*k)*lnt(2*i+2*j+k)) || finds the cos(θ) = 0.5071, where θ is the angle between vectors u = 10i + 2j - 6k onto v = 2i + 2j + k. The angle is θ = cos-1(0.5071) ≈ 1.039 rad by acos(0.5071) ||, or θ ≈ 59.53° by 1.039*180/3.141593 ||. Use vec;ang(10*i+2*j-6*k,2*i+2*j+k) ||.
Example vec;ang(3*i-2*j+5*k,-i+4*k) || vec;(3*i-2*j+5*k)*(-i+4*k)/(lnt(3*i-2*j+5*k)*lnt(-i+4*k)) || give cos(θ) = 0.668856 ⇒ θ ≈ 0.8381 radians.
Example
(1) If two vectors are parallel, the angle θ = 0, and cos(θ) = 1. Check vec;(i+2*j+3*k)*(2*i+4*j+6*k)/(lnt(i+2*j+3*k)*lnt(2*i+4*j+6*k)) ||
(2) If two vectors are orthogonal, the angle θ = π/2; and cos(θ) = 0. Check vec;(2*i+3*j)*(3*i-2*j)/(lnt(2*i+3*j)*lnt(3*i-2*j)) || vec;acos((2*i+3*j)*(3*i-2*j)/(lnt(2*i+3*j)*lnt(3*i-2*j))) ||.
Angle between two planes The angle between two planes is just the angle between their normal vectors.
Example The angle between planes x - 2y + z = 4 and 3x - 5y + 4z = 8 by vec;acos((i-2*j+k)*(3*i-5*j+4*k)/(lnt(i-2*j+k)*lnt(3*i-5*j+4*k))) ||.
To perform more complicated operations among vector-valued functions, you need to separate vector operations and vector expressions.
Use "vec; expr; u; uexpr; v; vexpr; w; wexpr; ..." to perform operations among vector-valued functions. Notice that "expr" is a function such as f(u, v, w) with independent variables u, v, w defined subsequently by "u; uexpr; v; vexpr; w; wexpr", which means "u=uexpr; v=vexpr; w=wexpr". Note that "u,v,w" are vector names, but "uexpr", "vexpr", "wexpr" are vectors expressed as a linear combination of the standard basis vectors i, j, k.
Be sure that the vector names "u, v, w" (or any other names) must exclude the standard basis vector names "i, j, k" to avoid unnecessary confusion, and the vector operation f(u, v, w) cannot have any other variables. That is, do not use "i, j, k" for vector names or variables because they are reserved for the standard basis vectors.
Examples Find u·(2v + 3u), where u = sin(x)i + cos(x)k and v = x2i - xj by vec;u*(2*v+3*u);u;sin(x)*i+cos(x)*k;v;x**2*i-x*j ||. Each vector in the operation is a vector-valued function, and is expressed as a linear combination of the standard basis vectors i, j, k.
Examples vec;u;u;cos(x)*i+sin(x)*j || vec;u**v;u;i+j;v;i-j || vec;u*v;u;x**(1/3)*j;v;x**(-1/3)*j || vec;(2*u)*(3*v);u;log(x)*i +x**(-1/2)*j;v;2**x*j+x**(-2)*k || vec;(2*u)*(3*v),u,log(x)*i +x**(-1/2)*j,v,2**x*j+x**(-2)*k ||.
2 Vector Parametrizations
Vector Parametrizations and Parametric Equations of Lines in Space
point-direction form In the plane, the linear equation ax + by + c = 0 represents a line. But in space, the equation represents a plane. A vector parametrization of a line in R3 through a point \((x_0, y_0, z_0)\) in the direction of v = 〈\(a, b, c\)〉 is r\((t) = 〈x_0, y_0, z_0 〉+t〈a, b, c〉\) (point-direction form ) for \(-\infty < t < \infty\). Just as parametric equations, a vector parametrization of a space line is not unique.
Also write the vector parametrization as parametric equations \(x=x_0+at,y=y_0+bt,z=z_0+ct\), or write it as a rectangular equation system \(\frac{x-x_0}{a}=\frac{y-y_0}{b}=\frac{z-z_0}{c}\). These three approaches describe the same line.
Examples Use the "vec" module to simplify a vector parametrization of the line through the point (1, 0, -2) in the direction of v = 2i - 3j + 4k by vec;(i-2*k)+t*(2*i-3*j+4*k) || for all t. The parametric equations are x = 1 + 2t, y = -3t, and z = 4t-2, and graph the line by pc3;1+2*t;-3*t;-2+4*t ||.
Two-point form If a line passes through two points \(P(x_0, y_0, z_0)\) and \(Q(x_1, y_1, z_1)\) in the space, then a direction vector of the line is v = 〈\(x_1-x_0,y_1-y_0,z_1-z_0\)〉. Substituting a point and direction in the point-direction form, we get a vector parametrization for the line r\((t) = (1-t)〈x_0, y_0, z_0 〉+t〈x_1, y_1, z_1〉\) for all \(t\). In particular, the vector parametrization for the line segment \(PQ\) has the same form, but for \(0≤t≤1\).
Examples
(1) A vector parametrization of a line through the points (a, b, c) to (m, n, h) can be obtained by the codes vec;(1-t)*(a*i+b*j+c*k)+t*(m*i+n*j+h*k) ||.
(2) A vector parametrization of a line passes through (1, 2, 3) and (-1, 0, -2) by vec;(1-t)*(i+2*j+3*k)+t*(-i-2*k) ||, and graphed by pc3;1-2*t;2-2*t;3-5*t ||.
(3) A parametrization of the line segment through (1, -3) and (-2, 0) by vec;(1-t)*(i-3*j)+t*(-2*i) ||, and graphed by pc2;1-3*t;-3+3*t;itv=(-2,1) ||.
Vector Parametrizations and Parametric Equations of Planes in Space
Point-normal form equations The equation ax + by + cz = d represents a plane in space, where ⟨a, b, c⟩ is the normal vector of the plane. If a plane passing through a point \((x_0, y_0, z_0)\) and one of its normal vector is n = 〈\(a, b, c\)〉, then an equation (in point-normal form) of the plane can be obtained by 〈\(a, b, c\)〉 · 〈\(x, y, z\)〉 = 〈\(a, b, c\)〉·〈\(x_0, y_0, z_0\)〉.
Simplify the point-normal equation of a plane with a normal vector 〈a, b, c〉 and through point (m, n, p) by "vec;(a*i+b*j+c*k)*((x-m)*i+(y-n)*j+(z-p)*k)". Can graph the resulting plane equation by the "sf3" module.
Examples Find the equation 2x - y + 5z - 46 = 0 of the plane through the point (3, -5, 7) with a normal vector n = 〈2, -1, 5〉 by vec;(2*i-j+5*k)*(x*i+y*j+z*k)-(2*i-j+5*k)*(3*i-5*j+7*k). Graph the plane by sf3;(46-2*x+y)/5 ||.
Example A particle moves from P(2, 3, -15) at t = 0 to Q(1, 4, 2). Check if P and Q are on the same side of the plane 2x - 3y - z = 5. Substitute the coordinates of P and Q into the plane equation, d = 10 for P and -13 for Q, so P and Q are on the opposite of the plane. To find when PQ intersect the plane, parametrize the line through PQ by x = 2 - t, y = 3 + t, z = -15 + 17t, substitute the line equation into the plane equaiton and solve for t = 5/24.
Three-point form equations If a plane passes through three points P, Q, R that are not on the same line, the normal vector can be determined by the vector cross product PQ × PR. Substituting the resulting vector in the point-normal form, you can find the plane equation, and graph it by "sf3" module.
Examples Find the equation of a plane through points P(-1, 6, 3), Q(2, 1, 4) and R(3, -1, 5). The vectors PQ = 3i - 5j + k and PR = 4i -7j +2k. The normal vector is PQ × PR by vec;(3*i-5*j+k)**(4*i-7*j+2*k) ||, which is 〈-3, -2, -1〉. Thus, the plane equation is by vec;(-3*i-2*j-k)*((x+1)*i+(y-6)*j+(z-3)*k) ||, or z = 12 - 3x - 2y. Graph it by sf3;12-3*x-2*y ||.
Point-line form plane equations If a plane passes a point P and a line \(x=x_0+at,y=y_0+bt,z=z_0+ct\), pick a point Q(\(x_0,y_0,z_0)\) for \(t=0\) on the line to form vector QP, and the normal vector of the sought plane is QP × v, where v = 〈\(a,b,c\)〉 is the direction vector of the line. Using the point-normal form, you can get the plane equation.
Examples If a plane passes through a point P(2, 4, -3) and a line x = 1 - 2t, y = 3t, z = -4 + 7t, then Q = (1, 0, -4), vector QP = 〈1, 4, 1〉, v = 〈-2, 3, 7〉, and the normal vector is QP × v by vec;(i+4*j+k)**(-2*i+3*j+7*k) ||. It is 〈25, -9, 11〉. So the plane equation is by vec;(25*i-9*j+11*k)*((x-2)*i+(y-4)*j+(z+3)*k) ||. Graph it by sf3;(9*y-25*x-19)/11 ||.
In particular, if a plane passes through a point and the line of intersection between two other planes, there is a shortcut to determine the equation of the sought plane.
Examples Find the plane through the point (2, 2, 1) and the intersection line between the planes 3x - 4y + 5z = 8 and x + 7y - 3z = 3. Let the equation of the sought plane be (x+7y-3z-3) + k(3x-4y+5z-8) = 0. Substitute the point in this equation and solve for k = 2 by slv;(16-6)-5*k;k ||. The equation of the plane is 7x - y + 7z = 19.
Relations of Points, Lines and Planes in Space
Distance between points and lines in space The distance between two points can be calculated directly using their coordinates. The distance of a point P to a line L is given by \(\frac{||QP × {\bf v}||}{||\bf v||}\), where Q is a point on L and v is the direction of L. The distance can be regarded as the height of a parallelogram span by vector \(QP\) and v, which is its area divided by its base length.
Examples Find the distance of P(2, -2, 3) to line x = 4 - 2t, y = -1 + 5t, z = 6t. Pick a point Q = (4, -1, 0) on the line. v = 〈-2, 5, 6〉, QP = 〈2, 1, -3〉, the length of the cross product is by vec;lnt((2*i+j-3*k)^(-2*i+5*j+6*k)) ||, and the length of v can be got by vec;lnt(-2*i+5*j +6*k) ||. Thus, the distance is vec;lnt((2*i+j-3*k)^(-2*i+5*j+6*k))/lnt(-2*i+5*j +6*k), which is about 3.091.
Distance between points and planes in space The distance of a point P to a plane ax + by + cz + d = 0 is given by \(\frac{|PQ·{\bf n}|}{||\bf n||}\), the length of the projection of the vector QP on the normal vector n = 〈a, b, c〉, where Q is a point on the plane.
Examples To find the distance between P(4, -5, 9) and the plane 2x - 4y + 3z = 8, the normal vector is n = 〈2, -4, 3〉 and Q = (0, 1, 4) is a point on the plane. So PQ = 〈4, -6, 5〉, and the distance is by vec;(4*i-6*j+5*k)*(2*i-4*j+3*k)/lnt(2*i-4*j+3*k) ||, which is 47/\(\sqrt{29}\).
Distance between two lines in space The distance between two nonparallel and non-intersecting lines can be found in a similar way. Let L1: \(x = x_0 + at, y = y_0 + bt, z = z_0 + ct\) and L2: \(x = x_1 + At, y = y_1 + Bt, z = z_1 + Ct\) be two nonparallel and non-intersecting. Then the normal vector n = u × v, where u = 〈a, b, c〉, v = 〈A, B, C〉. Pick a point \(P(x_0, y_0, z_0)\) on L1, \(Q(x_1, y_1, z_1)\) on L2, and the vector \(PQ = 〈x_1-x_0, y_1-y_0, z_1-z_0〉\). So the distance between L1 and L2 is \(\frac{|PQ·{\bf n}|}{||\bf n||}\).
Examples If L1: x = 1 + 2t, 3 - t, -4 + 2t and L2: x = -2t, y = 7 - 3t, z = 5 - 2t. Then PQ = 〈1, -4, -9〉, u = 〈2, -1, 2〉 and v = 〈-2, -3, -2〉. So the distance can be found by vec;((i-4*j-9*k)*((2*i-j+2*k)^(-2*i-3*j-2*k)))/lnt((2*i-j+2*k)^(-2*i-3*j-2*k)) || vec;w*(u**v)/lnt(u**v);u;2*i-j+2*k;v;-2*i-3*j-2*k;w;i-4*j-9*k ||, which is \(5\sqrt{2}\).
Distance between two parallel planes in space The distance between two parallel planes \(ax+by+cz=d\) and \(ax+by+cz=k\) is \(\frac{|d-k|}{\sqrt{a^2+b^2+c^2}}\).
Examples The distance between planes 7x + 2y - 6z = 25 and 7x + 2y - 6z = 14 by (25-14)/(7**2+2**2+6**2)**(1/2) ||.
Distance between parallel lines and planes in space If a line \(L\) and a plane \(\mathcal{P}\) are parallel, the distance between \(L\) and \(\mathcal{P}\) can be found by first picking a point \(P\) on \(L\) and a point \(Q\) on \(\mathcal{P}\), and then calculating \(\frac{|PQ·{\bf n}|}{||\bf n||}\), the length of the projection of \(PQ\) on n, where n is the normal vector of \(\mathcal{P}\).
Examples Given the line L: x = -6 + 4t, y = 3 + t, z = 5 + 2t and plane P: x + 2y - 3z = 4, they are parallel. Choose a point M = (-6, 3, 5) on L and Q = (4, 0, 0) on P, so MQ = 〈10, -3, -5〉. Since n = 〈1, 2, -3〉, the distance can be obtained by vec;(10*i-3*j-5*k)*(i+2*j-3*k)/lnt(i+2*j-3*k) ||, which is 19/\(\sqrt{14}\).
Intersection between two lines in space To find the point of intersection of two lines, match their parametric equations, solve the equation system for parameters t and s, and then substitute the values of t and s in the third equation to see if they are compatible. If not, then the two lines do not intersect.
Examples Let line L be x = 1+2t, y = -1+3t, z = 9-5t and line M be x = 2-s, y = -3+2s, z = 6+3s. Use eqs;1+2*t-(2-s);-1+3*t-(-3+2*s) || for solving s = 1, t = 0. Substitute these values in L and M for z = 9. So the point of intersection is (1, -1, 9).
Intersection between lines and planes To find the point of intersection between a line and a plane, substitute the parametric equations for the line in the plane equation, you have a simple linear equation of t. Solve for the parameter t, substitute it back to the parametric equations, and then find the coordinates of the point of intersection.
Examples Find the intersection point of a line x = 1 - 2t, y = 3t, z = 4 + 7t and a plane 2x - 3y + 5z = 4. Substitute x, y, z in the plane equation, and solve the equation by slv;2*(1-2*t)-3*(3*t)+5*(4+7*t)-4;t || for t = -9/11. So the point of intersection is (29/11, -27/11, -19/11).
Lines of intersection between planes If two planes intersect a line, then the line is perpendicular to the normal vectors of both planes. This means the intersection line is parallel to the cross product of the two planes' normal vectors. Choosing a point on the line, you can write the equation of the line in a point-direction form.
Examples Given planes 3x - 4y + z = 11 and x - 3y + 5z = 7, n1 = 〈3, -4, 1〉, n2 = 〈1, -3, 5〉. So v = n1 × n1 is the direction of the line of intersection, and can be got by vec;(3*i-4*j+k)**(i-3*j+5*k) ||, which is 〈-17, -14, -5〉. To choose a common point, let z = 0 and use eqs;3*x-4*y-11;x-3*y-7 || to get x = 1, y = -2. So the point (1, -2, 0) is on the line. Finally, the parametric equations for the line of intersection are x = 1-17t, y = -2-14t, z = -5t.
3 Vector-Valued Function Calculus
The functions in form of r(t) = x(t)i + y(t)j + z(t)k are called vector-valued functions of one variable t, where the components x(t), y(t) and z(t) are scalar-valued functions. They are often used to analyze curves and motion in R3 by viewing r(t) as the path traced out by a particle at time t. So r(t) is a vector parametrization of the path, where x(t), y(t) and z(t) indicate the coordinates or positions of the particle at time t.
Examples vec;2*i+3*j-4*k || vec;x*i-y*j+z*k || vec;t*i+t**2*j-t**(1/2)*k || vec;(t*i-k+2*t*k)**(t**2*i-3*j+t*k) || vec;(x-y)*i+z**2*j-3*k ||.
Examples For complicated operations of vector functions, write the operation expression as f(u, v, w) in the "vec" module, and define each vector subsequently by "u;uexpr;v;vexpr;w;wexpr". || vec;u*v;u;sin(t)*i+cos(t)*j+t*k;v;sin(t)*i+cos(t)*j+k || vec;2*u**(3*v-w);u;cos(x)*i-sin(y)*j;v;cos(x)*i+sin(y)*j;w;x*i-y*j+z*k ||. Be sure that each vector must be a linear combination of the standard basis vectors i, j, k.
Projection of a vector field onto a plane The projection of r(t) = x(t)i + y(t)j + z(t)k onto a different coordinate plane (yz-, xz- and xy-plane) can be found by setting x(t) = 0, or y(t) = 0, or z(t) = 0. So x(t)i + y(t)j is the projection of r(t) onto the xy-plane; x(t)i + z(t)k is the projection of r(t) onto the xz-plane; y(t)j + z(t)k is the projection of r(t) onto the yz-plane.
Examples vec;prj(cos(t)*i+sin(t)*j+t*k,cos(t)*i+sin(t)*j) || vec;prj(t*sin(t)**2*i+t*cos(t)**2*j+t*k,t*cos(t)**2*j+t*k) || vec;prj(t*i+t**2*j+exp(t)*k,t*i+exp(t)*k) ||.
Limits of vector functions Using the "lim" module, you can find the limit of a vector function, which is computed componentwise as \(\lim\limits_{t\to c}{\bf r}(t)=〈\lim\limits_{t\to c}x(t),\lim\limits_{t\to c}y(t),\lim\limits_{t\to c}z(t)〉\).
Attention Use the combination "vec;lim(vexpr)" to find the limit of each component.
Examples vec;lim((x*i+(x**2-1/x)*j+(2-x)*k),x,1) || vec;lim((u,u,cos(x)*i+sin(2*x)*j+log(x)*k),x,pi) ||.
Integrals of vector functions Use the "int" module one at a time to find the integral of a vector function, computed componentwise as \(\int {\bf r}(t)dt=〈\int x(t)dt,\int y(t)dt,\int z(t)dt〉\) or \(\int_a^br(t)dt=〈\int_a^bx(t)dt,\int_a^by(t)dt,\int_a^bz(t)dt〉\).
Attention Use the combination "vec;itg((vexpr))" to find the integral of each component.
Examples
(1) vec;itg((2*x*i+(x-3)*j+(x-x**2)*k),x,0,1) || vec;itg(cos(x)*i+sin(2*x)*j,x,0,pi/2) ||.
(2)
Find the integral \(∫_1^4〈t^{-2},\sqrt{t},-t^2〉dt\) by itg;i/t**2+t**(1/2)*j-t**2*k;t;1;4 ||.
(3) If r'(t) =
〈t², 1 + t, 2t - 3〉 and r(0) = 〈1, 2, -1〉, find r(t). The integral itg;t**2*i+(1+t)*j+(2*t-3)*k;t || gives r(t) + c. Substituting the result in the equation, you get c = 〈1, 2, -1〉. So r(t) = 〈t³/3 + 1, 3t/2 + 2, -2t - 1〉.
(4) If r'(t) = 〈t, -t, 5〉 and r(1) = 〈2t, 1+t, t〉, find r(t). First find vec;itg(t*i-t*j+5*k,t) || and c by vec;2*t*i-(1+t)*j+t*k-itg(t*i-t*j+5*k,t) ||, which is 〈3/2, -3/2, -4〉. So r(t) = 〈(t² + 3)/2, -(t² + 3)/2, 5t-4〉.
(5) If r''(t) = 〈1, -2, 1〉, r'(2) = 〈0, 1, 2〉 and r(2) = 〈2, 0, -1〉, find r(t). For r'(t), itg(i-2*j+k,t)+u ||. Substitute r'(2) for u = -2i + 5j. For r(t), vec;2*i-k-itg(itg(i-2*j+k,t)-2*i+5*j,t) ||, and substitute t = 2 for c = 4i - 6j - 3k. So r(t) = 〈t²/2 - 2t + 4, -t² + 5t - 6, t²/2 - 3〉 by vec;itg(itg(i-2*j+k,t)-2*i+5*j,t)+4*i-6*j-3*k ||.
Use "vec;tnv(x(t)i + y(t)j + z(t)k, t)" to find the derivatives of a vector function, computed componentwise as \(\frac{d}{dt}{\bf r}(t)={\bf r}'(t)= 〈x'(t),y'(t),z'(t)〉\). It is also called the tangent vector of r(t). If r(t) is a trajectory taced by a moving particle, r'(t) = v(t).
Example Cycolid r(t) = ⟨bt - bsin(t), b - bcos(t)⟩, find v'(t) by "vec;tnv(v,t);v;(b*t-b*sin(t))*i+(b-b*cos(t))*j", the speed ||v(t)|| = \(\frac{ds}{dt}\) by "vec;lnt(tnv(v,t));v;(b*t-b*sin(t))*i+(b-b*cos(t))*j", and the unit tangent vector T = \(\frac{\bf v}{||\bf v||}\) by "vec;tnv(v,t)/lnt(tnv(v,t));v;(b*t-b*sin(t))*i+(b-b*cos(t))*j". Note that \({\bf v}(t)=\frac{d\bf r}{dt}=\frac{d\bf r}{ds}\frac{ds}{dt}={\bf T}||{\bf v}(t)||\).
The code pattern "vec;tnv(x(t)*i + y(t)*j + z(t)*k, t)" calculates the tangent vector, where "x(t)i + y(t)j + z(t)k" represents a vector-valued function. Also use "dif; x(t)i + y(t)j + z(t)k; t; n" to find the nth derivative of r(t).
Attention "dif(x(t)*i + y(t)*j + z(t)*k, t)" returns the first derivative of x(t)*i + y(t)*j + z(t)*k, whose result is not a vector even though it is written as a linear combination of i, j, k. The code "vec;tnv(x(t)*i + y(t)*j + z(t)*k, t)" returns a tangent vector, which can be combined with other vector operations.
Examples
(1) The tangent vector of r(t) = cos(t)i + sin(t)j + tsin(2t)k can be obtained by vec;tnv(cos(t)*i+sin(t)*j+t*sin(2*t)*k,t) ||, and a vector parametrization of the tangent line at t = π/4 can be calculated by r(π/4) + tr'(π/4) by
vec;u+v;u;2**(1/2)*i+2**(1/2)*j+(pi/4)*k;v;t*(-2**(1/2)*i+2**(1/2)*j+k) ||. Check dif(cos(t)*i+sin(t)*j+t*sin(2*t)*k,t) ||.
(2) The tangent vector of 〈t, t2, t3〉 can be got by vec;tnv(t*i+t**2*j+t**3*k,t) ||, and a vector parametrization of the tangent line at t = 2 can be calculated by r(2) + tr'(2) by vec;u+v;u;2*i+4*j+8*k;v;t*(i+4*j+12*k) ||.
(3) The tangent vector of 〈t2-t; t2; t2+t〉 at the point (0, 1, 2) can be got by vec;tnv((t**2-t)*i+t**2*j+(t**2+t)*k,t) ||, and a parametrization for the tangent line by vec;u+v;u;j+2*k;v;t*(i+2*j+3*k) ||.
(4). Let r(t) = 〈t³, tsin(2t), log(3t)〉. Then find r'(t) by dif;t^3*i+t*sin(2*t)*j+log(3*t)*k;t ||, r''(t) by dif;t^3*i+t*sin(2*t)*j+ log(3*t)*k;t;2 ||, and r''(3) dif;t^3*i+t*sin(2*t)*j+log(3*t)*k;t;3;rt;3 ||.
Examples Let r1(t) = ti + t²j + t³k, r2(t) = sin(t)i + sin(t²)j + sin(t³)k.
(1) If r(t) = r1(t) · r2(t), find r'(t) by vec;dif((t*i+t**2*j+t**3*k)*(sin(t)*i+sin(t**2)*j+sin(t**3)*k),t) ||, and r''(t) by vec;dif((t*i+t**2*j+t**3*k)*(sin(t)*i+sin(t**2)*j+sin(t**3)*k),t,2) ||.
(2) If s(t) = r1(t) × r2(t), find s'(t) by vec;dif((t*i+t**2*j+t**3*k)**(sin(t)*i+sin(t**2)*j+sin(t**3)*k),t) ||.
(3) If g(t) = exp(t), find r1(g(t)) by dif;exp(t)*i+exp(2*t)*j+exp(3*t)*k;t ||.
Example Find a parametrization of the tangent line to r(t) = 〈1 - t², t + 1, 2t³〉 at t = 1. First get the tangent vector r'(1) by dif;(1-t**2)*i+(t+1)*j+2*t**3*k;t;1;rt;1 ||, and then the tangent line is r(1) + tr'(1) by vec;u+v;u;2*j+2*k;v;t*(-2*i+j+6*k) ||, which is 〈0, 2, 2〉 + t〈-2, 1, 6〉. Or x = -2t, y = 2 + t, z = 2 + 6t.
Higher order derivatives of vector functions: [dif(x(t)*i + y(t)*j + z(t)*k, t, n)]
To find the second and third derivative r''(t) and r'''(t), you need to repeat the process twice or three times by the "tnv" module. Use "dif(x(t)i + y(t)j + z(t)k, t, n)" to directly get the nth derivative of a vector-valued function r(t) = x(t)i + y(t)j + z(t)k. To evaluate the tangent vector at t = c, use "dif(x(t)*i + y(t)*j + z(t)*k, t,1,rt,c)".
Examples Given r(t) = ln(t)i + tj + k/t, vec;tnv(log(t)*i+t*j+k/t,t) || returns the first derivative r'(t), then vec;tnv(i/t+j-k/t**2,t) || gets the second r''(t), and vec;tnv(-i/t**2+2*k/t**3,t) || yields the third r'''(t). Use dif(i/t+j-k/t**2,t) || dif(i/t+j-k/t**2,t,2) || dif(i/t+j-k/t**2,t,3) ||.
Examples Let r(t) = ti - t²j + t³k Show Dt(r × r') = r × r'' by vec;dif((t*i-t**2*j+t**3*k)**(tnv(t*i-t**2*j+t**3*k,t)),t) || vec;u**v;u;t*i-t**2*j+t**3*k;v;dif(t*i-t**2*j+t**3*k,t,2) ||. The two resulting vectors are equivalent.
Tangent vectors, normal vectors, binormal vectorsNormalizing a tangent vector r'(t), we get a unit tangent vector denoted by T(t) = r'(t)\(/\)||r'(t)||. Similarly, the unit normal vector is calculated by N(t) = T'(t)\(/\)||T'(t)||, assuming the curve r(t) is smooth and ||r'(t)|| ≠ 0, which implies the tangent vector cannot be a zero vector. The binormal vector B(t) is orthogonal to both T(t) and N(t), and thus B(t) = T(t) × N(t).
Examples Find T(t), N(t), and B(t) for r(t) = ti + cos(t)j + sin(t)k. First, obtain r'(t) and ||r'(t)|| for T(t) by vec;tnv(t*i+cos(t)*j+sin(t)*k,t) || vec;u/lnt(u);u;i-sin(t)*j+cos(t)*k || vec;u;u;i/2**(1/2)-sin(t)*j/2**(1/2)+cos(t)*k/2**(1/2) ||. Second, get T'(t) and ||T'(t)|| for N(t) by vec;tnv(i/2**(1/2)-sin(t)*j/2**(1/2)+cos(t)*k/2**(1/2),t) || vec;u/lnt(u);u;-sin(t)*j/2^(1/2)-cos(t)*k/2^(1/2) ||. Third, calculate the cross product of T(t) × N(t) for B(t) by vec;t**n;t;i/2**(1/2)-sin(t)*j/2**(1/2)+cos(t)*k/2**(1/2);n;-cos(t)*j-sin(t)*k ||.
Examples Find T for r(t) = 〈t, t2, t3〉 and t = 1 by vec;tnv(t*i+t**2*j+t**3*k,t) || vec;u/lnt(u);u;i+2*t*j+3*t^2*k ||. Substitute t = 1 into the resulting vector to obtain T = \(\frac{1}{\sqrt{14}}\)⟨1, 2, 3⟩.
The three unit vectors are mutually orthogonal to each other in space forming a set (T, N, B) called the Frenet frame, and they determine three planes. The plane spanned by T × N is called osculating plane that is normal to B, the plane by N × B is the normal (or curvature) plane normal to T, and the plane by T × B is normal to N and related to torsion. Note that to find an equation of a normal or osculating plane, it is not necessary to calculate the unit vectors T or B. It suffices to use r' for T and r' × r'' for B because they are parallel.
Examples Let r(t) = 〈cos(t), sin(t), t〉.
(1) Find the normal plane at t = π/4 by vec;tnv(cos(t)*i+sin(t)*j+t*k,t) || for T. Since T is normal to the plane spanned by N and B, the normal plane is by vec;(-i/2+j/2+2**(1/2)*k/2)*((x-2**(1/2)/2)*i+(y-2**(1/2)/2)*j+pi*k/4) ||.
(2) Find the osculating plane, first get B = T'/||T'|| by vec;tnv(-sin(t)*i+cos(t)*j+k,t) ||, which is
-cos(t)i - sin(t)j. The osculating plane is vec;(-2**(1/2)*i/2-2**(1/2)*j/2)*((x-2**(1/2)/2)*i+(y-2**(1/2)/2)*j+pi*k/4) ||.
Arc length and speed Assume r(t) is differentiable and r'(t) is continuous on [a, b]. Then the length of the curve r(t) is \(\int_a^b||{\bf r}'(t)||dt=\int_a^b\sqrt{x'(t)^2+y'(t)^2+z'(t)^2}dt\) for a ≤ t ≤ b, where || r'(t) ||dt is called arc length differential. If r(t) is the path traced out by a moving particle, then ||r'(t)|| is the speed at time t.
Examples
(1) Find the length and speed of a path parametrization r(t) = cos(t)i + tj + sin(t)k for 0 ≤ t ≤ π by vec;lnt(tnv(cos(t)*i+t*j+sin(t)*k,t)) ||, which is \(\sqrt{2}\), and the arc length by itg;2**(1/2);t;0;pi ||, which is \(\sqrt{2}\)π.
(2) Find an arc length parametrization for r(t) = 〈2t - 1, 3t, 4-5t〉. Get ||r'(t)|| by vec;lnt(tnv((2*t-1)*i+3*t*j+(4-5*t)*k,t)) ||, which is \(\sqrt{38}\). So \(s(t)=∫_0^t\sqrt{38}du=\sqrt{38}t\). To find the inverse of \(s(t), s=\sqrt{38}t⇒t=g(s)=\frac{s}{\sqrt{38}}\). So a parametrization r1(s) = r(g(s)) = 〈\(\frac{2s}{\sqrt{38}}-1,\frac{3s}{\sqrt{38}},4-\frac{5s}{\sqrt{38}}\)〉. Verify the unit of ||r'1(s)|| = 1 by vec;lnt(tnv((2*s/38**(1/2)-1)*i+3*s*j/38**(1/2)+(4-5*s/38**(1/2))*k,s)) ||, which is 1.
The curvature of r(t) measures how much a curve bends or how fast it changes directions at a given point. It can be calculated by κ(t) = ||T'(t)||\(/\)||r'(t)|| = ||r'(t) × r''(t)||\(/\)||r'(t)||3.
To find curvature, first get the tangent vector r'(t) of a given parametrization r(t), and then enter r'(t) into the module again for r''(t). Submitting these two results into the formula, you can calculate the curvature of r(t). Or use "dif(x(t)*i+y(t)*j+z(t)*k, t)" and "dif(x(t)*i+y(t)*j+z(t)*k,t,2)" to get the first and second derivatives and submit them into the curvature formula.
Examples
(1) Find the curvature of r(t) = ti - tj + exp(t)k. First get r'(t) by dif;t*i-t*j+exp(t)*k;t ||.
Then get r''(t) by dif;i-j+exp(t)*k;t;2 ||. Submitting these two vectors in the formula, vec;u**v;u;i-j+exp(t)*k;v;exp(t)*k || vec;lnt(u**v)/lnt(u)^3;u;i-j+exp(t)*k;v;exp(t)*k ||, which gives the curvature 2**(1/2)*exp(t)/(2+exp(2*t))**1.5 ||. If t = 0, the curvature is 2.0**(1/2)*exp(0)/(2+exp(2*0))**1.5 ||, which is about 0.27.
(2) Get the curvature of r(t) = 〈cos(t), sin(t), t2〉 by vec;tnv(cos(t)*i+sin(t)*j+t**2*k,t) || vec;tnv(-sin(t)*i+cos(t)*j+2*t*k,t) || vec;lnt(u**v)/lnt(u)^3;u;-sin(t)*i+cos(t)*j+2*t*k;v;-cos(t)*i-sin(t)*j-2*k ||, which gives \(\frac{\sqrt{5+4t^2}}{(1+4t^2)^{\frac{3}{2}}}\). If t = 1, the curvature is about 0.2683.
Examples
(1) In special situations, a straight line has 0 curvature because it does not bend or turn. Verify this fact with any
line such as vec;tnv((1+2*t)*i-t*j+(2+2*t)*k,t) ||. Then ||T'(t)|| = 0 by vec;tnv(2*i/3-j/3-2*k/3,t) ||.
(2) A function y = f(x) has curvature \(\frac{|f''(x)|}{[1+f'(x)]^{\frac{3}{2}}}\). Let r(t) = 〈x, f(x)〉. Then r'(t) = 〈1, f'(x)〉, and r''(t) = 〈0, f''(x)〉. Submitting these results in the formula, you get the desired result.
Examples The curvature of \(y = x^2\) is \(\frac{2}{(1+4x^2)^{\frac{3}{2}}}\) by vec;tnv(x*i+x**2*j,x) || vec;tnv(i+2*x*j,x) || vec;lnt(u**v)/lnt(u)^3;u;i+2*x*j;v;2*j ||, and k(0) = 2.
Tangential and normal components of acceleration: [ vec; prj(avec, vvec) ]Let r(t) be the position function of a moving object. Then the velocity v(t) = r'(t), speed v(t) = ||r'(t)||, and the acceleration vector, a(t) = r''(t) = aT·T + aN·N, where T and N are the unit tangent and unit normal vector of r(t). So a(t) lies in the plane spanned by T and N, and aT and aN are called tangential and normal component of acceleration.
Compute aT = a · T = \(\frac{\bf{a · v}}{||\bf{v}||}\), aN = a · N = \(\frac{||\bf{v × a}||}{||\bf{v}||}\). As a result, aT·T is the projection of a(t) along v(t), and the normal component aN·T = a - aT·T.
Examples Suppose r(t) = ti + t2j + t2k. Then v(t) = r'(t) = i + 2tj + 2tk by vec;tnv(t*i+t**2*j+t**2*k,t) ||, ||v(t)|| = \(\sqrt{1+8t^2}\), and a(t) = 2j + 2k by vec;tnv(i+2*t*j+2*t*k,t) ||, aT = \(\frac{8t}{\sqrt{1+8t^2}}\) by vec;a*v/lnt(v);a;2*j+2*k;v;(i+2*t*j+2*t*k) ||. Similarly, find aN by vec;lnt(a**v)/lnt(v);a;2*j+2*k;v;i+2*t*j+2*t*k ||, which gives aN = \(\frac{\sqrt{8}}{\sqrt{1+8t^2}}\). Get aTT by vec;prj(2*j+2*k,i+2*t*j+2*t*k) ||, which is \(\frac{8\rm{t}}{1+8\rm{t}^2}\)〈1; 2t; 2t〉. Thus, aN·T is the difference 2j + 2k - \(\frac{8\rm{t}}{1+8\rm{t}^2}\)〈1; 2t; 2t〉 by vec;2*j+2*k-prj(2*j+2*k,i+2*t*j+2*t*k) ||. Thus, verify a(t) = 2j + 2k = aTT + aNN = \(\frac{8t}{\sqrt{1+8t^2}}\)T + \(\frac{\sqrt{8}}{\sqrt{1+8t^2}}\)N.
Examples Let r(t) = 〈et, e-2t, t²〉. Find aT and aN at t = 0. First, v(t) and ||v|| by vec;tnv(exp(t)*i+exp(-2*t)*j+t**2*k,t) ||, and a(t) by dif;exp(t)*i+exp(-2*t)*j+t**2*k;t;2 ||. Substituting t = 0 in each result, you get v(0) = 〈1, -2, 0〉, ||v(0)|| = \(\sqrt{5}\), and a(0) = 〈1, 4, 2〉. So aT = -7/\(\sqrt{5}\) by vec;a*v/lnt(v);a;i+4*j+2*k;v;(i-2*j) ||, and aN = \(2\sqrt{70}/5\) by vec;lnt(v**a)/lnt(v);a;i+4*j+2*k;v;i-2*j ||. Find aT·T = 〈-7/5, 14/5, 0〉 by vec;prj(i+4*j+2*k,i-2*j) ||, aN·N = 〈4/3, 10/3, 8/3〉 by vec;i+4*j+2*k-prj(i+4*j+2*k,i-2*j+2*k) ||, and N = aN·N/aN = \(\frac{2}{3\sqrt{5}}\)〈2, 5, 4〉.
Examples Let r(t) = cos(t)i + sin(t)j + tk. Then v(t) is by vec;tnv(cos(t)*i+sin(t)*j+t*k,t) ||, a(t) is by vec;tnv(-sin(t)*i+cos(t)*j+k,t) ||, the tangential component aT = 0 is by vec;a*v/2**(1/2);a;-cos(t)*i-sin(t)*j;v;-sin(t)*i+cos(t)*j+k ||, which is 0, and the normal component aN = 1 is by vec;lnt(a**v)/lnt(v);a;-cos(t)*i-sin(t)*j;v;-sin(t)*i+cos(t)*j+k ||.
4 Vector Field
Vector fields are often seen in physics and engineering (gravitational, electric and electromagnetic fields, fluid flow, and heat conduction). A vector field is a vector-valued function that assigns each point a vector in R2 or R3.
Examples
(1) vec;u*v;u;x*i+cos(y)*j;v;sin(x)*i-y*k || produces the dot product of u = xi + cos(y)j and v = sin(x)i - yk.
(2) vec;u*(v**w);u;x*i;v;cos(y)*j-z*k;w;exp(y)*j || gives the triple scalar product of three fields u·(v × w), where u = xi, v = cos(y)j - zk, and w = eyj.
If a vector field F = 〈\(f(x,y,z),g(x,y,z),h(x,y,z)\)〉, the divergence of F is given by div(F) = \(\frac{∂f}{∂x}+\frac{∂g}{∂y}+\frac{∂h}{∂z}\), which results in a scalar field. Divergence is denoted as div(F) = ∇ · F.
In fluid flow and many other fields, the divergence of a field is interpreted as the net rate per unit volume (or area of a 2d field) per unit time that fluid mass leaves the vicinity of the point (x, y, z) (or (x, y)). If div(F) > 0, then (x, y, z) is called a source, div(F) is called source density, and there is a net outflow of fluid across any small closed surface containing the point. If div(F) < 0, (x, y, z) is called a sink, and if div(F) = 0, the field has no sources or sinks.
Use "vec; dvg(uexpr, x,y,z)" to find the divergence div(u) of a vector field u, where "uexpr" is a vector expression of the field u, "x; y; z" are the independent variables involved in the component functions of the field.
Examples
(1) The divergence of the inverse square field is 0 by vec;dvg(-(x*i+y*j+z*k)/(x**2+y**2+z**2)**(3/2),x,y,z) ||.
(2) The code vec;dvg(x*y*i+y*z*j+x*z*k,x,y,z) gives the divergence x + y + z of the field u = 〈xy, yz, xz〉 ||.
Examples Check the divergence of some basic and important fields (e.g., inverse square field) by vec;dvg(x*i+y*j,x,y) || vec;dvg(-y*i+x*j,x,y) || vec;dvg((x*i+y*j)/(x**2+y**2)**(1/2),x,y) || vec;dvg((-y*i+x*j)/(x**2+y**2)**(1/2),x,y) || vec;dvg(-(x*i+y*j)/(x**2+y**2)**(3/2),x,y) || vec;dvg(x*i+y*j+z*k,x,y,z) || vec;dvg((x*i+y*j+z*k)/(x**2+y**2+z**2)**(1/2),x,y,z) || vec;dvg(2*x**2*i+x*y*j+z**3*k,x,y,z) ||.
Curl: [ vec;cul(uvec, x,y,z) ]The curl of a vector field F is calculated by curl(F) = ∇ × F, which results in a vector. If F = 〈f(x, y, z), g(x, y, z), h(x, y, z)〉, curl(F) = \(\begin{bmatrix}{\bf i}&{\bf j}&{\bf k}\\ \frac{∂}{∂x}&\frac{∂}{∂y}&\frac{∂}{∂z}\\f& g&h \end{bmatrix}\) = \(〈\frac{∂h}{∂y}-\frac{∂g}{∂z},\frac{∂f}{∂z}-\frac{∂h}{∂x},\frac{∂g}{∂x}-\frac{∂f}{∂y}〉\). If F is a 2d vector field, then h = 0 and curl(F) = \(〈0, 0,\frac{∂g}{∂x}-\frac{∂f}{∂y}〉\). The curl of a vector field measures the rotation of the field about any point.
Conservative fields If curl(F) = 0, then the field F is called a conservative field, and it does not tend to rotate around any point. Every conservative field F = 〈f(x, y, z), g(x, y, z), h(x, y, z)〉 satisfies curl(F) = 0, or equivalently the cross partials satisfy the equations \(\frac{∂h}{∂y}=\frac{∂g}{∂z},\frac{∂f}{∂z}=\frac{∂h}{∂x},\frac{∂g}{∂x}=\frac{∂f}{∂y}\).
Attention The equality of cross partials does not guarantee that F is conservative. The domain D of F is assumed to be simply connected, which means that every loop in D can be contracted to a point while staying within D. Most vector fields are not conservative. A vector field is conservative if and only if it satisfies the cross-partial equations on a simply connected domain.
Use "vec;cul(uvec, x,y,z)" to calculate curl and verify some properties for vector fields, where "uexpr" is a valid vector expression of a field, and "x; y; z" (or any other variable names) are the independent variables involved in each component function of the field.
Examples
(1) The field F = 〈\(\frac{-y}{x^2+y^2},\frac{x}{x^2+y^2}\)〉 satisfies curl(F) = 0.
But the origin (0, 0) is not in the domain D of F, so D is not simply connected. Check vec;cul(-y*i/(x**2+y**2)+x*j/(x**2+y**2),x,y) ||.
However, F is conservative on a smaller domain not including (0, 0).
(2) The circulation of F over the unit circle C is \(\int_C\)F·\(d\)r ≠ 0 by lit;-y*i/(x**2+y**2)+x*j/(x**2+y**2);cos(t)*i+sin(t)*j;t;0;2*pi;x;y ||, which implies F is not conservative by the fundamental theorem of line integrals.
Examples vec;cul(x*i+y*j,x,y) || vec;cul(-y*i+x*j,x,y) || vec;cul((x*i+y*j)/(x**2+y**2)**(1/2),x,y) || vec;cul((-y*i+x*j)/(x**2+y**2)**(1/2),x,y) || vec;cul(y*i+z*j+x*k,x,y,z) || vec;cul(x*i+y*j+z*k,x,y,z) || vec;cul((x*i+y*j+z*k)**(x**2+y**2+z**2*k)**(1/2),x,y,z) || vec;cul(-(x*i+y*j+z*k)**(x**2+y**2+z**2*k)**(3/2),x,y,z) || vec;cul(sin(x)*i+cos(y)*j+tan(z)*k,x,y,z) || vec;cul(2*x*i-y*j+(x-3*z)*k,x,y,z) ||.
Gradient, conservative vector fields and potential functions: [vec; grd(f(x, y, z), x, y, z) ], [vec;csv(uexpr, x,y,z)]The gradient field F is obtained by a differentiable scalar field f(x, y) or f(x, y, z) such that F = ∇f = 〈fx, fy) or 〈fx, fy, fy〉. The operation ∇f results in a gradient vector.
If F = ∇f and F is conservative for some scalar field f that has continuous first partial derivatives, then f is called a potential function for F. Be aware that f is not unique, but they differ only by a constant.
Use "vec; grd(f(x, y, z), x, y, z)" to find a gradient field, where "f(x,y,z)" represents the potential function, and "x, y, z" are the variables involved in the function f(x, y, z).
Examples
(1) vec;grd(x*y,x,y) || yields the gradient field 〈y, x〉.
(2) vec;grd((x**2+y**2)**(1/2),x,y) || gives the 2d unit radial
field ur.
(3) vec;grd((x**2+y**2+z**2)**(1/2),x,y,z) || gives the 3d unit radial field ur.
(4)
vec;grd(1/(x**2+y**2)**(1/2),x,y,z) || vec;grd(1/(x**2+y**2+z**2)**(1/2),x,y,z) || get inverse square fields \(\frac{-{\bf r}}{||{\bf r}||^3}\) for r = 〈x, y〉,
r = 〈x, y, z〉. Or vec;grd(1/(x**2+y**2)**(1/2),x,y,z) || vec;grd(1/(x**2+y**2+z**2)**(1/2),x,y,z) ||.
Examples vec;grd(-(cos(x)**2+cos(y)**2)**2,x,y) || vec;grd(x**2-y**2,x,y) || vec;grd(log(x**2+y**2+z**2),x,y) || vec;grd(log(x**2+y**2+z**2)**(1/2),x,y) || vec;grd(sin(x-y),x,y) || vec;grd(log(x+y+z),x,y,z) || vec;grd(exp(x*y*z),x,y,z) || vec;grd(x*y+y*z+z*x,x,y,z) ||.
Examples
(1) vec;csv(y*i+x*j,x,y) || shows the vector yi + xj is conservative.
(2) vec;csv(y*i-x*j,x,y) || shows yi - xj is not
conservative.
(3) vec;csv(y*k,x,y) || vec;csv(x/(x**2+y**2)*0.5*i+y/(x**2+y**2)*0.5*j,x,y) ||.
Laplace operator and Laplacian field [vec;dvg(grd(f(x,y,z), x, y, z), x, y, z)]
If f has continuous second partial derivatives, then the Laplacian field is defined by Δf = ∇·∇f = fxx + fyy + fzz. The operation ∇·∇f results a scalar field.
Attention Use "vec;dvg(grd(f(x,y,z), x, y, z), x, y, z)" as Laplace operator. If f(x, y) = tan-1(y/x), Δf = 0 by vec;dvg(grd(atan(y/x),x,y),x,y) ||.
Examples Let f = cos(x) + sin(y). Then ∇f is by vec;grd(cos(x)+sin(y),x,y) ||, and the Laplacian field can be obtained by vec;dvg(-sin(x)*i+cos(y)*j,x,y) ||, which results in Δf = -sin(y) - cos(x). Or simply use vec;dvg(grd(cos(x)+sin(y),x,y),x,y) ||.
Gradient, divergence and curl Check some important properties such as
(1) curl(∇f) = ∇ × (∇f) = 0, the curl of a gradient vector is 0.
(2) div(curl(F) = ∇ · (∇ × F) = 0, the divergence of a curl vector is 0.
Attention Use "vec;cul(grd(f(x, y, z), x, y, z),x, y, z)" to verify the first property, and "vec;dvg(cuv(F, x, y, z), x, y, z)" to verify the second.
Examples
(1) Let F =〈xy, yz, xz〉. Then curl(F) by vec;cul(x*y*i+y*z*j+x*z*k,x,y,z) ||, div(curl(F)) = 0 by vec;dvg(-y*i-z*j-x*k,x,y,z) ||. Or by the combination vec;dvg(cul(x*y*i+y*z*j+x*z*k,x,y,z),x,y,z) ||, which is 0.
(2) Let F =〈ucos(t), usin(t), u〉. Then curl(F) by vec;cul(u*cos(t)*i+u*sin(t)*j+u*k,u,t) ||, and dvg(curl(F)) = 0 can be verified by
vec;dvg(-j+(1+u)*sin(t)*k,u,t) ||. Or by the combination vec;dvg(cul(u*cos(t)*i+u*sin(t)*j+u*k,u,t),u,t) ||, which is 0.
(3) Let f = xy² + yz² + zx². Then ∇f by vec;grd(x*y**2+y*z**2+z*x**2,x,y,z) ||,
curl(∇f) = 0 can be verified by vec;cul((2*x*z+y**2)*i+(2*x*y+z**2)*j+(2*y*z+x**2)*k,x,y,z) ||. Or by vec;cul(grd(x*y**2+y*z**2+z*x**2,x,y,z),x,y,z) ||, which is 0.