Chapter 9: Vector Calculus
Section 9.2: Vector Objects
Example 9.2.11
Express in spherical coordinates the Cartesian vector field F=a i+b j+c k, where a,b,c are constants.
Solution
Mathematical Solution
The basis vectors for spherical coordinates are the normalized versions of ∂R∂ρ, ∂R∂φ, and ∂R∂θ, where R is the position vector to the point x,y,z=ρ cosθ sinφ,ρ sinθsinφ,ρ cosφ. Consequently,
eρ=cosθsin(φ)sin⁡θ⁢sin⁡φcos⁡φ
eφ=cosθcos(φ)sinθ⁢cosφ−sinφ
eθ=−sin⁡θcos⁡θ0
Writing
eρ=cosθsinφ i+sinθsinφ j+cosφ k
eφ=cosθcosφ i+sinθcosφ j− sinφ k
eθ= −sinθ i+cosθ j
and solving for i,j,k in terms of eρ,eφ,eθ gives
i=cosθsinφ eρ+cosθcosφ eφ−sinθ eθ
j=sinθsinφ eρ+sinθcosφ eφ+cosθ eθ
k=cosφ eρ−sinφ eφ
The Cartesian vector field F=a i+b j+c k then becomes
a cos(θ)sin(φ)cos(θ)cos(φ)−sin(θ)+b sin(θ)sin(φ)sin(θ)cos(φ)cos(θ)+c cos(φ)−sin(φ)0
or
a cos(θ)sin(φ)+b sin(θ) sin(φ)+c cos(φ)a cos(θ)cos(φ)+b sin(θ)cos(φ)−c sin(φ)−a sin(θ)+b cos(θ)
Consequently, when changing coordinates in a vector or vector field, it is not enough to change coordinates in the components. The change in the basis vectors must also be taken into account.
Maple Solution - Interactive
Initialize
Tools≻Load Package: Student Vector Calculus
Loading Student:-VectorCalculus
Tools≻Tasks≻Browse: Calculus - Vector≻ Vector Algebra and Settings≻ Display Format for Vectors
Press the Access Settings button and select "Display as Column Vector"
Display Format for Vectors
Define the position vector R
Context Panel: Assign to a Name≻R
ρ cosθsinφ,ρ sinθsinφ,ρ cosφ→assign to a nameR
Obtain a representation of eρ
Write the name R. Context Panel: Evaluate and Display Inline
Context Panel: Student Vector Calculus≻Differentiate≻With Respect To≻ρ
Context Panel: Assign to a Name≻Er
R = →differentiate →assign to a nameEr
Obtain a representation of eφ
Context Panel: Student Vector Calculus≻Differentiate≻With Respect To≻φ
Context Panel: Student Vector Calculus≻Normalize≻Euclidean
Context Panel: Simplify≻Assuming Positive
Context Panel: Assign to a Name≻Ef
R = →differentiate →Euclidean-normalize →assuming positive →assign to a nameEf
Obtain a representation of eθ
Context Panel: Student Vector Calculus≻Differentiate≻With Respect To≻θ
Context Panel: Simplify≻Symbolic
Context Panel: Assign to a Name≻Et
R = →differentiate →Euclidean-normalize →simplify symbolic →assign to a nameEt
Solve for i,j,k in terms of eρ,eφ,eθ
Write a sequence of three equations relating i,j,k to eρ,eφ,eθ; press the Enter key.
Context Panel: Solve≻Solve for Variables≻i,j,k
Context Panel: Assign to a Name≻S
Er·i,j,k=eρ,Ef·i,j,k=eφ,Et·i,j,k=eθ
cos⁡θ⁢sin⁡φ⁢i+sin⁡θ⁢sin⁡φ⁢j+cos⁡φ⁢k=eρ,cos⁡θ⁢cos⁡φ⁢i+sin⁡θ⁢cos⁡φ⁢j−sin⁡φ⁢k=eφ,−sin⁡θ⁢i+cos⁡θ⁢j=eθ
→solve (specified)
i=−cos⁡φ2⁢sin⁡θ⁢eθ+sin⁡θ⁢sin⁡φ2⁢eθ−cos⁡φ⁢cos⁡θ⁢eφ−eρ⁢cos⁡θ⁢sin⁡φcos⁡θ2+sin⁡θ2⁢cos⁡φ2+sin⁡φ2,j=cos⁡φ2⁢cos⁡θ⁢eθ+cos⁡θ⁢sin⁡φ2⁢eθ+cos⁡φ⁢sin⁡θ⁢eφ+sin⁡φ⁢sin⁡θ⁢eρcos⁡θ2+sin⁡θ2⁢cos⁡φ2+sin⁡φ2,k=cos⁡φ⁢eρ−sin⁡φ⁢eφcos⁡φ2+sin⁡φ2
→simplify symbolic
i=cos⁡φ⁢cos⁡θ⁢eφ+eρ⁢cos⁡θ⁢sin⁡φ−sin⁡θ⁢eθ,j=cos⁡φ⁢sin⁡θ⁢eφ+sin⁡φ⁢sin⁡θ⁢eρ+cos⁡θ⁢eθ,k=cos⁡φ⁢eρ−sin⁡φ⁢eφ
→assign to a name
S
Change coordinates in the vector field F
Expression palette: Evaluation template Press the Enter key.
Context Panel: Collect≻Name≻e[rho]
Context Panel: Collect≻Name≻e[phi]
Context Panel: Collect≻Name≻e[theta]
a i+b j+c kx=a|f(x)S
a⁢cos⁡φ⁢cos⁡θ⁢eφ+eρ⁢cos⁡θ⁢sin⁡φ−sin⁡θ⁢eθ+b⁢cos⁡φ⁢sin⁡θ⁢eφ+sin⁡φ⁢sin⁡θ⁢eρ+cos⁡θ⁢eθ+c⁢cos⁡φ⁢eρ−sin⁡φ⁢eφ
= collect w.r.t. e[rho]
a⁢cos⁡θ⁢sin⁡φ+b⁢sin⁡θ⁢sin⁡φ+c⁢cos⁡φ⁢eρ+a⁢cos⁡φ⁢cos⁡θ⁢eφ−sin⁡θ⁢eθ+b⁢cos⁡φ⁢sin⁡θ⁢eφ+cos⁡θ⁢eθ−c⁢sin⁡φ⁢eφ
= collect w.r.t. e[phi]
a⁢cos⁡θ⁢cos⁡φ+b⁢sin⁡θ⁢cos⁡φ−c⁢sin⁡φ⁢eφ+a⁢cos⁡θ⁢sin⁡φ+b⁢sin⁡θ⁢sin⁡φ+c⁢cos⁡φ⁢eρ−a⁢sin⁡θ⁢eθ+b⁢cos⁡θ⁢eθ
= collect w.r.t. e[theta]
b⁢cos⁡θ−a⁢sin⁡θ⁢eθ+a⁢cos⁡θ⁢cos⁡φ+b⁢sin⁡θ⁢cos⁡φ−c⁢sin⁡φ⁢eφ+a⁢cos⁡θ⁢sin⁡φ+b⁢sin⁡θ⁢sin⁡φ+c⁢cos⁡φ⁢eρ
Maple Solution - Coded
Install the Student VectorCalculus package and execute the BasisFormat command.
withStudent:-VectorCalculus:BasisFormatfalse:
Define the vector field F
Apply the VectorField command.
F≔VectorFielda,b,c:
Change to spherical coordinates by applying the MapToBasis command
MapToBasisF,sphericalρ,φ,θ
The column vector returned by the MapToBasis command gives the components of the vector field in spherical coordinates. The basis vectors would be Maple's "barred" vectors, the "moving" basis vectors that are a function of position.
A solution from first principles is more enlightening.
Define R, the position vector in spherical coordinates
Use the PositionVector command with the optional name of a coordinate system. Since ρ is not the default radial variable, it is necessary to declare all the spherical-coordinate variables.
R≔PositionVectorρ,φ,θ,sphericalρ,φ,θ
By differentiation and normalization, obtain unit tangent vectors along the spherical coordinate curves
Er≔diffR,ρ
Ef≔NormalizediffR,φ assuming ρ>0
Et≔NormalizediffR,θ assuming ρ>0,φ∷RealRange0,π
Express these unit vectors in terms of i,j,k, equate to the names eρ,eφ,eθ and solve for i,j,k
S≔simplifysolveEr·i,j,k=eρ,Ef·i,j,k=eφ,Et·i,j,k=eθ,i,j,k
i=cos⁡φ⁢cos⁡θ⁢eφ+eρ⁢cos⁡θ⁢sin⁡φ−sin⁡θ⁢eθ,j=cos⁡φ⁢sin⁡θ⁢eφ+sin⁡θ⁢sin⁡φ⁢eρ+cos⁡θ⁢eθ,k=cos⁡φ⁢eρ−sin⁡φ⁢eφ
In the field F=a i+b j+c k, replace i,j,k with their equivalents in terms of eρ,eφ,eθ
collectevala i+b j+c k,S,eρ,eφ,eθ
a⁢sin⁡φ⁢cos⁡θ+b⁢sin⁡θ⁢sin⁡φ+c⁢cos⁡φ⁢eρ+a⁢cos⁡θ⁢cos⁡φ+b⁢sin⁡θ⁢cos⁡φ−c⁢sin⁡φ⁢eφ+−a⁢sin⁡θ+b⁢cos⁡θ⁢eθ
Compare
MapToBasisF,sphericalρ,φ,θ =
<< Previous Example Section 9.2 Next Example >>
© Maplesoft, a division of Waterloo Maple Inc., 2024. All rights reserved. This product is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation.
For more information on Maplesoft products and services, visit www.maplesoft.com
Download Help Document