%% Created by Maple 2021.0, Linux
%% Source Worksheet: examples_Physics
%% Generated: Sun Mar 28 18:29:52 CEST 2021
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{mathtools}
\usepackage{maple}
\usepackage[utf8]{inputenc}
\usepackage[svgnames]{xcolor}
\usepackage{amsmath}
\usepackage{breqn}
\usepackage{textcomp}
\begin{document}
\lstset{basicstyle=\ttfamily,breaklines=true,columns=flexible}
\pagestyle{empty}
\DefineParaStyle{Maple Bullet Item}
\DefineParaStyle{Maple Heading 1}
\DefineParaStyle{Maple Warning}
\DefineParaStyle{Maple Heading 4}
\DefineParaStyle{Maple Heading 2}
\DefineParaStyle{Maple Heading 3}
\DefineParaStyle{Maple Dash Item}
\DefineParaStyle{Maple Error}
\DefineParaStyle{Maple Title}
\DefineParaStyle{Maple Ordered List 1}
\DefineParaStyle{Maple Text Output}
\DefineParaStyle{Maple Ordered List 2}
\DefineParaStyle{Maple Ordered List 3}
\DefineParaStyle{Maple Normal}
\DefineParaStyle{Maple Ordered List 4}
\DefineParaStyle{Maple Ordered List 5}
\DefineCharStyle{Maple 2D Output}
\DefineCharStyle{Maple 2D Input}
\DefineCharStyle{Maple Maple Input}
\DefineCharStyle{Maple 2D Math}
\DefineCharStyle{Maple Hyperlink}
\begin{center}
\begin{Maple Title}
\textbf{Examples in Physics}
\end{Maple Title}
\end{center}
\section{\label{bkmrk0}\textbf{Vectors and Analytical Geometry}}
\subsection{\label{bkmrk1}\textbf{\textit{Vectorial equation of a line}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Ordered List 1}
\item Derive the vectorial equation of a straight line passing through two generic points A and B.
\item Choose two concrete points \textbf{A} and \textbf{B}, and use that vectorial equation to obtain the parametric equation of the line.
\item Generate a 3D plot of this line.
\end{Maple Ordered List 1}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution }
\end{Maple Normal}
\begin{Maple Normal}
The \textit{vectorial equation of a line} is the equation satisfied by the position vector of \textit{any} point of this line; in this case we want to express that equation in terms of the position vectors of the points \textbf{A} and \textbf{B.} The parametric equation is obtained from the vectorial equation with the coefficients of the unit vectors.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
1. To construct the vectorial equation of the line, let 
{$ {\moverset{\rightarrow}{A}} $} and 
{$ {\moverset{\rightarrow}{B}} $} be vectors pointing to \textbf{A} and \textbf{B}. The line we want to represent with a vectorial equation is then parallel to the vector difference
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{A\_} -\textit{B\_}  $}

% \mapleresult
\begin{dmath}\label{(1)}
{\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}}
\end{dmath}
\begin{Maple Normal}
Now let 
{$ {\moverset{\rightarrow}{r}} $} be the position vector of \textit{any} point of this line. Then the vector 
{$ {\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{A}} $} is also parallel to the line and so to 
{$ {\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}} $}; therefore taking the cross product (you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq} \coloneqq (\textit{r\_} -\textit{A\_})\times \,\mapleref{(1)}=\,0 $}

% \mapleresult
\begin{dmath}\label{(2)}
\mathit{Eq} \coloneqq \left({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{A}}\right)\times \left({\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}}\right)=0
\end{dmath}
\begin{Maple Normal}
This is the vectorial equation of the line passing through \textbf{A} and \textbf{B}. The position vector 
{$ {\moverset{\rightarrow}{r}} $} of any point belonging to this line satisfies this equation.
\end{Maple Normal}
\begin{Maple Normal}
2. To construct the parametric representation for this line, turn the generic points \textbf{A} and \textbf{B} into concrete points; that is, give values to the components of 
{$ {\moverset{\rightarrow}{A}} $} and 
{$ {\moverset{\rightarrow}{B}} $}.  For example:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{A\_} \coloneqq 2\,\textit{\_i} -3\,\textit{\_j} +4\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(3)}
{\moverset{\rightarrow}{A}}\coloneqq 2 \hat{i}-3 \hat{j}+4 \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{B\_} \coloneqq -4\,\textit{\_i} +2\,\textit{\_j} -\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(4)}
{\moverset{\rightarrow}{B}}\coloneqq -4 \hat{i}+2 \hat{j}-\hat{k}
\end{dmath}
\begin{Maple Normal}
Regardless of the values of 
{$ {\moverset{\rightarrow}{A}} $} and 
{$ {\moverset{\rightarrow}{B}} $}, for the position vector of a point of the line, we always have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j} +z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(5)}
{\moverset{\rightarrow}{r}}\coloneqq x \hat{i}+y \hat{j}+z \hat{k}
\end{dmath}
\begin{Maple Normal}
Thus the vectorial equation for these particular points \textbf{A} and \textbf{B} becomes
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq}  $}

% \mapleresult
\begin{dmath}\label{(6)}
\left(5 y -5+5 z \right) \hat{i}+\left(6 z -14-5 x \right) \hat{j}+\left(-5 x -8-6 y \right) \hat{k}=0
\end{dmath}
\begin{Maple Normal}
Since the unit vectors [
{$ \hat{i},\hat{j},\hat{k} $}] are independent, this vectorial equation represents three equations, constituted by the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics,Coefficients}{Coefficients} of these unit vectors
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Coefficients} (\mathit{Eq} ,[\textit{\_i} ,\textit{\_j} ,\textit{\_k}],\mathit{onlynonzero}) $}

% \mapleresult
\begin{dmath}\label{(7)}
5 y -5+5 z  \hiderel{=} 0,6 z -14-5 x  \hiderel{=} 0,-5 x -8-6 y  \hiderel{=} 0
\end{dmath}
\begin{Maple Normal}
This is a system of three equations in terms of three unknowns \textit{x}, \textit{y}, and \textit{z}, but by construction is the equation of a line, so two of the variables can be expressed in terms of the third one, acting as the \textit{parameter} of the parametric equations; you get these parametric equations by solving the system.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{solve} ([\mapleref{(7)}],[x ,y ,z]) $}

% \mapleresult
\href{http://www.maplesoft.com/support/help/errors/view.aspx?path=Warning,%20solve%20may%20be%20ignoring%20assumptions%20on%20the%20input%20variables.}{Warning, solve may be ignoring assumptions on the input variables.}% \mapleresult
\begin{dmath}\label{(8)}
\left[\left[x  \hiderel{=} -\frac{14}{5}+\frac{6 z}{5},y  \hiderel{=} 1-z ,z  \hiderel{=} z \right]\right]
\end{dmath}
\begin{Maple Normal}
The interpretation is: given a value for \textit{z}, the values of \textit{x} and \textit{y} are those you see above.
\end{Maple Normal}
\begin{Maple Normal}
3. To plot this parametric representation (see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=plots[spacecurve]}{plots[spacecurve]}), first construct the appropriate input; select the curve's parameter:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{select} (\mathit{evalb} ,\mapleref{(8)}[1]) $}

% \mapleresult
\begin{dmath}\label{(9)}
\left[z =z \right]
\end{dmath}
\begin{Maple Normal}
So the input for the \textit{spacecurve} command, say for \textit{z} from -4 to 4, is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{input} \coloneqq [\mathit{op} (\mathit{map} (\mathit{rhs} {,\mapleref{(8)}}_{1}))],\mathit{lhs} ({\mapleref{(9)}}_{1})=-4..4 $}

% \mapleresult
\begin{dmath}\label{(10)}
\mathit{input} \coloneqq \left[-\frac{14}{5}+\frac{6 z}{5},1-z ,z \right],z =-4..4
\end{dmath}
\begin{Maple Normal}
Some options improving the visualization are
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{opts} \coloneqq \mathit{axes} =\mathit{boxed} ,\mathit{scaling} =\mathit{constrained} ,\mathit{orientation} =[-130,70],\mathit{labels} =[x ,y ,z] $}

% \mapleresult
\begin{dmath}\label{(11)}
\mathit{opts} \coloneqq \mathit{axes}  \hiderel{=} \mathit{boxed} ,\mathit{scaling}  \hiderel{=} \mathit{constrained} ,\mathit{orientation}  \hiderel{=} \left[-130,70\right],
\\
\mathit{labels} \hiderel{=}\left[x ,y ,z \right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{plots} [\mathit{spacecurve}](\mathit{input} ,\mathit{opts}) $}

% \mapleresult
\mapleplot{maple-examples-Physicsplot3d1.eps}
\subsection{\label{bkmrk2}\textbf{\textit{Vectorial equation of a plane}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Ordered List 1}
\item Derive the vectorial equation of a plane passing through three generic points A, B, and C. 
\item Choose three concrete points \textbf{A}, \textbf{B}, and \textbf{C} and plot this plane.
\end{Maple Ordered List 1}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
The \textit{vectorial equation of a plane} is the equation satisfied by the position vector of \textit{any} point of this plane. 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
1. To construct this equation, let 
{$ {\moverset{\rightarrow}{A}} $}, 
{$ {\moverset{\rightarrow}{B}} $}, and 
{$ {\moverset{\rightarrow}{C}} $} be the vectors pointing to \textbf{A, B}, and \textbf{C}, respectively, and 
{$ {\moverset{\rightarrow}{r}} $} be the position vector of \textit{any} point of this plane. The differences 
{$ {\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{C}} $} and 
{$ {\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}} $} are vectors parallel to the plane we want to represent, and also the difference between 
{$ {\moverset{\rightarrow}{r}} $}  and any of 
{$ {\moverset{\rightarrow}{A}},{\moverset{\rightarrow}{B}} $}, or 
{$ {\moverset{\rightarrow}{C}} $} is a vector parallel to the plane. So the equation of the plane can be obtained by taking the cross product of differences involving 
{$ {\moverset{\rightarrow}{A}},{\moverset{\rightarrow}{B}} $}, and 
{$ {\moverset{\rightarrow}{C}} $} to construct a vector \textit{perpendicular} to the plane (you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{G\_} \coloneqq (\textit{A\_} -\textit{B\_})\times (\textit{A\_} -\textit{C\_}) $}

% \mapleresult
\begin{dmath}\label{(12)}
{\moverset{\rightarrow}{G}}\coloneqq \left({\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}}\right)\times \left({\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{C}}\right)
\end{dmath}
\begin{Maple Normal}
then equating to zero the scalar product of 
{$ {\moverset{\rightarrow}{G}} $} with any of the differences parallel to the plane involving 
{$ {\moverset{\rightarrow}{r}} $}. So for instance, one way of writing this vectorial equation of the plane is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq} \coloneqq (\textit{r\_} -\textit{A\_})\,.\,\textit{G\_} =\,0 $}

% \mapleresult
\begin{dmath}\label{(13)}
\mathit{Eq} \coloneqq \left({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{A}}\right)\cdot \left(\left({\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}}\right)\times \left({\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{C}}\right)\right)=0
\end{dmath}
\begin{Maple Normal}
2. To plot this plane, turn the generic points \textbf{A},\textbf{ B}, and \textbf{C} into concrete points; that is, give values to the components of  
{$ {\moverset{\rightarrow}{A}},{\moverset{\rightarrow}{B}} $}, and 
{$ {\moverset{\rightarrow}{C}} $}. For example:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{A\_} \coloneqq 2\,\textit{\_i} -3\,\textit{\_j} +4\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(14)}
{\moverset{\rightarrow}{A}}\coloneqq 2 \hat{i}-3 \hat{j}+4 \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{B\_} \coloneqq 5\,\textit{\_i} +4\,\textit{\_j} -7\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(15)}
{\moverset{\rightarrow}{B}}\coloneqq 5 \hat{i}+4 \hat{j}-7 \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{C\_} \coloneqq \frac{30}{4}\,\textit{A\_} +\frac{90}{7}\,\textit{B\_}  $}

% \mapleresult
\begin{dmath}\label{(16)}
{\moverset{\rightarrow}{C}}\coloneqq \frac{555 \hat{i}}{7}+\frac{405 \hat{j}}{14}-60 \hat{k}
\end{dmath}
\begin{Maple Normal}
For 
{$ {\moverset{\rightarrow}{r}} $}we always have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j} +z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(17)}
{\moverset{\rightarrow}{r}}\coloneqq x \hat{i}+y \hat{j}+z \hat{k}
\end{dmath}
\begin{Maple Normal}
The vectorial equation for these particular points \textbf{A}, \textbf{B}, and \textbf{C} is thus:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq}  $}

% \mapleresult
\begin{dmath}\label{(18)}
-\frac{1355 x}{14}-\frac{4607 y}{7}-\frac{6233 z}{14}=0
\end{dmath}
\begin{Maple Normal}
As a verification that the surface represented by this equation contains the points \textbf{A}, \textbf{B}, and \textbf{C}, you can substitute in the values of the coordinates of these points and see that the equation is satisfied. For example, these are the coordinates of the first point:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} [\hat{i}\cdot {\moverset{\rightarrow}{A}},\hat{j}\cdot {\moverset{\rightarrow}{A}},\hat{k}\cdot {\moverset{\rightarrow}{A}}] $}

% \mapleresult
\begin{dmath}\label{(19)}
\left[2,-3,4\right]
\end{dmath}
\begin{Maple Normal}
This shows that at these points, the equation is satisfied.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{for}P \mathrm{in}[{\moverset{\rightarrow}{A}},{\moverset{\rightarrow}{B}},{\moverset{\rightarrow}{C}}]\mathrm{do} \qquad \mathit{eval} (\mathit{Eq} ,[x =\hat{i}\cdot P ,y =\hat{j}\cdot P ,z =\hat{k}\cdot P]) \mathrm{end}\mathrm{do} $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[0=0\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[0=0\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(20)}
0=0
\end{dmath}
\begin{Maple Normal}
That this surface is a plane is clear from the fact that \textit{Eq} is linear in all of \textit{x}, \textit{y}, and \textit{z}. One way of plotting this plane is to use the command \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=plots[implicitplot3d]}{implicitplot3d}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{opts} \coloneqq \mathit{axes} =\mathit{boxed} ,\mathit{scaling} =\mathit{constrained} ,\mathit{orientation} =[125,65],\mathit{style} =\mathit{surface}  $}

% \mapleresult
\begin{dmath}\label{(21)}
\mathit{opts} \coloneqq \mathit{axes}  \hiderel{=} \mathit{boxed} ,\mathit{scaling}  \hiderel{=} \mathit{constrained} ,\mathit{orientation}  \hiderel{=} \left[125,65\right],
\\
\mathit{style} \hiderel{=}\mathit{surface} 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{plots} [\mathit{implicitplot3d}](\mathit{Eq} ,x =-2..2,y =-2..2,z =-2..2,\mathit{opts}) $}

% \mapleresult
\mapleplot{maple-examples-Physicsplot3d2.eps}
\subsection{\label{bkmrk3}\textbf{\textit{Vectorial equation of a plane tangent to a sphere of radius a}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
Derive the \textit{vectorial} equation of a plane tangent to a sphere of radius \textit{a}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
The \textit{vectorial equation }of this plane is the equation satisfied by the position vector of \textit{any} point of it.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
Let 
{$ {\moverset{\rightarrow}{r}} $} represent the position vector of \textit{any} point of the plane, 
{$ {\moverset{\rightarrow}{A}} $} be a vector pointing to the center of the sphere, and 
{$ {\moverset{\rightarrow}{B}} $} be a vector pointing to the point \textbf{B} where the plane is tangent to the sphere. So the difference 
{$ {\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{B}} $} is a vector on the plane, and the difference 
{$ {\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}} $} is a vector from the center of the sphere to the point of contact between the sphere and the tangent plane (that is, a vector perpendicular to the plane). Hence, these two vectors are perpendicular, and so their scalar product is equal to zero.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq} \coloneqq (\textit{r\_} -\textit{B\_})\,.\,(\textit{B\_} -\textit{A\_})=\,0 $}

% \mapleresult
\begin{dmath}\label{(22)}
\mathit{Eq} \coloneqq \left({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{B}}\right)\cdot \left({\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}}\right)=0
\end{dmath}
\begin{Maple Normal}
This is already the vectorial equation of the tangent plane but not yet expressed in terms of the radius of the sphere. Now since 
{$ {\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}} $} is a vector from the center of the sphere to the point of contact with the plane, the norm of this vector is the radius \textit{a} of the sphere.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{key} \coloneqq \mathit{Norm} (\textit{B\_} -\textit{A\_})=\,a  $}

% \mapleresult
\begin{dmath}\label{(23)}
\mathit{key} \coloneqq {\|{\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}}\|}=a 
\end{dmath}
\begin{Maple Normal}
Expand both expressions to use them together.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mathit{Eq}) $}

% \mapleresult
\begin{dmath}\label{(24)}
{\moverset{\rightarrow}{r}}\cdot {\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{r}}\cdot {\moverset{\rightarrow}{A}}-{\|{\moverset{\rightarrow}{B}}\|}^{2}+{\moverset{\rightarrow}{B}}\cdot {\moverset{\rightarrow}{A}}=0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{map} (u \,\rightarrow \,u ^{2},\mathit{key}) $}

% \mapleresult
\begin{dmath}\label{(25)}
{\|{\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}}\|}^{2}=a^{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(25)}) $}

% \mapleresult
\begin{dmath}\label{(26)}
{\|{\moverset{\rightarrow}{B}}\|}^{2}-2 {\moverset{\rightarrow}{B}}\cdot {\moverset{\rightarrow}{A}}+{\|{\moverset{\rightarrow}{A}}\|}^{2}=a^{2}
\end{dmath}
\begin{Maple Normal}
So simplify one with respect to the other one, eliminating 
{$ {\|{\moverset{\rightarrow}{B}}\|} $} (see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=simplify/siderels}{simplify/siderels})
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{simplify} (\mapleref{(24)},\{\mapleref{(26)}\},\{\mathit{Norm} (\textit{B\_})\}) $}

% \mapleresult
\begin{dmath}\label{(27)}
{\|{\moverset{\rightarrow}{A}}\|}^{2}-a^{2}+{\moverset{\rightarrow}{r}}\cdot {\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{r}}\cdot {\moverset{\rightarrow}{A}}-{\moverset{\rightarrow}{B}}\cdot {\moverset{\rightarrow}{A}}=0
\end{dmath}
\begin{Maple Normal}
Collecting terms in the above, this vectorial equation requested can be rewritten more compactly as 
{$ ({\moverset{\rightarrow}{B}}-{\moverset{\rightarrow}{A}})\cdot ({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{A}})=a^{2} $}. As an exercise, consider choosing three concrete values for the positions of \textbf{A},\textbf{ B}, and the radius \textit{a} of the sphere, then insert these values into the equation derived, and plot the sphere and this tangent plane together (see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=plots[display]}{plots[display]} to merge the plots).
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\subsection{\label{bkmrk4}\textbf{\textit{Volume element of a sphere}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
Determine the infinitesimal volume element of a sphere expressed in spherical coordinates.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
Let 
{$ {\moverset{\rightarrow}{r}}={\moverset{\rightarrow}{R}}(u ,v ,w) $} be the vectorial equation, parameterized by \textit{u}, \textit{v}, and \textit{w}, of a generic 3-D geometric object; in this case, we are dealing with a sphere of generic radius \textit{r}. The volume element is derived from equation as  
{$ d^{3} {\moverset{\rightarrow}{r}}=\frac{\partial}{\partial u}{\moverset{\rightarrow}{r}}\cdot (\frac{\partial}{\partial v}{\moverset{\rightarrow}{r}}\times \frac{\partial}{\partial w}{\moverset{\rightarrow}{r}})\mathit{du} \mathit{dv} \mathit{dw}  $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
We want this volume element expressed in spherical coordinates (
{$ r ,\phi ,\theta  $}); we can always choose these coordinates themselves as parameters \textit{u, v, w}. We are thus interested in the explicit form of (note the use of  \textit{\%diff}, the inert form \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/diff}{diff}, and for the cross product you can use \&x, or the 
{$ \times  $} operator from the palette of Common Symbols)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{answer} \coloneqq \mathit{\%\!diff} (\textit{r\_} ,r)\,.\,(\mathit{\%\!diff} (\textit{r\_} ,\mathrm{theta})\times \mathit{\%\!diff} (\textit{r\_} ,\mathrm{phi})) $}

% \mapleresult
\begin{dmath}\label{(28)}
\mathit{answer} \coloneqq \left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}r}{\moverset{\rightarrow}{r}}\right)\cdot \left(\left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\theta}{\moverset{\rightarrow}{r}}\right)\times \left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\phi}{\moverset{\rightarrow}{r}}\right)\right)
\end{dmath}
\begin{Maple Normal}
The first step is to write the vectorial equation 
{$ {\moverset{\rightarrow}{r}}={\moverset{\rightarrow}{R}}(r ,\phi ,\theta) $} for a sphere of radius \textit{r}; that is, the equation satisfied by the position vector 
{$ {\moverset{\rightarrow}{r}} $} of \textit{any} point of the sphere. In spherical coordinates, and choosing the origin of the reference system at the center of the sphere, this vectorial equation has its simplest form 
{$ {\moverset{\rightarrow}{R}}(r ,\phi ,\theta)=r \hat{r}, $}where 
{$ {\moverset{\rightarrow}{r}} $} points to \textit{any} point of the sphere, \textit{r} is the radial coordinate (constant over the sphere) and 
{$  \hat{r} $}  is the radial unit vector. So
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq r \,\textit{\_r}  $}

% \mapleresult
\begin{dmath}\label{(29)}
{\moverset{\rightarrow}{r}}\coloneqq r \hat{r}
\end{dmath}
\begin{Maple Normal}
 From where the value of
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{answer}  $}

% \mapleresult
\begin{dmath}\label{(30)}
\left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}r}\left(r \hat{r}\right)\right)\cdot \left(\left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\theta}\left(r \hat{r}\right)\right)\times \left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\phi}\left(r \hat{r}\right)\right)\right)
\end{dmath}
\begin{Maple Normal}
can be computed directly, using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=value}{value} command
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mathit{answer}) $}

% \mapleresult
\begin{dmath}\label{(31)}
r^{2} \sin \! \left(\theta \right)
\end{dmath}
\begin{Maple Normal}
Alternatively, one could compute this result one step at a time, making explicit that 
{$ \hat{r} $} depends on 
{$ \phi  $} and 
{$ \theta . $} For that purpose we change the basis in the vectorial equation to the Cartesian basis  (
{$ \hat{i},\hat{j},\hat{k} $}), where all the unit vectors are constant and so the partial derivatives can be performed directly.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq \mathit{ChangeBasis} (\textit{r\_} ,1) $}

% \mapleresult
\begin{dmath}\label{(32)}
{\moverset{\rightarrow}{r}}\coloneqq r \sin \! \left(\theta \right) \cos \! \left(\phi \right) \hat{i}+r \sin \! \left(\phi \right) \sin \! \left(\theta \right) \hat{j}+r \cos \! \left(\theta \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
So, the \textit{answer} introduced lines above becomes:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{answer}  $}

% \mapleresult
\begin{dmath}\label{(33)}
\left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}r}\left(r \sin \! \left(\theta \right) \cos \! \left(\phi \right) \hat{i}+r \sin \! \left(\phi \right) \sin \! \left(\theta \right) \hat{j}+r \cos \! \left(\theta \right) \hat{k}\right)\right)\cdot \left(\left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\theta}\left(r \sin \! \left(\theta \right) \cos \! \left(\phi \right) \hat{i}+r \sin \! \left(\phi \right) \sin \! \left(\theta \right) \hat{j}+r \cos \! \left(\theta \right) \hat{k}\right)\right)\times \left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}\phi}\left(r \sin \! \left(\theta \right) \cos \! \left(\phi \right) \hat{i}+r \sin \! \left(\phi \right) \sin \! \left(\theta \right) \hat{j}+r \cos \! \left(\theta \right) \hat{k}\right)\right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mathit{answer})\, $}

% \mapleresult
\begin{dmath}\label{(34)}
r^{2} \sin \! \left(\theta \right)
\end{dmath}
\begin{Maple Normal}
Hence the volume of element requested is 
{$ d^{3} {\moverset{\rightarrow}{r}}=\sin (\theta) r^{2} d r d \theta  d \phi . $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,}  $}

\subsection{\label{Vectors in Spherical Coordinates using Tensor Notation (advanced)}\textbf{\textit{Vectors in Spherical Coordinates using Tensor Notation (advanced)}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The following is a topic that appears frequently in formulations: given a 3D vector in spherical (or any curvilinear) coordinates, how do you represent and relate, in simple terms, the vector and the corresponding vectorial operations \textit{Gradient}, \textit{Divergence}, \textit{Curl} and \textit{Laplacian} using tensor notation? 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\subsubsection{\label{bkmrk5}\textbf{\textit{I. The line element in spherical coordinates and the scale-factors}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Start setting the spacetime to be 3-dimensional, Euclidean, and use Cartesian coordinates
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{dimension} =3,\mathit{coordinates} =\mathit{cartesian} ,\textit{g\_} =\,\mathit{+},\mathit{spacetimeindices} =\mathit{lowercaselatin})\colon  $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{The\,dimension\,and\,signature\,of\,the\,tensor\,space\,are\,set\,to\,} [3, (\mathit{+}\mathit{+}\mathit{+})]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(x,y,z)\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{The\,Euclidean\,metric\,in\,coordinates\,}  [x,y,z]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[{g{\idn{\mu}\idn{\nu}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & 1 & 0 
\\
 0 & 0 & 1 
\end{array}\right]\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(35)}
\underline{\hspace{68.75 ex}}
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
In vector calculus, at the root of everything there is the line element 
{$ {\moverset{\rightarrow}{\mathit{dr}}} $}, which in Cartesian coordinates has the simple form
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{dr\_} =\,\mathit{dx} \,\textit{\_i} +\mathit{dy} \,\textit{\_j} +\mathit{dz} \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(36)}
{\moverset{\rightarrow}{\mathit{dr}}}=\mathit{dx} \hat{i}+\mathit{dy} \hat{j}+\mathit{dz} \hat{k}
\end{dmath}
\begin{Maple Normal}
To compute the line element  
{$ {\moverset{\rightarrow}{\mathit{dr}}} $} in spherical coordinates, the starting point is the transformation 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{tr} \coloneqq [X]\mequaltilde \,\mathit{ChangeCoordinates} ([X],\mathit{spherical}) $}

% \mapleresult
\begin{dmath}\label{(37)}
\mathit{tr} \coloneqq \left[x  \hiderel{=} r \sin \! \left(\theta \right) \cos \! \left(\phi \right),y  \hiderel{=} r \sin \! \left(\theta \right) \sin \! \left(\phi \right),z  \hiderel{=} r \cos \! \left(\theta \right)\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Coordinates} (S =[r ,\theta ,\phi])\colon  $}

% \mapleresult
\begin{dmath}\label{(38)}
 \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  \left\{S \hiderel{=} \left(r,\theta,\phi\right),X \hiderel{=} \left(x,y,z\right)\right\}
\end{dmath}
\begin{Maple Normal}
Since in 
{$ \mapleref{(36)}[\mathit{dx} ,\mathit{dy} ,\mathit{dz}] $} are just symbols with no relationship to 
{$ [x ,y ,z] $}, start transforming these differentials using the chain rule, computing the \href{http://VectorCalculus:-Jacobian}{Jacobian} of the transformation \mapleref{(37)}. In this Jacobian \textit{J,} the first line is 
{$ [\frac{\partial x}{\partial r} \mathit{dr} ,\frac{\partial x}{\partial  \theta} d \theta ,\frac{\partial x}{\partial  \phi} d \phi] $} 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} J \coloneqq \mathit{VectorCalculus} \mcoloneq \mathit{Jacobian} (\mathit{map} (\mathit{rhs} ,\mapleref{(37)}),[S])\colon  $}

\begin{Maple Normal}
So in matrix notation,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Vector} ([\mathit{dx} ,\mathit{dy} ,\mathit{dz}])=\,J \,.\,\mathit{Vector} ([\mathit{dr} ,\mathit{dtheta} ,\mathit{dphi}]) $}

% \mapleresult
\begin{dmath}\label{(39)}
\left[\begin{array}{c}
\mathit{dx}  
\\
 \mathit{dy}  
\\
 \mathit{dz}  
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) \mathit{dr} +r \cos \! \left(\theta \right) \cos \! \left(\phi \right) d\theta  -r \sin \! \left(\theta \right) \sin \! \left(\phi \right) d\phi   
\\
 \sin \! \left(\theta \right) \sin \! \left(\phi \right) \mathit{dr} +r \cos \! \left(\theta \right) \sin \! \left(\phi \right) d\theta  +r \sin \! \left(\theta \right) \cos \! \left(\phi \right) d\phi   
\\
 \cos \! \left(\theta \right) \mathit{dr} -r \sin \! \left(\theta \right) d\theta   
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
To complete the computation of  
{$ {\moverset{\rightarrow}{\mathit{dr}}} $} in spherical coordinates we can now use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Vectors:-ChangeBasis}{ChangeBasis}, provided that next we substitute \mapleref{(39)} in the result, expressing the abstract objects 
{$ [\mathit{dx} ,\mathit{dy} ,\mathit{dz}] $} in terms of 
{$ [\mathit{dr} ,d\theta  ,d\phi ] $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
In two steps:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(36)})=\,\mathit{ChangeBasis} (\mathit{rhs} (\mapleref{(36)}),\mathit{spherical}) $}

% \mapleresult
\begin{dmath}\label{(40)}
{\moverset{\rightarrow}{\mathit{dr}}}=\left(\mathit{dx} \sin \! \left(\theta \right) \cos \! \left(\phi \right)+\mathit{dy} \sin \! \left(\theta \right) \sin \! \left(\phi \right)+\mathit{dz} \cos \! \left(\theta \right)\right) \hat{r}+\left(\mathit{dx} \cos \! \left(\phi \right) \cos \! \left(\theta \right)+\mathit{dy} \sin \! \left(\phi \right) \cos \! \left(\theta \right)-\mathit{dz} \sin \! \left(\theta \right)\right) \hat{\theta}+\left(\cos \! \left(\phi \right) \mathit{dy} -\sin \! \left(\phi \right) \mathit{dx} \right) \hat{\phi}
\end{dmath}
\begin{Maple Normal}
The line element
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{simplify} (\mathit{subs} (\mathit{convert} (\mathit{lhs} (\mapleref{(39)})\mequaltilde \,\mathit{rhs} (\mapleref{(39)}),\mathit{set}),\mapleref{(40)})) $}

% \mapleresult
\begin{dmath}\label{(41)}
{\moverset{\rightarrow}{\mathit{dr}}}=\hat{\phi} d\phi  r \sin \! \left(\theta \right)+\hat{\theta} d\theta  r +\hat{r} \mathit{dr} 
\end{dmath}
\begin{Maple Normal}
This result is important: it gives us the so-called \textit{scale factors}, the key that connect 3D vectors with the related covariant and contravariant tensors in curvilinear coordinates. The scale factors are computed from \mapleref{(41)} by taking the scalar product with each of the unit vectors 
{$ [\hat{r},\hat{\theta},\hat{\phi}] $}, then taking the coefficients of the differentials 
{$ [\mathit{dr} ,d\theta  ,d\phi ] $} (just substitute them by the number 1)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} h \coloneqq \mathit{subs} ([\mathit{dr} ,d\theta  ,d\phi ]\mequaltilde 1,[\mathit{seq} (\mathit{rhs} (\mapleref{(41)})\cdot q ,q =[\hat{r},\hat{\theta},\hat{\phi}])]) $}

% \mapleresult
\begin{dmath}\label{(42)}
h \coloneqq \left[1,r ,r \sin \! \left(\theta \right)\right]
\end{dmath}
\begin{Maple Normal}
The scale factors are relevant because the components of the 3D vector and the corresponding tensor are not the same in curvilinear coordinates. For instance, representing the differential of the coordinates as the tensor 
{$ \mathit{dS}^{j}=[\mathit{dr} ,d\theta  ,d\phi ] $}, we see that corresponding vector, the line element in spherical coordinates 
{$ {\moverset{\rightarrow}{\mathit{dS}}} $}, \textbf{\textit{is not}}  constructed by directly equating its components to the components of 
{$ \mathit{dS}^{j}=[\mathit{dr} ,d\theta  ,d\phi ] $}, so  
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
 
{$ {\moverset{\rightarrow}{\mathit{dS}}}\neq \mathit{dr} \hat{r}+d\theta   \hat{\theta}+d\phi   \hat{\phi} $} 
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
The vector 
{$ {\moverset{\rightarrow}{\mathit{dS}}} $} is constructed multiplying these contravariant components 
{$ [\mathit{dr} ,d\theta  ,d\phi ] $} by the scaling factors, as
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
 
{$ {\moverset{\rightarrow}{\mathit{dS}}}=h_{r}\mathit{dr} \hat{r}+h_{\theta}d\theta   \hat{\theta}+h_{\phi}d\phi   \hat{\phi} $} 
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
This rule applies in general. The vectorial components of a 3D vector in an orthogonal system (curvilinear or not) are always expressed in terms of the contravariant components 
{$ A^{j} $} the same way we did in the line above with the line element, using the scale-factors 
{$ h_{j} $}, so that
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
 
{$ {\moverset{\rightarrow}{A}}=\moverset{3}{\munderset{j =1}{\sum}}h_{j} A^{j}\hat{e_{j}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where on the right-hand side we see the contravariant components 
{$ {A{\idn{}\iup{}\idn{}\idn{}}} $} and the scale-factors 
{$ h_{j} $}. Because the system is orthogonal, each vector component 
{$ \mathrm{A}_{(j)} $} satisfies
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle \mathrm{A}_{\mathit{(j)}}=h_{j} {A{\idn{}\iup{}\idn{}\iup{j}\idn{}}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
The scale-factors 
{$ h_{j} $} do not constitute a tensor, so on the right-hand side we do not sum over \textit{j.  }Also, from 
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\|{\moverset{\rightarrow}{A}}\|}={A{\idn{j}}} {A{\idn{}\iup{}\idn{}\iup{j}\idn{}}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
it follows that,
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle A_{\mathit{(j)}}=\frac{A_{j}}{h_{j}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where on the right-hand side we now have the covariant tensor components 
{$ A_{j} $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Bullet Item}
\item This relationship between the components of a 3D vector and the contravariant and covariant components of a tensor representing the vector is key to translate vector-component to corresponding tensor-component formulas. 
\end{Maple Bullet Item}
\begin{Maple Normal}

\end{Maple Normal}
\subsubsection{\label{bkmrk6}\textbf{\textit{II. Transformation of contravariant and covariant tensors (can skip)}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Define here two representations for one and the same tensor: 
{$ A_{c} $} will represent \textit{A} in Cartesian coordinates, while 
{$ A_{s} $} will represent \textit{A} in spherical coordinates.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (A_{c}[j],A_{s}[j],\mathit{quiet}) $}

% \mapleresult
\begin{dmath}\label{(43)}
\left\{{A_{c}}_{j},{A_{s}}_{j},{\textcolor{olive}{\gamma}{\idn{a}}},{\textcolor{olive}{\sigma}{\idn{a}}},{\partial{\idn{a}}},{g{\idn{a}\idn{b}}},{\epsilon{\idn{a}\idn{b}\idn{c}}},{S{\idn{a}}},{X{\idn{a}}}\right\}
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{\textit{Transformation rule for a contravariant tensor}}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
We know, by definition, that the \href{http://Physics:-TransformCoordinates}{transformation rule} for the components of a \textbf{\textit{contravariant}} tensor is 
{$ A_{}^{\mu}(y)=\frac{\partial y_{}^{\mu}}{\partial x_{}^{\nu}} A_{}^{\nu}(x) $}, that is the same as the rule for the differential of the coordinates. Then, the transformation rule from 
{$ {A_{c}}_{\textcolor{white}{j }}^{j} $} to 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $}computed using \href{http://Physics:-TransformCoordinates}{TransformCoordinates} should give the same relation \mapleref{(39)}. The application of the command, however, requires attention, because, as in \mapleref{(39)}, we want the Cartesian (not the spherical) components isolated. That is like performing a reversed transformation. So we will use
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle \mathit{TensorArray} ({A_{c}}_{\textcolor{white}{j }}^{j})=\mathit{TransformCoordinates} (\mathit{tr} ,{A_{s}}_{\textcolor{white}{j }}^{j},[X],[S]) $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where on the left-hand side we get, isolated, the three components of \textit{A} in Cartesian coordinates, and on the right-hand side we transform the spherical components 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $}, from spherical 
{$ S =(r ,\theta ,\phi) $} (4\textsuperscript{th} argument) to Cartesian 
{$ X =(x ,y ,z) $} (3\textsuperscript{rd} argument), which according to the 5\textsuperscript{th} bullet of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-TransformCoordinates}{TransformCoordinates} will result in a transformation expressed in terms of \textit{the old coordinates }(here the spherical 
{$ [S] $}). Expand things to make the comparison with \mapleref{(39)} possible by eye
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Vector} [\mathit{column}](\mathit{TensorArray} (A_{c}[\mtilde j]))=\,\mathit{TransformCoordinates} (\mathit{tr} ,A_{s}[\mtilde j],[X],[S],\mathit{simplifier} =\mathit{expand}) $}

% \mapleresult
\begin{dmath}\label{(44)}
\left[\begin{array}{c}
{A_{c}}_{}^{1} 
\\
 {A_{c}}_{}^{2} 
\\
 {A_{c}}_{}^{3} 
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) {A_{s}}_{}^{1}+r \cos \! \left(\theta \right) \cos \! \left(\phi \right) {A_{s}}_{}^{2}-r \sin \! \left(\theta \right) \sin \! \left(\phi \right) {A_{s}}_{}^{3} 
\\
 \sin \! \left(\theta \right) \sin \! \left(\phi \right) {A_{s}}_{}^{1}+r \cos \! \left(\theta \right) \sin \! \left(\phi \right) {A_{s}}_{}^{2}+r \sin \! \left(\theta \right) \cos \! \left(\phi \right) {A_{s}}_{}^{3} 
\\
 \cos \! \left(\theta \right) {A_{s}}_{}^{1}-r \sin \! \left(\theta \right) {A_{s}}_{}^{2} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
We see that the transformation rule for a \textit{contravariant} vector 
{$ {A_{c}}_{\textcolor{white}{j }}^{j} $} is, indeed, as the transformation \mapleref{(39)} for the differential of the coordinates.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{\textit{Transformation rule for a covariant tensor}}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
For the transformation rule for the components of a \textit{covariant} tensor 
{$ {A_{c}}_{j} $}, we know, by definition, that it is 
{$ A_{\mu}(y)=\frac{\partial x_{}^{\nu}}{\partial y_{}^{\mu}} A_{\nu}(x) $}, so the same transformation rule for the gradient 
{$ [{\partial{\idn{x}}},{\partial{\idn{y}}},{\partial{\idn{z}}}] $}, where 
{$ {\partial{\idn{x}}}=(u \rightarrow \mathit{diff} (u ,x)) $} and so on. We can experiment this by directly \href{http://PDEtools:-dchange}{changing variables} in the differential operators 
{$ [{\partial{\idn{x}}},{\partial{\idn{y}}},{\partial{\idn{z}}}] $}, for example
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} [x]=\,\mathit{PDEtools} \mcoloneq \mathit{dchange} (\mathit{tr} ,u \,\rightarrow \,\mathit{diff} (u ,x),\mathit{simplify}) $}

% \mapleresult
\begin{dmath}\label{(45)}
{\partial{\idn{x}}}=\left(u \hiderel{\mapsto }\left(\left(-r \cos \! \left(\theta \right)^{2}+r \right) \cos \! \left(\phi \right) \left(\frac{\partial}{\partial r}u \right)+\left(\frac{\partial}{\partial \theta}u \right) \sin \! \left(\theta \right) \cos \! \left(\phi \right) \cos \! \left(\theta \right)-\left(\frac{\partial}{\partial \phi}u \right) \sin \! \left(\phi \right)\right) \frac{1}{r} \frac{1}{\sin \! \left(\theta \right)}\right)
\end{dmath}
\begin{Maple Normal}
This result, and the equivalent ones replacing \textit{x} by \textit{y} or \textit{z} in the input above can be computed in one go, in matrix and simplified form, using the \href{http://VectorCalculus:-Jacobian}{Jacobian} of the transformation computed after \mapleref{(38)}. We need to take the transpose of the inverse of \textit{J }(because now we are transforming the components of the \textit{gradient}   
{$ [{\partial{\idn{x}}},{\partial{\idn{y}}},{\partial{\idn{z}}}] $})
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} H \coloneqq \mathit{simplify} ((J^{-1})^{+})\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Vector} ([\textit{d\_} [x],\textit{d\_} [y],\textit{d\_} [z]])=\,H \,.\,\mathit{Vector} ([\textit{d\_} [r],\textit{d\_} [\theta],\textit{d\_} [\phi]]) $}

% \mapleresult
\begin{dmath}\label{(46)}
\left[\begin{array}{c}
{\partial{\idn{x}}} 
\\
 {\partial{\idn{y}}} 
\\
 {\partial{\idn{z}}} 
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) {\partial{\idn{r}}}+\frac{\cos \left(\phi \right) \cos \left(\theta \right) {\partial{\idn{\theta}}}}{r}-\frac{\sin \left(\phi \right) {\partial{\idn{\phi}}}}{r \sin \left(\theta \right)} 
\\
 \sin \! \left(\theta \right) \sin \! \left(\phi \right) {\partial{\idn{r}}}+\frac{\sin \left(\phi \right) \cos \left(\theta \right) {\partial{\idn{\theta}}}}{r}+\frac{\cos \left(\phi \right) {\partial{\idn{\phi}}}}{r \sin \left(\theta \right)} 
\\
 \cos \! \left(\theta \right) {\partial{\idn{r}}}-\frac{\sin \left(\theta \right) {\partial{\idn{\theta}}}}{r} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
The corresponding transformation equations relating the tensors 
{$ A_{c} $} and 
{$ A_{s} $} in Cartesian and spherical coordinates is computed with \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-TransformCoordinates}{TransformCoordinates} as in \mapleref{(44)}, just lowering the indices on the left and right hand sides, i.e., remove the tilde ~
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Vector} [\mathit{column}](\mathit{TensorArray} (A_{c}[j]))=\,\mathit{TransformCoordinates} (\mathit{tr} ,A_{s}[j],[X],[r ,\theta ,\phi],\mathit{simplifier} =\mathit{expand}) $}

% \mapleresult
\begin{dmath}\label{(47)}
\left[\begin{array}{c}
{A_{c}}_{1} 
\\
 {A_{c}}_{2} 
\\
 {A_{c}}_{3} 
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) {A_{s}}_{1}+\frac{\cos \left(\theta \right) \cos \left(\phi \right) {A_{s}}_{2}}{r}-\frac{\sin \left(\phi \right) {A_{s}}_{3}}{r \sin \left(\theta \right)} 
\\
 \sin \! \left(\theta \right) \sin \! \left(\phi \right) {A_{s}}_{1}+\frac{\cos \left(\theta \right) \sin \left(\phi \right) {A_{s}}_{2}}{r}+\frac{\cos \left(\phi \right) {A_{s}}_{3}}{r \sin \left(\theta \right)} 
\\
 \cos \! \left(\theta \right) {A_{s}}_{1}-\frac{\sin \left(\theta \right) {A_{s}}_{2}}{r} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
We see that the transformation rule for a \textit{covariant} vector 
{$ A_{c}[j] $} is, indeed, as the transformation rule (??) for the gradient. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{To the side:} once it is understood how to compute these transformation rules, we can have the inverse of \mapleref{(47)} as follows
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Vector} [\mathit{column}](\mathit{TensorArray} (A_{s}[j]))=\,\mathit{TransformCoordinates} (\mathit{tr} ,A_{c}[j],[S],[X],\mathit{simplifier} =\mathit{expand}) $}

% \mapleresult
\begin{dmath}\label{(48)}
\left[\begin{array}{c}
{A_{s}}_{1} 
\\
 {A_{s}}_{2} 
\\
 {A_{s}}_{3} 
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) {A_{c}}_{1}+\sin \! \left(\theta \right) \sin \! \left(\phi \right) {A_{c}}_{2}+\cos \! \left(\theta \right) {A_{c}}_{3} 
\\
 r \cos \! \left(\theta \right) \cos \! \left(\phi \right) {A_{c}}_{1}+r \cos \! \left(\theta \right) \sin \! \left(\phi \right) {A_{c}}_{2}-r \sin \! \left(\theta \right) {A_{c}}_{3} 
\\
 -r \sin \! \left(\theta \right) \sin \! \left(\phi \right) {A_{c}}_{1}+r \sin \! \left(\theta \right) \cos \! \left(\phi \right) {A_{c}}_{2} 
\end{array}\right]
\end{dmath}
\subsubsection{\label{bkmrk7}\textbf{\textit{III. Deriving the transformation rule for the Gradient using TransformCoordinates (can skip)}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Turn \textit{ON} the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-CompactDisplay}{CompactDisplay} notation for derivatives, so that the differentiation variable is displayed as an index:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ON}  $}

\begin{Maple Normal}
\

The gradient of a function \textit{f} in Cartesian coordinates and spherical coordinates is respectively given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathit{\%\!Nabla} =\,\mathit{Nabla})(f (X)) $}

% \mapleresult
\begin{dmath}\label{(49)}
\textcolor{gray}{\nabla}f \! \left(X \right)=\left(f_{x}\right) \hat{i}+\left(f_{y}\right) \hat{j}+\left(f_{z}\right) \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathit{\%\!Nabla} =\,\mathit{Nabla})(f (S)) $}

% \mapleresult
\begin{dmath}\label{(50)}
\textcolor{gray}{\nabla}f \! \left(S \right)=\left(f_{r}\right) \hat{r}+\frac{\left(f_{\theta}\right) \hat{\theta}}{r}+\frac{\left(f_{\phi}\right) \hat{\phi}}{r \sin \! \left(\theta \right)}
\end{dmath}
\begin{Maple Normal}
What we want now is to depart from \mapleref{(49)} in Cartesian coordinates and obtain \mapleref{(50)} in spherical coordinates using the transformation rule for a \textit{covariant tensor} computed with \textit{TransformCoordinates} in \mapleref{(47)}. (An equivalent derivation, simpler and with less steps is done in \textbf{Sec. IV}.)
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Start changing the vector basis in the gradient \mapleref{(49)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(49)})=\,\mathit{ChangeBasis} (\mathit{rhs} (\mapleref{(49)}),\mathit{spherical}) $}

% \mapleresult
\begin{dmath}\label{(51)}
\textcolor{gray}{\nabla}f \! \left(X \right)=\left(\left(f_{x}\right) \sin \! \left(\theta \right) \cos \! \left(\phi \right)+\left(f_{y}\right) \sin \! \left(\theta \right) \sin \! \left(\phi \right)+\left(f_{z}\right) \cos \! \left(\theta \right)\right) \hat{r}+\left(\left(f_{x}\right) \cos \! \left(\phi \right) \cos \! \left(\theta \right)+\left(f_{y}\right) \sin \! \left(\phi \right) \cos \! \left(\theta \right)-\left(f_{z}\right) \sin \! \left(\theta \right)\right) \hat{\theta}+\left(-\left(f_{x}\right) \sin \! \left(\phi \right)+\cos \! \left(\phi \right) \left(f_{y}\right)\right) \hat{\phi}
\end{dmath}
\begin{Maple Normal}
By eye, we see that in this result the coefficients of 
{$ [\hat{r},\hat{\theta},\hat{\phi}] $} are the three lines in the right-hand side of \mapleref{(48)} after replacing the covariant components 
{$ A_{j} $} by the derivatives of \textit{f} with respect to the \textit{j}\textit{\textsuperscript{th}} coordinate, here displayed using indexed notation due to using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-CompactDisplay}{CompactDisplay }
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} [{A_{s}}_{1},{A_{s}}_{2},{A_{s}}_{3}]\mequaltilde \,[(\mathit{diff} (f (S),r)),(\mathit{diff} (f (S),\theta)),(\mathit{diff} (f (S),\varphi))] $}

% \mapleresult
\begin{dmath}\label{(52)}
\left[{A_{s}}_{1} \hiderel{=} f_{r},{A_{s}}_{2} \hiderel{=} f_{\theta},{A_{s}}_{3} \hiderel{=} f_{\phi}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} [{A_{c}}_{1},{A_{c}}_{2},{A_{c}}_{3}]\mequaltilde \,[(\mathit{diff} (f (X),x)),(\mathit{diff} (f (X),y)),(\mathit{diff} (f (X),z))] $}

% \mapleresult
\begin{dmath}\label{(53)}
\left[{A_{c}}_{1} \hiderel{=} f_{x},{A_{c}}_{2} \hiderel{=} f_{y},{A_{c}}_{3} \hiderel{=} f_{z}\right]
\end{dmath}
\begin{Maple Normal}
So since \mapleref{(47)} is the inverse of \mapleref{(48)}, replace \textit{A} by 
{$ \partial f  $} in \mapleref{(47)}, the formula computed using \textit{TransformCoordinates}, then insert the result in \mapleref{(51)} to relate the gradient in Cartesian and spherical coordinates. We expect to arrive at the formula for the gradient in spherical coordinates \mapleref{(50)} . 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} (\mapleref{(52)},\mapleref{(53)},\mapleref{(47)}) $}

% \mapleresult
\begin{dmath}\label{(54)}
\left[\begin{array}{c}
f_{x} 
\\
 f_{y} 
\\
 f_{z} 
\end{array}\right]=\left[\begin{array}{c}
\sin \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \left(\theta \right) \cos \left(\phi \right) \left(f_{\theta}\right)}{r}-\frac{\sin \left(\phi \right) \left(f_{\phi}\right)}{r \sin \left(\theta \right)} 
\\
 \sin \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \left(\theta \right) \sin \left(\phi \right) \left(f_{\theta}\right)}{r}+\frac{\cos \left(\phi \right) \left(f_{\phi}\right)}{r \sin \left(\theta \right)} 
\\
 \cos \! \left(\theta \right) \left(f_{r}\right)-\frac{\sin \left(\theta \right) \left(f_{\theta}\right)}{r} 
\end{array}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} (\mathit{convert} (\mathit{lhs} (\mapleref{(54)})\mequaltilde \,\mathit{rhs} (\mapleref{(54)}),\mathit{set}),\mapleref{(51)}) $}

% \mapleresult
\begin{dmath}\label{(55)}
\textcolor{gray}{\nabla}f \! \left(X \right)=\left(\left(\sin \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{\theta}\right)}{r}-\frac{\sin \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right) \sin \! \left(\theta \right) \cos \! \left(\phi \right)+\left(\sin \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{\theta}\right)}{r}+\frac{\cos \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right) \sin \! \left(\theta \right) \sin \! \left(\phi \right)+\left(\cos \! \left(\theta \right) \left(f_{r}\right)-\frac{\sin \! \left(\theta \right) \left(f_{\theta}\right)}{r}\right) \cos \! \left(\theta \right)\right) \hat{r}+\left(\left(\sin \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{\theta}\right)}{r}-\frac{\sin \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right) \cos \! \left(\phi \right) \cos \! \left(\theta \right)+\left(\sin \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{\theta}\right)}{r}+\frac{\cos \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right) \sin \! \left(\phi \right) \cos \! \left(\theta \right)-\left(\cos \! \left(\theta \right) \left(f_{r}\right)-\frac{\sin \! \left(\theta \right) \left(f_{\theta}\right)}{r}\right) \sin \! \left(\theta \right)\right) \hat{\theta}+\left(-\left(\sin \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \cos \! \left(\phi \right) \left(f_{\theta}\right)}{r}-\frac{\sin \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right) \sin \! \left(\phi \right)+\cos \! \left(\phi \right) \left(\sin \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{r}\right)+\frac{\cos \! \left(\theta \right) \sin \! \left(\phi \right) \left(f_{\theta}\right)}{r}+\frac{\cos \! \left(\phi \right) \left(f_{\phi}\right)}{r \sin \! \left(\theta \right)}\right)\right) \hat{\phi}
\end{dmath}
\begin{Maple Normal}
Simplifying, we arrive at \mapleref{(50)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathit{lhs} =\,\mathit{expand} @ \mathit{simplify} @ \mathit{rhs})(\mapleref{(55)}) $}

% \mapleresult
\begin{dmath}\label{(56)}
\textcolor{gray}{\nabla}f \! \left(X \right)=\left(f_{r}\right) \hat{r}+\frac{\left(f_{\theta}\right) \hat{\theta}}{r}+\frac{\left(f_{\phi}\right) \hat{\phi}}{r \sin \! \left(\theta \right)}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(50)} $}

% \mapleresult
\begin{dmath}\label{(57)}
\textcolor{gray}{\nabla}f \! \left(S \right)=\left(f_{r}\right) \hat{r}+\frac{\left(f_{\theta}\right) \hat{\theta}}{r}+\frac{\left(f_{\phi}\right) \hat{\phi}}{r \sin \! \left(\theta \right)}
\end{dmath}
\subsubsection{\label{bkmrk8}\textbf{\textit{IV. Deriving the transformation rule for the Divergence, Curl, Gradient and Laplacian, using Covariant derivatives}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Bullet Item}
\item \textbf{The Divergence}
\end{Maple Bullet Item}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Introducing the vector \textit{A} in spherical coordinates, its Divergence is given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} A_{\textit{s\_}}\coloneqq A_{r}(S)\textit{\_r} +A_{\theta}(S)\underline{\hspace{1.25 ex}}\theta  +A_{\varphi}(S)\underline{\hspace{1.25 ex}}\varphi   $}

% \mapleresult
\begin{dmath}\label{(58)}
{\moverset{\rightarrow}{A_{s}}}\coloneqq A_{r}\! \left(S \right) \hat{r}+A_{\theta}\! \left(S \right) \hat{\theta}+A_{\phi}\! \left(S \right) \hat{\phi}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{CompactDisplay} (\%) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[A_{r}(S) \mathit{will\,now\,be\,displayed\,as\,} A_{r}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[A_{\phi}(S) \mathit{will\,now\,be\,displayed\,as\,} A_{\phi}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(59)}
A_{\theta}\! \left(S \right) \mathit{will\,now\,be\,displayed\,as\,} A_{\theta}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Divergence} (\mathit{\%\!A}_{\textit{s\_}})=\,\mathit{Divergence} (A_{\textit{s\_}}) $}

% \mapleresult
\begin{dmath}\label{(60)}
\textcolor{gray}{\nabla}\cdot {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\frac{\left({A_{r}}_{r}\right) r +2 A_{r}}{r}+\frac{\left({A_{\theta}}_{\theta}\right) \sin \! \left(\theta \right)+A_{\theta} \cos \! \left(\theta \right)}{r \sin \! \left(\theta \right)}+\frac{{A_{\phi}}_{\phi}}{r \sin \! \left(\theta \right)}
\end{dmath}
\begin{Maple Normal}
We want to see how this result, \mapleref{(60)}, can be obtained using \textit{TransformCoordinates} and departing from a tensorial representation of the object, this time the covariant derivative 
{$ {\triangledown{\idn{j}}}({A_{s}}_{\textcolor{white}{j }}^{j}) $}. For that purpose, we first transform the \textit{coordinates} and the \textit{metric} introducing nonzero \textit{Christoffel} symbols
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TransformCoordinates} (\mathit{tr} ,\textit{g\_} [j ,k],[S],\mathit{setmetric})\colon  $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Coordinates}\mathit{:} [r,\theta,\phi] \mathit{.}\mathit{\,Signature}\mathit{:} (\mathit{+}\mathit{+}\mathit{+})\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[{g{\idn{a}\idn{b}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & r^{2} & 0 
\\
 0 & 0 & r^{2} \sin (\theta)^{2} 
\end{array}\right]\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(61)}
 \underline{\hspace{68.75 ex}}
\end{dmath}
\begin{Maple Normal}
\textbf{To the side}: despite having nonzero \textit{Christoffel} symbols, the space still has no curvature, all the components of the \textit{Riemann} tensor are equal to zero
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mathit{nonzero}] $}

% \mapleresult
\begin{dmath}\label{(62)}
{R{\idn{a}\idn{b}\idn{c}\idn{d}}}=\varnothing 
\end{dmath}
\begin{Maple Normal}
Consider now the divergence of the \textit{contravariant} 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $}tensor, computed in tensor notation
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{CompactDisplay} (A_{s}(S)) $}

% \mapleresult
\begin{dmath}\label{(63)}
A_{s}\! \left(S \right) \mathit{will\,now\,be\,displayed\,as\,} A_{s}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{D\_} [j](A_{s}[\mtilde j](S)) $}

% \mapleresult
\begin{dmath}\label{(64)}
{\triangledown{\idn{j}}}\! \left({A_{s}}_{}^{j}\right)
\end{dmath}
\begin{Maple Normal}
\textbf{To the side:} the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-D_}{covariant derivative} expressed using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-D_}{D\_} operator can be rewritten in terms of the non-covariant \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-d_}{d\_} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Christoffel}{Christoffel} symbols as follows
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(64)}=\,\mathit{convert} (\mapleref{(64)},\textit{d\_}) $}

% \mapleresult
\begin{dmath}\label{(65)}
{\triangledown{\idn{j}}}\! \left({A_{s}}_{}^{j}\right)={\partial{\idn{j}}}\! \left({A_{s}}_{}^{j}\right)+{\Gamma{\iup{}\iup{j}\idn{a}\idn{j}}} {A_{s}}_{}^{a}
\end{dmath}
\begin{Maple Normal}
Summing over the repeated indices in \mapleref{(64)}, we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{{\rm\,\%}\!D\_\,} [j](\mathit{\%\!A}_{s}[\mtilde j])=\,\mathit{SumOverRepeatedIndices} (\mapleref{(64)}) $}

% \mapleresult
\begin{dmath}\label{(66)}
{\textcolor{gray}{\triangledown}{\idn{j}}}\! \left({{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}_{}^{j}\right)=\left({A_{s}}_{}^{1}\right)_{r}+\left({A_{s}}_{}^{2}\right)_{\theta}+\left({A_{s}}_{}^{3}\right)_{\phi}+\frac{2 {A_{s}}_{}^{1}}{r}+\frac{\cos \! \left(\theta \right) {A_{s}}_{}^{2}}{\sin \! \left(\theta \right)}
\end{dmath}
\begin{Maple Normal}
How is this related to the expression of the 
{$ \nabla \cdot {\moverset{\rightarrow}{A_{s}}} $} in \mapleref{(60)}? The answer is in the relationship established at the end of \textbf{Sec I} between the components of the tensor 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $}and the components of the vector 
{$ {\moverset{\rightarrow}{A_{s}}} $}, namely that the vector components are obtained \textit{multiplying} the contravariant tensor components by the scale-factors 
{$ h_{j} $}. So, in the above we need to substitute the contravariant 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $} by the vector components 
{$ A_{\mathit{(j)}} $} divided by the scale-factors
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} [\mathit{seq} (A_{s}[\mathit{Library} \mcoloneq \mathit{Contravariant} (j)](S)=\,\frac{\mathit{Component} (A_{\textit{s\_}},j)}{h [j]},j =1..3)] $}

% \mapleresult
\begin{dmath}\label{(67)}
\left[{A_{s}}_{}^{1} \hiderel{=} A_{r},{A_{s}}_{}^{2} \hiderel{=} \frac{A_{\theta}}{r},{A_{s}}_{}^{3} \hiderel{=} \frac{A_{\phi}}{r \sin \! \left(\theta \right)}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} [\mathit{eval}](\mapleref{(67)},\mapleref{(66)}) $}

% \mapleresult
\begin{dmath}\label{(68)}
{\textcolor{gray}{\triangledown}{\idn{j}}}\! \left({{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}_{}^{j}\right)={A_{r}}_{r}+\frac{{A_{\theta}}_{\theta}}{r}+\frac{{A_{\phi}}_{\phi}}{r \sin \! \left(\theta \right)}+\frac{2 A_{r}}{r}+\frac{\cos \! \left(\theta \right) A_{\theta}}{\sin \! \left(\theta \right) r}
\end{dmath}
\begin{Maple Normal}
Comparing with \mapleref{(60)}, we see these two expressions are the same:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(60)}) $}

% \mapleresult
\begin{dmath}\label{(69)}
\textcolor{gray}{\nabla}\cdot {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}={A_{r}}_{r}+\frac{{A_{\theta}}_{\theta}}{r}+\frac{{A_{\phi}}_{\phi}}{r \sin \! \left(\theta \right)}+\frac{2 A_{r}}{r}+\frac{\cos \! \left(\theta \right) A_{\theta}}{\sin \! \left(\theta \right) r}
\end{dmath}
\begin{Maple Bullet Item}
\item \textbf{The Curl}
\end{Maple Bullet Item}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The Curl of the the vector 
{$ {\moverset{\rightarrow}{A_{s}}} $} in spherical coordinates is given by 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Curl} (\mathit{\%\!A}_{\textit{s\_}})=\,\mathit{Curl} (A_{\textit{s\_}}) $}

% \mapleresult
\begin{dmath}\label{(70)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\frac{\left(\left({A_{\phi}}_{\theta}\right) \sin \! \left(\theta \right)+A_{\phi} \cos \! \left(\theta \right)-{A_{\theta}}_{\phi}\right) \hat{r}}{r \sin \! \left(\theta \right)}-\frac{\left(\left({A_{\phi}}_{r}\right) r \sin \! \left(\theta \right)+A_{\phi} \sin \! \left(\theta \right)-{A_{r}}_{\phi}\right) \hat{\theta}}{r \sin \! \left(\theta \right)}+\frac{\left(\left({A_{\theta}}_{r}\right) r +A_{\theta}-{A_{r}}_{\theta}\right) \hat{\phi}}{r}
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
One could think that the expression for the Curl in tensor notation is as in a non-curvilinear system
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\epsilon{\idn{i}\idn{j}\idn{k}}} {\triangledown{\idn{}\iup{}\idn{}\iup{j}\idn{}}}({A_{s}}_{\textcolor{white}{k }}^{k}) $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
But in a curvilinear system 
{$ {\epsilon{\idn{i}\idn{j}\idn{k}}} $} is not a tensor, we need to use the \textit{non-Galilean} form 
{$ {\esEpsilon{\idn{i}\idn{j}\idn{k}}}=\sqrt{{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}\, {\epsilon{\idn{i}\idn{j}\idn{k}}} $}, where 
{$ {\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert} $} is the determinant of the metric. Moreover, since the expression 
{$ {\esEpsilon{\idn{i}\idn{j}\idn{k}}} {\triangledown{\idn{}\iup{}\idn{}\iup{j}\idn{}}}({A_{s}}_{\textcolor{white}{k }}^{k}) $} has one free \textit{covariant} index (the first one), to compare with the vectorial formula \mapleref{(69)} this index also needs to be rewritten as a \textit{vector component }as discussed at the end of \textbf{Sec. I}, using 
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle A_{\mathit{(j)}}=\frac{A_{j}}{h_{j}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
The formula \mapleref{(70)} for the vectorial Curl is thus expressed using tensor notation as 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{levicivita} =\mathit{nongalilean}) $}

% \mapleresult
\begin{dmath}\label{(71)}
\left[\mathit{levicivita} =\mathit{nongalilean} \right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Curl} (\mathit{\%\!A}_{\textit{s\_}})=\frac{\mathit{LeviCivita} [i ,j ,k]}{\mathit{\%\!h} [i]}\,\textit{D\_} [\mtilde j](A_{s}[\mtilde k](S)) $}

% \mapleresult
\begin{dmath}\label{(72)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\frac{{\esEpsilon{\idn{i}\idn{j}\idn{k}}} {\triangledown{\iup{}\iup{j}}}\! \left({A_{s}}_{}^{k}\right)}{\textcolor{gray}{h}_{i}}
\end{dmath}
\begin{Maple Normal}
followed by replacing the contravariant tensor components 
{$ {A_{s}}_{\textcolor{white}{k }}^{k} $} by the vector components 
{$ \frac{A_{(k)}}{h_{k}} $} using \mapleref{(67)}. Proceeding the same way we did with the \textit{Divergence,} expand this expression. We could use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-TensorArray}{TensorArray}, but \textit{Library:-TensorComponents} places a comma between components making things more readable in this case
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(72)})=\,\mathit{Library} \mcoloneq \mathit{TensorComponents} (\mathit{rhs} (\mapleref{(72)})) $}

% \mapleresult
\begin{dmath}\label{(73)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\left[\frac{2 \sin \! \left(\theta \right) \cos \! \left(\theta \right) {A_{s}}_{}^{3}+\sin \! \left(\theta \right)^{2} \left(\left({A_{s}}_{}^{3}\right)_{\theta}\right)-\left({A_{s}}_{}^{2}\right)_{\phi}}{\sin \! \left(\theta \right) \textcolor{gray}{h}_{1}},-\frac{\sin \! \left(\theta \right)^{2} \left(\left({A_{s}}_{}^{3}\right)_{r}\right) r^{2}+2 r \sin \! \left(\theta \right)^{2} {A_{s}}_{}^{3}-\left({A_{s}}_{}^{1}\right)_{\phi}}{\sin \! \left(\theta \right) \textcolor{gray}{h}_{2}},\frac{\sin \! \left(\theta \right) \left(\left(\left({A_{s}}_{}^{2}\right)_{r}\right) r^{2}+2 r {A_{s}}_{}^{2}-\left({A_{s}}_{}^{1}\right)_{\theta}\right)}{\textcolor{gray}{h}_{3}}\right]
\end{dmath}
\begin{Maple Normal}
Replace now the components of the tensor 
{$ {A_{s}}_{\textcolor{white}{j }}^{j} $} by the components of the 3D vector 
{$ {\moverset{\rightarrow}{A_{s}}} $} using \mapleref{(67)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(73)})=\mathit{value} (\mathit{subs} [\mathit{eval}](\mapleref{(67)},\mathit{rhs} (\mapleref{(73)}))) $}

% \mapleresult
\begin{dmath}\label{(74)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\left[\frac{\frac{2 \cos \left(\theta \right) A_{\phi}}{r}+\sin \! \left(\theta \right)^{2} \left(\frac{{A_{\phi}}_{\theta}}{r \sin \left(\theta \right)}-\frac{A_{\phi} \cos \left(\theta \right)}{r \sin \left(\theta \right)^{2}}\right)-\frac{{A_{\theta}}_{\phi}}{r}}{\sin \! \left(\theta \right) h_{1}},-\frac{\sin \! \left(\theta \right)^{2} \left(\frac{{A_{\phi}}_{r}}{r \sin \left(\theta \right)}-\frac{A_{\phi}}{r^{2} \sin \left(\theta \right)}\right) r^{2}+2 A_{\phi} \sin \! \left(\theta \right)-{A_{r}}_{\phi}}{\sin \! \left(\theta \right) h_{2}},\frac{\sin \! \left(\theta \right) \left(\left(\frac{{A_{\theta}}_{r}}{r}-\frac{A_{\theta}}{r^{2}}\right) r^{2}+2 A_{\theta}-{A_{r}}_{\theta}\right)}{h_{3}}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathit{lhs} =\,\mathit{simplify} @ \mathit{rhs})(\mapleref{(74)}) $}

% \mapleresult
\begin{dmath}\label{(75)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\left[\frac{\left({A_{\phi}}_{\theta}\right) \sin \! \left(\theta \right)+A_{\phi} \cos \! \left(\theta \right)-{A_{\theta}}_{\phi}}{r \sin \! \left(\theta \right)},\frac{{A_{r}}_{\phi}-\left({A_{\phi}}_{r}\right) r \sin \! \left(\theta \right)-A_{\phi} \sin \! \left(\theta \right)}{\sin \! \left(\theta \right) r},\frac{\left({A_{\theta}}_{r}\right) r +A_{\theta}-{A_{r}}_{\theta}}{r}\right]
\end{dmath}
\begin{Maple Normal}
We see these are exactly the components of the Curl \mapleref{(70)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(70)} $}

% \mapleresult
\begin{dmath}\label{(76)}
\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{\textcolor{gray}{A}_{\textcolor{gray}{s}}}}=\frac{\left(\left({A_{\phi}}_{\theta}\right) \sin \! \left(\theta \right)+A_{\phi} \cos \! \left(\theta \right)-{A_{\theta}}_{\phi}\right) \hat{r}}{r \sin \! \left(\theta \right)}-\frac{\left(\left({A_{\phi}}_{r}\right) r \sin \! \left(\theta \right)+A_{\phi} \sin \! \left(\theta \right)-{A_{r}}_{\phi}\right) \hat{\theta}}{r \sin \! \left(\theta \right)}+\frac{\left(\left({A_{\theta}}_{r}\right) r +A_{\theta}-{A_{r}}_{\theta}\right) \hat{\phi}}{r}
\end{dmath}
\begin{Maple Bullet Item}
\item \textbf{The Gradient}
\end{Maple Bullet Item}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Once the problem is fully understood, it is easy to redo the computations of \textbf{Sec.III} for the \textit{Gradient}, this time using tensor notation and the covariant derivative. In tensor notation, the components of the \textit{Gradient} are given by the components of the right-hand side
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textcolor{gray}{\nabla}f (S)=\frac{{\triangledown{\idn{j}}}(f (S))}{\textcolor{gray}{h}_{j}} $}

% \mapleresult
\begin{dmath}\label{(77)}
\textcolor{gray}{\nabla}f \! \left(S \right)=\frac{{\partial{\idn{j}}}\! \left(f \! \left(S \right)\right)}{\textcolor{gray}{h}_{j}}
\end{dmath}
\begin{Maple Normal}
where on the left-hand side we have the vectorial \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Vectors,differential_operators}{Nabla} differential operator and on the right-hand side, since 
{$ f (S) $} is a scalar, the covariant derivative 
{$ {\triangledown{\idn{j}}}(f) $} becomes the standard derivative 
{$ {\partial{\idn{j}}}(f) $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(77)})=\,\mathit{eval} (\mathit{value} (\mathit{Library} \mcoloneq \mathit{TensorComponents} (\mathit{rhs} (\mapleref{(77)})))) $}

% \mapleresult
\begin{dmath}\label{(78)}
\textcolor{gray}{\nabla}f \! \left(S \right)=\left[f_{r},\frac{f_{\theta}}{r},\frac{f_{\phi}}{r \sin \! \left(\theta \right)}\right]
\end{dmath}
\begin{Maple Normal}
The above is the expected result \mapleref{(50)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(50)} $}

% \mapleresult
\begin{dmath}\label{(79)}
\textcolor{gray}{\nabla}f \! \left(S \right)=\left(f_{r}\right) \hat{r}+\frac{\left(f_{\theta}\right) \hat{\theta}}{r}+\frac{\left(f_{\phi}\right) \hat{\phi}}{r \sin \! \left(\theta \right)}
\end{dmath}
\begin{Maple Bullet Item}
\item \textbf{The Laplacian}
\end{Maple Bullet Item}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Likewise we can compute the Laplacian directly as
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Laplacian} (f (S))=\,\textit{D\_} [j](\textit{D\_} [j](f (S))) $}

% \mapleresult
\begin{dmath}\label{(80)}
{\textcolor{gray}{\nabla}}^{2}f \! \left(S \right)={\triangledown{\idn{j}}}\! \left({\partial{\iup{}\iup{j}}}\! \left(f \! \left(S \right)\right)\right)
\end{dmath}
\begin{Maple Normal}
In this case there are no free indices nor tensor components to be rewritten as vector components, so there is no need for scale-factors. Summing over the repeated indices,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{SumOverRepeatedIndices} (\mapleref{(80)}) $}

% \mapleresult
\begin{dmath}\label{(81)}
{\textcolor{gray}{\nabla}}^{2}f \! \left(S \right)=\square \! \left(f \! \left(S \right)\right)+\frac{2 \left(f_{r}\right)}{r}+\frac{\cos \! \left(\theta \right) \left(f_{\theta}\right)}{\sin \! \left(\theta \right) r^{2}}
\end{dmath}
\begin{Maple Normal}
Evaluating the  \textit{Vectors:-Laplacian} on the left-hand side,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mapleref{(81)}) $}

% \mapleresult
\begin{dmath}\label{(82)}
\frac{\left(f_{r ,r}\right) r +2 f_{r}}{r}+\frac{\left(f_{\theta ,\theta}\right) \sin \! \left(\theta \right)+\cos \! \left(\theta \right) \left(f_{\theta}\right)}{r^{2} \sin \! \left(\theta \right)}+\frac{f_{\phi ,\phi}}{r^{2} \sin \! \left(\theta \right)^{2}}=\square \! \left(f \! \left(S \right)\right)+\frac{2 \left(f_{r}\right)}{r}+\frac{\cos \! \left(\theta \right) \left(f_{\theta}\right)}{\sin \! \left(\theta \right) r^{2}}
\end{dmath}
\begin{Maple Normal}
On the right-hand side we see the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-dAlembertian}{dAlembertian}, 
{$ \square (f (S)), $}in curvilinear coordinates; rewrite it using standard \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-diff}{diff} derivatives and expand both sides of the equation for comparison
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mathit{convert} (\mapleref{(82)},\mathit{diff})) $}

% \mapleresult
\begin{dmath}\label{(83)}
f_{r ,r}+\frac{f_{\theta ,\theta}}{r^{2}}+\frac{f_{\phi ,\phi}}{r^{2} \sin \! \left(\theta \right)^{2}}+\frac{2 \left(f_{r}\right)}{r}+\frac{\cos \! \left(\theta \right) \left(f_{\theta}\right)}{\sin \! \left(\theta \right) r^{2}}=f_{r ,r}+\frac{f_{\theta ,\theta}}{r^{2}}+\frac{f_{\phi ,\phi}}{r^{2} \sin \! \left(\theta \right)^{2}}+\frac{2 \left(f_{r}\right)}{r}+\frac{\cos \! \left(\theta \right) \left(f_{\theta}\right)}{\sin \! \left(\theta \right) r^{2}}
\end{dmath}
\begin{Maple Normal}
This is an identity, the left and right hand sides are equal:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{evalb} (\mapleref{(83)}) $}

% \mapleresult
\begin{dmath}\label{(84)}
\mathit{true} 
\end{dmath}
\section{\label{bkmrk9}\textbf{Mechanics}}
\subsection{\label{bkmrk10}\textbf{\textit{Static: reactions of planes and tensions on cables}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
A bar \textbf{AB} of weight \textbf{w} and length \textbf{L} has one extreme on a horizontal plane and the other on a vertical place, and is kept in that position by two cables \textbf{AD} and \textbf{BC}. The bar forms an angle 
{$ \alpha  $} with the horizontal plane and its projection \textbf{BC} over this plane forms an angle 
{$ \beta  $} with the vertical plane. The cable \textbf{BC} is in the vertical plane where the bar is. Determine the reactions of the planes at \textbf{A} and \textbf{B} and the tensions on the cables.
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
\raisebox{-0.1in}{\includegraphics[keepaspectratio,scale=0.5527638190954773,width=3.0555555555555554in]{maple-examples-Physics_image0.png}}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
There are two equations that contain information about the state of equilibrium of a system. The first one, saying that the sum of the forces acting on the body are equal to zero, tells that the center of mass of the body is not accelerated. The second one, saying that the sum of the moments of the forces acting on the body (that is, the total torque) is zero tells that the rotation of the body around its center of masses is not changing (if it is not rotating, it stays that way). These two equations involve the reactions of the planes and the tensions on the cables, so from them we can obtain the solution to the problem. There is no friction so it is also clear that the reactions 
{$ {\moverset{\rightarrow}{R}}_{A} $} and 
{$ {\moverset{\rightarrow}{R}}_{B} $} are perpendicular to the planes, as shown in the figure, and the tensions 
{$ {\moverset{\rightarrow}{T}}_{A} $} and 
{$ {\moverset{\rightarrow}{T}}_{B} $} on the cables have direction \textbf{AD} and \textbf{BC}, respectively.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The steps to solve this problem are:
\end{Maple Normal}
\begin{Maple Ordered List 1}
\item Determine each force 
{$ {\moverset{\rightarrow}{F}} $}acting on the bar and its application point 
{$ {\moverset{\rightarrow}{r}}. $}
\item Equate the sum of the forces 
{$ {\moverset{\rightarrow}{F}} $} to zero.
\item Equate the sum of the moments 
{$ {\moverset{\rightarrow}{r}}\times {\moverset{\rightarrow}{F}} $} to zero.
\item Solve these two vectorial equations for 
{$ {\moverset{\rightarrow}{R}}_{A},{\moverset{\rightarrow}{R}}_{B} $} , 
{$ {\moverset{\rightarrow}{T}}_{A} $}, and 
{$ {\moverset{\rightarrow}{T}}_{B} $}, representing the reactions of the planes at the points of contact \textbf{A} and \textbf{B}, and the tensions of the cables attached to the bar at \textbf{A} and \textbf{B}, respectively.
\end{Maple Ordered List 1}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The forces acting on the bar are its weight 
{$ {\moverset{\rightarrow}{w}} $}, and the reactions and tensions  
{$ {\moverset{\rightarrow}{R}}_{A},{\moverset{\rightarrow}{R}}_{B} $},  
{$ {\moverset{\rightarrow}{T}}_{A} $}, and 
{$ {\moverset{\rightarrow}{T}}_{B} $}. So the two equilibrium equations are:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [1]\coloneqq \textit{w\_} +\textit{R\_} [A]+\textit{R\_} [B]+\textit{T\_} [A]+\textit{T\_} [B]=\,0 $}

% \mapleresult
\begin{dmath}\label{(85)}
\mathit{eq}_{1}\coloneqq {\moverset{\rightarrow}{w}}+{\moverset{\rightarrow}{R}}_{A}+{\moverset{\rightarrow}{R}}_{B}+{\moverset{\rightarrow}{T}}_{A}+{\moverset{\rightarrow}{T}}_{B}=0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [2]\coloneqq \textit{r\_} [w]\times \textit{w\_} +\textit{r\_} [A]\times \textit{R\_} [A]+\textit{r\_} [B]\times \textit{R\_} [B]+\textit{r\_} [A]\times \textit{T\_} [A]+\textit{r\_} [B]\times \textit{T\_} [B]=\,0 $}

% \mapleresult
\begin{dmath}\label{(86)}
\mathit{eq}_{2}\coloneqq {{\moverset{\rightarrow}{r}}{\idn{w}}}\times {\moverset{\rightarrow}{w}}+{{\moverset{\rightarrow}{r}}{\idn{A}}}\times {\moverset{\rightarrow}{R}}_{A}+{{\moverset{\rightarrow}{r}}{\idn{B}}}\times {\moverset{\rightarrow}{R}}_{B}+{{\moverset{\rightarrow}{r}}{\idn{A}}}\times {\moverset{\rightarrow}{T}}_{A}+{{\moverset{\rightarrow}{r}}{\idn{B}}}\times {\moverset{\rightarrow}{T}}_{B}=0
\end{dmath}
\begin{Maple Normal}
where in the input above, to enter the cross products you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols. Set the origin and orientation of the reference system to project these vectors; any choice will do, but a good one will simplify the algebraic manipulations. We choose the origin at the point \textbf{B}, the vertical \textit{z} axis in the direction of the reaction 
{$ {\moverset{\rightarrow}{R}}_{B} $} , so that 
{$ {{\moverset{\rightarrow}{r}}{\idn{B}}}=0, $} the \textit{y} axis in the direction of 
{$ {\moverset{\rightarrow}{R}}_{A} $}, and the \textit{x} axis in the remaining direction, anti-parallel to 
{$ {\moverset{\rightarrow}{T}}_{A} $}. With this choice, the vectors entering 
{$ \mathit{eq}_{1} $} and 
{$ \mathit{eq}_{2} $} are projected as follows: 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [B]\coloneqq \mathrm{abs}(R [B])\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(87)}
{\moverset{\rightarrow}{R}}_{B}\coloneqq {| R_{B}|} \hat{k}
\end{dmath}
\begin{Maple Normal}
where 
{$ {| R_{B}|} $} represents the norm of 
{$ {\moverset{\rightarrow}{R}}_{B}, $}to be determined,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} [B]\coloneqq 0 $}

% \mapleresult
\begin{dmath}\label{(88)}
{{\moverset{\rightarrow}{r}}{\idn{B}}}\coloneqq 0
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [A]\coloneqq \mathrm{abs}(R [A])\textit{\_j}  $}

% \mapleresult
\begin{dmath}\label{(89)}
{\moverset{\rightarrow}{R}}_{A}\coloneqq {| R_{A}|} \hat{j}
\end{dmath}
\begin{Maple Normal}
where 
{$ {| R_{A}|} $} is to be determined. This reaction 
{$ {\moverset{\rightarrow}{R}}_{A} $} is applied to the bar at \textbf{A,} represented by 
{$ {{\moverset{\rightarrow}{r}}{\idn{A}\idn{}}} $}; its component along the \textit{x} axis is obtained by projecting the segment \textbf{BA} onto the horizontal plane (
{$ L \cos (\alpha) $}), resulting in \textbf{BC}, then into the intersection of the two planes. So:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} [A]\coloneqq L \,\cos (\mathrm{alpha})\cdot (\cos (\mathrm{beta})\,\textit{\_i} +\sin (2\,\mathrm{Pi}-\mathrm{beta})\,\textit{\_j})+L \,\sin (\mathrm{alpha})\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(90)}
{{\moverset{\rightarrow}{r}}{\idn{A}}}\coloneqq -L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) \hat{j}+L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) \hat{i}+L \sin \! \left(\alpha \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
For the other vectors we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{T\_} [A]\coloneqq -\mathrm{abs}(T [A])\textit{\_i}  $}

% \mapleresult
\begin{dmath}\label{(91)}
{\moverset{\rightarrow}{T}}_{A}\coloneqq -{| T_{A}|} \hat{i}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{T\_} [B]\coloneqq \mathrm{abs}(T [B])\,\cos (\mathrm{beta})\,\textit{\_i} +\mathrm{abs}(T [B])\,\sin (2\,\mathrm{Pi}-\mathrm{beta})\textit{\_j}  $}

% \mapleresult
\begin{dmath}\label{(92)}
{\moverset{\rightarrow}{T}}_{B}\coloneqq {| T_{B}|} \cos \! \left(\beta \right) \hat{i}-{| T_{B}|} \sin \! \left(\beta \right) \hat{j}
\end{dmath}
\begin{Maple Normal}
where 
{$ {| T_{A}|} $}and 
{$ {| T_{B}|} $} are to be determined,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{w\_} \coloneqq -\mathrm{abs}(w)\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(93)}
{\moverset{\rightarrow}{w}}\coloneqq -{| w |} \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} [w]\coloneqq \frac{\textit{r\_} [A]}{2} $}

% \mapleresult
\begin{dmath}\label{(94)}
{{\moverset{\rightarrow}{r}}{\idn{w}}}\coloneqq -\frac{L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) \hat{j}}{2}+\frac{L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) \hat{i}}{2}+\frac{L \sin \! \left(\alpha \right) \hat{k}}{2}
\end{dmath}
\begin{Maple Normal}
The two equilibrium equations now appear as
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [1] $}

% \mapleresult
\begin{dmath}\label{(95)}
-{| w |} \hat{k}+{| R_{A}|} \hat{j}+{| R_{B}|} \hat{k}-{| T_{A}|} \hat{i}+{| T_{B}|} \cos \! \left(\beta \right) \hat{i}-{| T_{B}|} \sin \! \left(\beta \right) \hat{j}=0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [2] $}

% \mapleresult
\begin{dmath}\label{(96)}
\frac{L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| w |} \hat{i}}{2}+\frac{L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| w |} \hat{j}}{2}-L \sin \! \left(\alpha \right) {| R_{A}|} \hat{i}+L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| R_{A}|} \hat{k}-L \sin \! \left(\alpha \right) {| T_{A}|} \hat{j}-L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| T_{A}|} \hat{k}=0
\end{dmath}
\begin{Maple Normal}
These two vectorial equations represent a system of six equations, obtained by equating each of the coefficients of 
{$ \hat{i} $}, 
{$ \hat{j} $}, and 
{$ \hat{k} $} in each of the equations to zero; that is, taking the components of the vectorial equations along each axis:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq} [1,2,3]\coloneqq \mathit{seq} (\mathit{Component} (\mathit{lhs} (\mathit{eq} [1]),n)=\,0,n =\,1..3) $}

% \mapleresult
\begin{dmath}\label{(97)}
\mathit{Eq}_{1,2,3}\coloneqq -{| T_{A}|}+{| T_{B}|} \cos \! \left(\beta \right) \hiderel{=} 0,{| R_{A}|}-{| T_{B}|} \sin \! \left(\beta \right) \hiderel{=} 0,
\\
-{| w |}+{| R_{B}|}\hiderel{=}0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eq} [4,5,6]\coloneqq \mathit{seq} (\mathit{Component} (\mathit{lhs} (\mathit{eq} [2]),n)=\,0,n =\,1..3) $}

% \mapleresult
\begin{dmath}\label{(98)}
\mathit{Eq}_{4,5,6}\coloneqq \frac{L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| w |}}{2}-L \sin \! \left(\alpha \right) {| R_{A}|} \hiderel{=} 0,
\\
\frac{L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| w |}}{2}-L \sin \! \left(\alpha \right) {| T_{A}|}\hiderel{=}0,
\\
L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| R_{A}|}-L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| T_{A}|}\hiderel{=}0
\end{dmath}
\begin{Maple Normal}
So the system of equations to be solved is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{sys} \coloneqq \{\mathit{Eq} [1,2,3],\mathit{Eq} [4,5,6]\} $}

% \mapleresult
\begin{dmath}\label{(99)}
\mathit{sys} \coloneqq \left\{\frac{L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| w |}}{2}-L \sin \! \left(\alpha \right) {| T_{A}|} \hiderel{=} 0,
\\
L \cos \! \left(\alpha \right) \cos \! \left(\beta \right) {| R_{A}|}-L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| T_{A}|}\hiderel{=}0,
\\
\frac{L \cos \! \left(\alpha \right) \sin \! \left(\beta \right) {| w |}}{2}-L \sin \! \left(\alpha \right) {| R_{A}|}\hiderel{=}0,-{| w |}+{| R_{B}|} \hiderel{=} 0,
\\
{| R_{A}|}-{| T_{B}|} \sin \! \left(\beta \right)\hiderel{=}0,-{| T_{A}|}+{| T_{B}|} \cos \! \left(\beta \right) \hiderel{=} 0\right\}
\end{dmath}
\begin{Maple Normal}
The unknowns are
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{var} \coloneqq \{\mathrm{abs}(R [A]),\mathrm{abs}(R [B]),\mathrm{abs}(T [A]),\mathrm{abs}(T [B])\} $}

% \mapleresult
\begin{dmath}\label{(100)}
\mathit{var} \coloneqq \left\{{| R_{A}|},{| R_{B}|},{| T_{A}|},{| T_{B}|}\right\}
\end{dmath}
\begin{Maple Normal}
and the solution is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{solve} (\mathit{sys} ,\mathit{var}) $}

% \mapleresult
\begin{dmath}\label{(101)}
\left\{{| R_{A}|} \hiderel{=} \frac{\cos \! \left(\alpha \right) {| w |} \sin \! \left(\beta \right)}{2 \sin \! \left(\alpha \right)},{| R_{B}|} \hiderel{=} {| w |},{| T_{A}|} \hiderel{=} \frac{\cos \! \left(\alpha \right) {| w |} \cos \! \left(\beta \right)}{2 \sin \! \left(\alpha \right)},
\\
{| T_{B}|}\hiderel{=}\frac{\cos \! \left(\alpha \right) {| w |}}{2 \sin \! \left(\alpha \right)}\right\}
\end{dmath}
\subsection{\label{bkmrk11}\textbf{\textit{Work}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
A particle is submitted to a force whose Cartesian components are given by
{$ F_{x}=a \,x^{3}+b x \,y^{2}+c z , $}
{$ F_{y}=a \,y^{3}+b x \,y^{2}, $}
{$ F_{z}=c z  $}. Calculate the work done by this force when moving the particle along a straight line from the origin to a point (
{$ x_{0},y_{0},z_{0} $}).
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
The work to be calculated is equal to the line integral of the force along the path (line) indicated:
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\textcolor{gray}{\int}}_{\!\!\Lambda}^{}{\moverset{\rightarrow}{F}}\textcolor{gray}{d}{\moverset{\rightarrow}{r}} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where 
{$ \Lambda  $} represents the integration domain.The steps to solve this problem are:
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Ordered List 1}
\item Determine the vectorial (parameter t) equation 
{$ {\moverset{\rightarrow}{r}}(t) $} of the line over which we are going to integrate.
\item Express \textit{x}, \textit{y}, and \textit{z} entering the components of 
{$ {\moverset{\rightarrow}{F}} $} in terms of the components of 
{$ {\moverset{\rightarrow}{r}}(t) $}, then the scalar product 
{$ {\moverset{\rightarrow}{F}}\cdot d  $}
{$ {\moverset{\rightarrow}{r}} $} becomes 
{$ {\moverset{\rightarrow}{F}}(t)\cdot {\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}(t) $} \textit{dt} and the work can be expressed as 
{$ {\textcolor{gray}{\int}}_{\!\!0}^{t}{\moverset{\rightarrow}{F}}\cdot {\moverset{\rightarrow}{v}}\textcolor{gray}{d}t  $}.
\item Compute the integral.
\end{Maple Ordered List 1}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The work to be calculated is given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} W \coloneqq \mathit{Int} (\textit{F\_} .\textit{v\_} ,t =0..t) $}

% \mapleresult
\begin{dmath}\label{(102)}
W \coloneqq {\textcolor{gray}{\int}}_{\!\!\!0}^{t}{\moverset{\rightarrow}{F}}\cdot {\moverset{\rightarrow}{v}}\textcolor{gray}{d}t 
\end{dmath}
\begin{Maple Normal}
The force acting on the particle is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{F\_} \coloneqq (a \,x^{3}+b \,x \,y^{2}+c \,z)\textit{\_i} +(a \,x^{3}+b \,x \,y^{2})\textit{\_j} +c \,z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(103)}
{\moverset{\rightarrow}{F}}\coloneqq \left(a \,x^{3}+b x \,y^{2}+c z \right) \hat{i}+\left(a \,x^{3}+b x \,y^{2}\right) \hat{j}+c z \hat{k}
\end{dmath}
\begin{Maple Normal}
The \hyperref[the_vectorial_equation_of_a_line]{vectorial equation of a line} 
{$ {\moverset{\rightarrow}{r}}\coloneqq {\moverset{\rightarrow}{r}}(t), $}where \textit{t} is a parameter, is represented by the vector position of any of its points. This line is passing through the origin and a generic point 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} [0]\coloneqq x_{0}\,\textit{\_i} +y_{0}\,\textit{\_j} +z_{0}\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(104)}
{{\moverset{\rightarrow}{r}}{\idn{0}}}\coloneqq x_{\mathit{0}} \hat{i}+y_{\mathit{0}} \hat{j}+z_{\mathit{0}} \hat{k}
\end{dmath}
\begin{Maple Normal}
 In such a case, 
{$ {\moverset{\rightarrow}{r}}(t) $}can be written directly as the product of the parameter \textit{t} and the vector representing 
{$ {{\moverset{\rightarrow}{r}}{\idn{0}}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq t \,\textit{r\_} [0] $}

% \mapleresult
\begin{dmath}\label{(105)}
{\moverset{\rightarrow}{r}}\coloneqq t \left(x_{\mathit{0}} \hat{i}+y_{\mathit{0}} \hat{j}+z_{\mathit{0}} \hat{k}\right)
\end{dmath}
\begin{Maple Normal}
So at the origin, \textit{t} = 0, and when 
{$ {\moverset{\rightarrow}{r}}={{\moverset{\rightarrow}{r}}{\idn{0}}} $}, \textit{t} = 1. To construct the scalar product 
{$ {\moverset{\rightarrow}{F}}\cdot d  $}
{$ {\moverset{\rightarrow}{r}}, $}first 
{$ {\moverset{\rightarrow}{F}} $} shall be expressed in terms of the vectorial equation of this line; that is, \textit{x}, \textit{y}, and \textit{z} entering its components shall be taken from the components of the equation 
{$ {\moverset{\rightarrow}{r}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} x =\,\mathit{Component} (\textit{r\_} ,1),y =\,\mathit{Component} (\textit{r\_} ,2),z =\,\mathit{Component} (\textit{r\_} ,3) $}

% \mapleresult
\begin{dmath}\label{(106)}
x  \hiderel{=} t x_{\mathit{0}},y  \hiderel{=} t y_{\mathit{0}},z  \hiderel{=} t z_{\mathit{0}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{F\_} \coloneqq \mathit{eval} (\textit{F\_} ,[\mapleref{(106)}])\, $}

% \mapleresult
\begin{dmath}\label{(107)}
{\moverset{\rightarrow}{F}}\coloneqq \left(a \,t^{3} x_{\mathit{0}}^{3}+b \,t^{3} x_{\mathit{0}} y_{\mathit{0}}^{2}+c t z_{\mathit{0}}\right) \hat{i}+\left(a \,t^{3} x_{\mathit{0}}^{3}+b \,t^{3} x_{\mathit{0}} y_{\mathit{0}}^{2}\right) \hat{j}+c t z_{\mathit{0}} \hat{k}
\end{dmath}
\begin{Maple Normal}
Compute now 
{$ {\moverset{\rightarrow}{v}}={\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}(t) $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{v\_} \coloneqq \mathit{diff} (\textit{r\_} ,t) $}

% \mapleresult
\begin{dmath}\label{(108)}
{\moverset{\rightarrow}{v}}\coloneqq x_{\mathit{0}} \hat{i}+y_{\mathit{0}} \hat{j}+z_{\mathit{0}} \hat{k}
\end{dmath}
\begin{Maple Normal}
So the line integral giving the work W is now
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} W  $}

% \mapleresult
\begin{dmath}\label{(109)}
{\textcolor{gray}{\int}}_{\!\!\!0}^{t}\left(a \,t^{3} x_{\mathit{0}}^{4}+a \,t^{3} x_{\mathit{0}}^{3} y_{\mathit{0}}+b \,t^{3} x_{\mathit{0}}^{2} y_{\mathit{0}}^{2}+b \,t^{3} x_{\mathit{0}} y_{\mathit{0}}^{3}+c t x_{\mathit{0}} z_{\mathit{0}}+c t z_{\mathit{0}}^{2}\right)\textcolor{gray}{d}t 
\end{dmath}
\begin{Maple Normal}
When the particle is at 
{$ {{\moverset{\rightarrow}{r}}{\idn{0}}} $}, we have that \textit{t} = 1, so the value of W to move the particle to 
{$ {{\moverset{\rightarrow}{r}}{\idn{0}}} $} is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eval} (W ,t =1) $}

% \mapleresult
\begin{dmath}\label{(110)}
{\textcolor{gray}{\int}}_{\!\!\!0}^{1}\left(a \,t^{3} x_{\mathit{0}}^{4}+a \,t^{3} x_{\mathit{0}}^{3} y_{\mathit{0}}+b \,t^{3} x_{\mathit{0}}^{2} y_{\mathit{0}}^{2}+b \,t^{3} x_{\mathit{0}} y_{\mathit{0}}^{3}+c t x_{\mathit{0}} z_{\mathit{0}}+c t z_{\mathit{0}}^{2}\right)\textcolor{gray}{d}t 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mapleref{(110)}) $}

% \mapleresult
\begin{dmath}\label{(111)}
\frac{1}{4} a x_{\mathit{0}}^{4}+\frac{1}{4} a x_{\mathit{0}}^{3} y_{\mathit{0}}+\frac{1}{4} b x_{\mathit{0}}^{2} y_{\mathit{0}}^{2}+\frac{1}{4} b x_{\mathit{0}} y_{\mathit{0}}^{3}+\frac{1}{2} c x_{\mathit{0}} z_{\mathit{0}}+\frac{1}{2} c z_{\mathit{0}}^{2}
\end{dmath}
\subsection{\label{bkmrk12}\textbf{\textit{Lagrangian for a pendulum}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
Determine the Lagrangian of a plane pendulum having a mass \textit{m} in its extremity and whose suspension point:
\end{Maple Normal}
\begin{Maple Normal}
a) moves uniformly over a vertical circumference with a constant frequency 
{$ \omega . $}
\end{Maple Normal}
\begin{Maple Normal}
b) oscillates horizontally on the plane of the pendulum according to 
{$ x =\cos (\omega  t) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
a) A figure for this part of the problem is
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
\raisebox{-0.1in}{\includegraphics[keepaspectratio,scale=0.360062893081761,width=3.1805555555555554in]{maple-examples-Physics_image1.png}}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
The Lagrangian is defined as 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq T -U  $}

% \mapleresult
\begin{dmath}\label{(112)}
L \coloneqq T -U 
\end{dmath}
\begin{Maple Normal}
where \textit{T} and \textit{U}  are the kinetic and potential energy of the system, respectively, in this case constituted by a single point of mass \textit{m}. The potential energy \textit{U} is the gravitational energy
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} U \coloneqq -m \,g \,y  $}

% \mapleresult
\begin{dmath}\label{(113)}
U \coloneqq -m g y 
\end{dmath}
\begin{Maple Normal}
where \textit{g} is the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=ScientificConstants,PhysicalConstants}{gravitational constant} and we choose the \textit{y} axis along the vertical, pointing downwards, so that the gravitational force 
{$ {\moverset{\rightarrow}{F}}_{g}=\mathit{mg} \hat{j} $}. The kinetic energy is:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} T \coloneqq \frac{1}{2}\,m \,(\textit{v\_} \,.\,\textit{v\_}) $}

% \mapleresult
\begin{dmath}\label{(114)}
T \coloneqq \frac{m {\|{\moverset{\rightarrow}{v}}\|}^{2}}{2}
\end{dmath}
\begin{Maple Normal}
To compute this velocity, the position vector 
{$ {\moverset{\rightarrow}{r}} $} of the suspension point of the pendulum,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j}  $}

% \mapleresult
\begin{dmath}\label{(115)}
{\moverset{\rightarrow}{r}}\coloneqq x \hat{i}+y \hat{j}
\end{dmath}
\begin{Maple Normal}
must be determined. Choosing the \textit{x} axis horizontally and the origin of the reference system at the center of the circle (see figure above), the \textit{x} and \textit{y} coordinates are given by:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{parametric\_equations} \coloneqq [x =\,a \,\cos (\mathrm{omega}\,t)+l \,\sin (\mathrm{phi}(t)),y =-a \,\sin (\mathrm{omega}\,t)+l \,\cos (\mathrm{phi}(t))] $}

% \mapleresult
\begin{dmath}\label{(116)}
\textit{parametric\_equations} \coloneqq \left[x  \hiderel{=} a \cos \! \left(\omega  t \right)+l \sin \! \left(\phi \! \left(t \right)\right),y  \hiderel{=} -a \sin \! \left(\omega  t \right)+l \cos \! \left(\phi \! \left(t \right)\right)\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq \mathit{eval} (\textit{r\_} ,\textit{parametric\_equations}) $}

% \mapleresult
\begin{dmath}\label{(117)}
{\moverset{\rightarrow}{r}}\coloneqq \left(a \cos \! \left(\omega  t \right)+l \sin \! \left(\phi \! \left(t \right)\right)\right) \hat{i}+\left(-a \sin \! \left(\omega  t \right)+l \cos \! \left(\phi \! \left(t \right)\right)\right) \hat{j}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{v\_} \coloneqq \mathit{diff} (\textit{r\_} ,t) $}

% \mapleresult
\begin{dmath}\label{(118)}
{\moverset{\rightarrow}{v}}\coloneqq \left(-a \omega  \sin \! \left(\omega  t \right)+l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \cos \! \left(\phi \! \left(t \right)\right)\right) \hat{i}+\left(-a \omega  \cos \! \left(\omega  t \right)-l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \sin \! \left(\phi \! \left(t \right)\right)\right) \hat{j}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} T  $}

% \mapleresult
\begin{dmath}\label{(119)}
\frac{m \left(\left(-a \omega  \sin \! \left(\omega  t \right)+l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \cos \! \left(\phi \! \left(t \right)\right)\right)^{2}+\left(-a \omega  \cos \! \left(\omega  t \right)-l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \sin \! \left(\phi \! \left(t \right)\right)\right)^{2}\right)}{2}
\end{dmath}
\begin{Maple Normal}
This expression contains products of trigonometric functions, so one simplification consists of combining these products.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{combine} (T ,\mathit{trig}) $}

% \mapleresult
\begin{dmath}\label{(120)}
-\frac{m \left(2 \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l \omega  \sin \! \left(\omega  t -\phi \! \left(t \right)\right)-\left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} l^{2}-a^{2} \omega^{2}\right)}{2}
\end{dmath}
\begin{Maple Normal}
For the gravitational energy, expressed in terms of the parametric equations of the point of mass \textit{m}, we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} U \coloneqq \mathit{eval} (U ,\textit{parametric\_equations}) $}

% \mapleresult
\begin{dmath}\label{(121)}
U \coloneqq -m g \left(-a \sin \! \left(\omega  t \right)+l \cos \! \left(\phi \! \left(t \right)\right)\right)
\end{dmath}
\begin{Maple Normal}
So the requested Lagrangian is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq \mathit{combine} (L ,\mathit{trig}) $}

% \mapleresult
\begin{dmath}\label{(122)}
L \coloneqq -\sin \! \left(\omega  t -\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega +\frac{\left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} l^{2} m}{2}+\frac{a^{2} m \omega^{2}}{2}+\cos \! \left(\phi \! \left(t \right)\right) g l m -\sin \! \left(\omega  t \right) a g m 
\end{dmath}
\begin{Maple Normal}
Taking into account that the Lagrangian of a system is defined up to a total derivative with respect to \textit{t}, we can eliminate the two terms that can be rewritten as total derivatives; these are
{$ \frac{m \,a^{2} \omega^{2}}{2} $} and 
{$ m g a \sin (\omega  t), $}so
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{select} (\mathit{has} ,L ,[\omega^{2},\sin (\mathrm{omega}\,t)]) $}

% \mapleresult
\begin{dmath}\label{(123)}
\frac{a^{2} m \omega^{2}}{2}-\sin \! \left(\omega  t \right) a g m 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq L -\mapleref{(123)} $}

% \mapleresult
\begin{dmath}\label{(124)}
L \coloneqq -\sin \! \left(\omega  t -\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega +\frac{\left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} l^{2} m}{2}+\cos \! \left(\phi \! \left(t \right)\right) g l m 
\end{dmath}
\begin{Maple Normal}
b) The steps are the same as in part a:
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq T -U  $}

% \mapleresult
\begin{dmath}\label{(125)}
L \coloneqq T -U 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} U \coloneqq -m \,g \,y  $}

% \mapleresult
\begin{dmath}\label{(126)}
U \coloneqq -m g y 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} T \coloneqq \frac{1}{2}\,m \,(\textit{v\_} \,.\,\textit{v\_}) $}

% \mapleresult
\begin{dmath}\label{(127)}
T \coloneqq \frac{m {\|{\moverset{\rightarrow}{v}}\|}^{2}}{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j}  $}

% \mapleresult
\begin{dmath}\label{(128)}
{\moverset{\rightarrow}{r}}\coloneqq x \hat{i}+y \hat{j}
\end{dmath}
\begin{Maple Normal}
Now, regarding part a), the only change is in the expression of the \textit{y} coordinate, which for this part b) is:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} y =\,l \,\cos (\mathrm{phi}(t)) $}

% \mapleresult
\begin{dmath}\label{(129)}
y =l \cos \! \left(\phi \! \left(t \right)\right)
\end{dmath}
\begin{Maple Normal}
So the parametric equations in this case are
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{parametric\_equations} \coloneqq [x =\,a *\cos (\mathrm{omega}*t)+l *\sin (\mathrm{phi}(t)),\mapleref{(129)}] $}

% \mapleresult
\begin{dmath}\label{(130)}
\textit{parametric\_equations} \coloneqq \left[x  \hiderel{=} a \cos \! \left(\omega  t \right)+l \sin \! \left(\phi \! \left(t \right)\right),y  \hiderel{=} l \cos \! \left(\phi \! \left(t \right)\right)\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq \mathit{eval} (\textit{r\_} ,\textit{parametric\_equations}) $}

% \mapleresult
\begin{dmath}\label{(131)}
{\moverset{\rightarrow}{r}}\coloneqq \left(a \cos \! \left(\omega  t \right)+l \sin \! \left(\phi \! \left(t \right)\right)\right) \hat{i}+l \cos \! \left(\phi \! \left(t \right)\right) \hat{j}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{v\_} \coloneqq \mathit{diff} (\textit{r\_} ,t) $}

% \mapleresult
\begin{dmath}\label{(132)}
{\moverset{\rightarrow}{v}}\coloneqq \left(-a \omega  \sin \! \left(\omega  t \right)+l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \cos \! \left(\phi \! \left(t \right)\right)\right) \hat{i}-l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \sin \! \left(\phi \! \left(t \right)\right) \hat{j}
\end{dmath}
\begin{Maple Normal}
For the gravitational energy, expressed in terms of the parametric equations of the point of mass \textit{m}, we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} U \coloneqq \mathit{eval} (U ,\textit{parametric\_equations}) $}

% \mapleresult
\begin{dmath}\label{(133)}
U \coloneqq -m g l \cos \! \left(\phi \! \left(t \right)\right)
\end{dmath}
\begin{Maple Normal}
So the requested Lagrangian is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L  $}

% \mapleresult
\begin{dmath}\label{(134)}
\frac{m \left(\left(-a \omega  \sin \! \left(\omega  t \right)+l \left(\frac{d}{d t}\phi \! \left(t \right)\right) \cos \! \left(\phi \! \left(t \right)\right)\right)^{2}+l^{2} \left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} \sin \! \left(\phi \! \left(t \right)\right)^{2}\right)}{2}+m g l \cos \! \left(\phi \! \left(t \right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq \mathit{combine} (L ,\mathit{trig}) $}

% \mapleresult
\begin{dmath}\label{(135)}
L \coloneqq -\frac{\sin \! \left(\omega  t +\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega}{2}-\frac{\sin \! \left(\omega  t -\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega}{2}-\frac{\cos \! \left(2 \omega  t \right) a^{2} m \omega^{2}}{4}+\frac{\left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} l^{2} m}{2}+\frac{a^{2} m \omega^{2}}{4}+m g l \cos \! \left(\phi \! \left(t \right)\right)
\end{dmath}
\begin{Maple Normal}
The terms in \textit{L} that can be expressed as total derivatives can be discarded, so
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{select} (\mathit{has} ,L ,[\omega^{2},\cos (2\,\mathrm{omega}\,t)]) $}

% \mapleresult
\begin{dmath}\label{(136)}
-\frac{\cos \! \left(2 \omega  t \right) a^{2} m \omega^{2}}{4}+\frac{a^{2} m \omega^{2}}{4}
\end{dmath}
\begin{Maple Normal}
So the Lagrangian is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq L -\mapleref{(136)} $}

% \mapleresult
\begin{dmath}\label{(137)}
L \coloneqq -\frac{\sin \! \left(\omega  t +\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega}{2}-\frac{\sin \! \left(\omega  t -\phi \! \left(t \right)\right) \left(\frac{d}{d t}\phi \! \left(t \right)\right) a l m \omega}{2}+\frac{\left(\frac{d}{d t}\phi \! \left(t \right)\right)^{2} l^{2} m}{2}+m g l \cos \! \left(\phi \! \left(t \right)\right)
\end{dmath}
\subsection{\label{bkmrk13}\textbf{\textit{Inertia tensor for a triatomic molecule}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
Determine the Inertia tensor corresponding to a triatomic molecule that has the form of an isosceles triangle with two masses 
{$ m_{1} $} in the extremes of the base and mass 
{$ m_{2} $} in the third vertex. The distance between the two masses 
{$ m_{1} $} is equal to \textit{a,} and the height of the triangle is equal to \textit{h}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} ,\mathit{KroneckerDelta})\colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The general formula for the Inertia tensor is given by (note the use of the abbreviation \textit{kd\_} for \textit{KroneckerDelta})
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{InertiaTensor} \coloneqq \mathit{\%\!sum} (m [k]\,(\mathit{Norm} (\textit{r\_} [k])^{2}\,\textit{kd\_} [i ,j]-\mathit{Component} (\textit{r\_} [k],i)\,\mathit{Component} (\textit{r\_} [k],j)),k =1..N) $}

% \mapleresult
\begin{dmath}\label{(138)}
\mathit{InertiaTensor} \coloneqq \moverset{N}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2} {\delta{\idn{i}\idn{j}}}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{i} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{j}\right)
\end{dmath}
\begin{Maple Normal}
where \textit{N} is the number of particles, 
{$ m_{k} $} is the mass of each one, 
{$ {{\moverset{\rightarrow}{r}}{\idn{k}}} $} is its position in a reference system with the origin at the "center of mass", 
{$ {({{\moverset{\rightarrow}{r}}{\idn{k}}})}_{i} $} is the component in the \textit{i}\textit{\textsuperscript{th}} direction of the position vector associated to the \textit{k}\textit{\textsuperscript{th}} particle in that reference system, and 
{$ \delta_{i ,j} $} is the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/KroneckerDelta}{Kronecker delta}, part of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics}. Make this definition of the \textit{InertiaTensor} be an indexing function for the \textit{InertiaTensor} matrix.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{IT} \coloneqq \mathit{unapply} (\mathit{InertiaTensor} ,i ,j) $}

% \mapleresult
\begin{dmath}\label{(139)}
\mathit{IT} \coloneqq \left(i ,j \right)\hiderel{\mapsto }\moverset{N}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k}\cdot \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2}\cdot {\delta{\idn{i}\idn{j}}}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{i}\cdot \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{j}\right)
\end{dmath}
\begin{Maple Normal}
For example, for a component in the diagonal, we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{IT} (1,1) $}

% \mapleresult
\begin{dmath}\label{(140)}
\moverset{N}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1}^{2}\right)
\end{dmath}
\begin{Maple Normal}
and outside of the diagonal we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{IT} (1,2) $}

% \mapleresult
\begin{dmath}\label{(141)}
\moverset{N}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2}\right)
\end{dmath}
\begin{Maple Normal}
At this point, we can proceed to setting the particularities of this problem. The number of particles is 3.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} N \coloneqq 3 $}

% \mapleresult
\begin{dmath}\label{(142)}
N \coloneqq 3
\end{dmath}
\begin{Maple Normal}
Hence the matrix is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{IT\_Matrix} \coloneqq \mathit{Matrix} (3,3,\mathit{IT}) $}

% \mapleresult
\begin{dmath}\label{(143)}
\textit{IT\_Matrix} \coloneqq \left[\begin{array}{ccc}
\moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1}^{2}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{3}\right) 
\\
 \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2}^{2}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{3}\right) 
\\
 \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{1} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{3}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! \left(-m_{k} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{2} \left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{3}\right) & \moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} \left({\|{{\moverset{\rightarrow}{r}}{\idn{k}}}\|}^{2}-\left({{\moverset{\rightarrow}{r}}{\idn{k}}}\right)_{3}^{2}\right) 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
Two of the masses are equal
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} m [3]\coloneqq m [1] $}

% \mapleresult
\begin{dmath}\label{(144)}
m_{3}\coloneqq m_{1}
\end{dmath}
\begin{Maple Normal}
We now choose any system of reference (not at the center of mass) where we are going to project the position vectors 
{$ {\moverset{\rightarrow}{R}}_{k} $} of each atom and the center of mass 
{$ {\moverset{\rightarrow}{R}}_{\mathit{CM}} $}. The vectors 
{$ {{\moverset{\rightarrow}{r}}{\idn{k}}} $} entering the definition of the Inertia tensor \mapleref{(138)} are related to 
{$ {\moverset{\rightarrow}{R}}_{k} $} and 
{$ {\moverset{\rightarrow}{R}}_{\mathit{CM}} $} by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{position} \coloneqq \textit{r\_} [k]=\,\textit{R\_} [k]-\textit{R\_} [\mathit{CM}] $}

% \mapleresult
\begin{dmath}\label{(145)}
\mathit{position} \coloneqq {{\moverset{\rightarrow}{r}}{\idn{k}}}={\moverset{\rightarrow}{R}}_{k}-{\moverset{\rightarrow}{R}}_{\mathit{CM}}
\end{dmath}
\begin{Maple Normal}
For the 
{$ {\moverset{\rightarrow}{R}}_{k} $}, we choose a system of reference with the origin at the middle of the segment connecting the two atoms of mass equal to 
{$ m_{1} $}. Using Cartesian coordinates, we take the \textit{x} axis along this segment and the \textit{z} axis passing through the third atom, of mass 
{$ m_{2} $}. So in this referential, the positions of the three atoms are
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [1]\coloneqq -\frac{a}{2}\,\textit{\_i} \,\esnum \mathit{\,to\,the\,left\,of\,the\,origin\,}  $}

% \mapleresult
\begin{dmath}\label{(146)}
{\moverset{\rightarrow}{R}}_{1}\coloneqq -\frac{a \hat{i}}{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [2]\coloneqq h \,\textit{\_k} \,\esnum \mathit{\,along\,the\,z\,direction\,}  $}

% \mapleresult
\begin{dmath}\label{(147)}
{\moverset{\rightarrow}{R}}_{2}\coloneqq h \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [3]\coloneqq \frac{a}{2}\,\textit{\_i} \,\esnum \mathit{\,to\,the\,right\,of\,the\,origin\,}  $}

% \mapleresult
\begin{dmath}\label{(148)}
{\moverset{\rightarrow}{R}}_{3}\coloneqq \frac{a \hat{i}}{2}
\end{dmath}
\begin{Maple Normal}
Indicate the real objects of this problem so that simplification steps further below take that into account
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{real} =\,\{a ,h ,m [1],m [2],m [3]\}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{real} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{realobjects} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(149)}
\left[\mathit{realobjects} =\left\{a ,h ,\phi ,r ,\rho ,\theta ,x ,y ,z ,m_{1},m_{2}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Compute the position of the "\textit{center of mass}." By definition, this is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [\mathit{CM}]\coloneqq \frac{\mathit{\%\!sum} (m [k]\,\textit{R\_} [k],\,k =1..N)}{\mathit{\%\!sum} (m [k],\,k =1..N)} $}

% \mapleresult
\begin{dmath}\label{(150)}
{\moverset{\rightarrow}{R}}_{\mathit{CM}}\coloneqq \frac{\moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k} {\moverset{\rightarrow}{R}}_{k}}{\moverset{3}{\munderset{k =1}{\textcolor{gray}{\sum}}}\! m_{k}}
\end{dmath}
\begin{Maple Normal}
Evaluating these sums, we have the value of 
{$ {\moverset{\rightarrow}{R}}_{\mathit{CM}} $}:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} [\mathit{CM}]\coloneqq \mathit{value} (\textit{R\_} [\mathit{CM}]) $}

% \mapleresult
\begin{dmath}\label{(151)}
{\moverset{\rightarrow}{R}}_{\mathit{CM}}\coloneqq \frac{m_{2} h \hat{k}}{2 m_{1}+m_{2}}
\end{dmath}
\begin{Maple Normal}
So these are the positions of the three particles viewed from the center of mass and expressed in terms of the known quantities 
{$ m_{k} $}, \textit{a} and \textit{h}:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{seq} (\mathit{eval} (\mathit{position} ,k =j),j =\,1..N) $}

% \mapleresult
\begin{dmath}\label{(152)}
{{\moverset{\rightarrow}{r}}{\idn{1}}} \hiderel{=} -\frac{a \hat{i}}{2}-\frac{m_{2} h \hat{k}}{2 m_{1}+m_{2}},{{\moverset{\rightarrow}{r}}{\idn{2}}} \hiderel{=} h \hat{k}-\frac{m_{2} h \hat{k}}{2 m_{1}+m_{2}},
\\
{{\moverset{\rightarrow}{r}}{\idn{3}}}\hiderel{=}\frac{a \hat{i}}{2}-\frac{m_{2} h \hat{k}}{2 m_{1}+m_{2}}
\end{dmath}
\begin{Maple Normal}
The answer to the problem posed, that is, the inertia tensor for this triatomic molecule, is obtained now by evaluating the abstract expression for the IT\_Matrix at these values of the position vectors 
{$ {{\moverset{\rightarrow}{r}}{\idn{k}}} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{IT\_answer} \coloneqq \mathit{simplify} (\mathit{eval} (\mathit{value} (\textit{IT\_Matrix}),[\mapleref{(152)}])) $}

% \mapleresult
\begin{dmath}\label{(153)}
\textit{IT\_answer} \coloneqq \left[\begin{array}{ccc}
\frac{2 m_{2} h^{2} m_{1}}{2 m_{1}+m_{2}} & 0 & 0 
\\
 0 & \frac{2 a^{2} m_{1}^{2}+m_{2} \left(a^{2}+4 h^{2}\right) m_{1}}{4 m_{1}+2 m_{2}} & 0 
\\
 0 & 0 & \frac{m_{1} a^{2}}{2} 
\end{array}\right]
\end{dmath}
\subsection{\label{The equations of motion in curvilinear coordinates, tensor notation and Coriolis force}\textbf{\textit{The equations of motion in curvilinear coordinates, tensor notation and Coriolis force}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The formulation of the equations of motion of a particle is simple in Cartesian coordinates using vector notation. However, depending on the problem, for example when describing the motion of a particle as seen from a non-inertial system of references (e.g. a rotating planet, like earth), there is advantage in using curvilinear coordinates and also tensor notation. When the particle's movement is observed from such a rotating referential, we also see "acceleration" that is not due to any force but to the fact that the referential itself is accelerated. The material below discusses and formulates these topics, and derives the expression for the Coriolis and centripetal force in cylindrical coordinates as seen from a rotating system of references.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\subsubsection{\label{bkmrk14}\textbf{\textit{Cartesian coordinates}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Vector notation}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Generally speaking the equations of motion of a particle are easy to formulate: the position vector is a function of time, the velocity is its first derivative and the acceleration is its second derivative. For instance, in Cartesian coordinates
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} ;
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{with} (\mathit{Vectors})\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} (t)=\,x (t)\,\textit{\_i} +y (t)\,\textit{\_j} +z (t)\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(154)}
{\moverset{\rightarrow}{r}}\! \left(t \right)=x \! \left(t \right) \hat{i}+y \! \left(t \right) \hat{j}+z \! \left(t \right) \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(154)},t) $}

% \mapleresult
\begin{dmath}\label{(155)}
{\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)={\moverset{\mathbf{.}}{\mathrm{x}}}\! \left(t \right) \hat{i}+{\moverset{\mathbf{.}}{\mathrm{y}}}\! \left(t \right) \hat{j}+{\moverset{\mathbf{.}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(155)},t) $}

% \mapleresult
\begin{dmath}\label{(156)}
{\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)={\moverset{\mathbf{..}}{\mathrm{x}}}\! \left(t \right) \hat{i}+{\moverset{\mathbf{..}}{\mathrm{y}}}\! \left(t \right) \hat{j}+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
Newton's 2\textsuperscript{nd} law, that \textit{in an inertial system of references} when there is force there is acceleration and viceversa, is then given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{F\_} (t)=\,m \cdot \mathit{lhs} (\mapleref{(156)}) $}

% \mapleresult
\begin{dmath}\label{(157)}
{\moverset{\rightarrow}{F}}\! \left(t \right)=m {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
where 
{$ {\moverset{\rightarrow}{F}}(t)=F_{x}(t)\hat{i}+F_{y}(t)\hat{j}+F_{z}(t)\hat{k} $} represents the total force acting on the particle. This vectorial equation represents three second order differential equations which, for given initial conditions, can be integrated to arrive at a closed form expression for 
{$ {\moverset{\rightarrow}{r}}(t) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Tensor notation}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
In Cartesian coordinates, the tensorial form of the equations \mapleref{(157)} is also straightforward. In a flat spacetime - Galilean system of references - the three space coordinates 
{$ x ,y ,z  $} form a 3D tensor, and so does its first derivate and the second one. Set the spacetime to be 3-dimensional and Euclidean and use lowercaselatin indices for the corresponding tensors
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{coordinates} =\,\mathit{cartesian} ,\mathit{metric} =\,\mathit{Euclidean} ,\mathit{dimension} =\,3,\mathit{spacetimeindices} =\mathit{lowercaselatin})\colon  $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{The\,dimension\,and\,signature\,of\,the\,tensor\,space\,are\,set\,to\,} [3, (\mathit{+}\mathit{+}\mathit{+})]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(x,y,z)\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{The\,Euclidean\,metric\,in\,coordinates\,}  [x,y,z]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[{g{\idn{\mu}\idn{\nu}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & 1 & 0 
\\
 0 & 0 & 1 
\end{array}\right]\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(158)}
\underline{\hspace{68.75 ex}}
\end{dmath}
\begin{Maple Normal}
The position, velocity and acceleration vectors are expressed in tensor notation as done in \mapleref{(154)}, \mapleref{(155)} and \mapleref{(156)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} X [j](t) $}

% \mapleresult
\begin{dmath}\label{(159)}
{X{\idn{j}}}\! \left(t \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(159)},t) $}

% \mapleresult
\begin{dmath}\label{(160)}
{\moverset{\mathbf{.}}{{X{\idn{j}}}}}\! \left(t \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(160)},t) $}

% \mapleresult
\begin{dmath}\label{(161)}
{\moverset{\mathbf{..}}{{X{\idn{j}}}}}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
Setting a tensor 
{$ F_{j}(t) $} to represent the three Cartesian components of the force
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (F [j]=[F_{x}(t),F_{y}(t),F_{z}(t)]) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,objects\,with\,tensor\,properties\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(162)}
\left\{{\textcolor{olive}{\gamma}{\idn{a}}},{F{\idn{j}}},{\textcolor{olive}{\sigma}{\idn{a}}},{\partial{\idn{a}}},{g{\idn{a}\idn{b}}},{\epsilon{\idn{a}\idn{b}\idn{c}}},{X{\idn{a}}}\right\}
\end{dmath}
\begin{Maple Normal}
Newton's 2\textsuperscript{nd} law \mapleref{(157)}, now expressed in tensorial notation, is given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} F [j]=\,m \cdot \mapleref{(161)} $}

% \mapleresult
\begin{dmath}\label{(163)}
{F{\idn{j}}}=m {\moverset{\mathbf{..}}{{X{\idn{j}}}}}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
The three differential equations behind this tensorial form of \mapleref{(157)} are as expected
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TensorArray} (\mapleref{(163)},\mathit{output} =\mathit{setofequations}) $}

% \mapleresult
\begin{dmath}\label{(164)}
\left\{F_{x}\! \left(t \right) \hiderel{=} m {\moverset{\mathbf{..}}{\mathrm{x}}}\! \left(t \right),F_{y}\! \left(t \right) \hiderel{=} m {\moverset{\mathbf{..}}{\mathrm{y}}}\! \left(t \right),F_{z}\! \left(t \right) \hiderel{=} m {\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right)\right\}
\end{dmath}
\begin{Maple Normal}
Things are straightforward in Cartesian coordinates because the components of the line element 
{$ {\moverset{\rightarrow}{\mathit{dr}}}=\mathit{dx} \hat{i}+\mathit{dy} \hat{j}+\mathit{dz} \hat{k} $} are exactly the components of the tensor 
{$ \boldsymbol{\mathrm{d}}({X{\idn{j}}}) $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TensorArray} (\textit{d\_} (X [j])) $}

% \mapleresult
\begin{dmath}\label{(165)}
\left[\begin{array}{ccc}
\boldsymbol{\mathrm{d}}\! \left(x \right) & \boldsymbol{\mathrm{d}}\! \left(y \right) & \boldsymbol{\mathrm{d}}\! \left(z \right) 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
and so, the \textit{form factors} (see \href{https://www.mapleprimes.com/posts/212253-Vectors-In-Spherical-Coordinates-Using}{related Mapleprimes post}) are all equal to 1.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
In the case of no external forces, 
{$ {\moverset{\rightarrow}{F}}(t)=0={F{\idn{j}}} $} and the equations of motion, whose solution are the trajectory, can be formulated as the path of minimal length between two points, a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Geodesics}{geodesic}. In the case under consideration, because the spacetime is flat (Galilean) those two points lie on a plane, we are talking about Euclidean geometry, that information is encoded in the metric (the 3x3 identity matrix \mapleref{(158)}), and the geodesic is a straight line. The differential equations of this geodesic are thus the equations of motion \mapleref{(164)} with  
{$ {\moverset{\rightarrow}{F}}(t)=0 $}, and can be computed using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Geodesics}{Geodesics}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Geodesics} (t) $}

% \mapleresult
\begin{dmath}\label{(166)}
\left[{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0,{\moverset{\mathbf{..}}{\mathrm{y}}}\! \left(t \right) \hiderel{=} 0,{\moverset{\mathbf{..}}{\mathrm{x}}}\! \left(t \right) \hiderel{=} 0\right]
\end{dmath}
\subsubsection{\label{bkmrk15}\textbf{\textit{Curvilinear coordinates}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Vector notation}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The form of these equations in the case of curvilinear coordinates, for example in cylindrical or spherical variables, is obtained performing a change of coordinates.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{tr} \coloneqq [X]\mequaltilde \,\mathit{ChangeCoordinates} ([X],\mathit{cylindrical}) $}

% \mapleresult
\begin{dmath}\label{(167)}
\mathit{tr} \coloneqq \left[x  \hiderel{=} \rho  \cos \! \left(\phi \right),y  \hiderel{=} \rho  \sin \! \left(\phi \right),z  \hiderel{=} z \right]
\end{dmath}
\begin{Maple Normal}
This change keeps the \textit{z} axis unchanged, so the corresponding unit vector 
{$ \mathit{\hat{k}} $} remains unchanged. Changing the basis and coordinates used to represent the position vector 
{$ {\moverset{\rightarrow}{r}}(t)=x (t) \hat{i}+y (t) \hat{j}+z (t) \hat{k} $}, it becomes
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} (t)=\mathit{ChangeBasis} (\mathit{rhs} (\mapleref{(154)}),\mathit{cylindrical} ,\mathit{alsocomponents}) $}

% \mapleresult
\begin{dmath}\label{(168)}
{\moverset{\rightarrow}{r}}\! \left(t \right)=z \! \left(t \right) \hat{k}+\rho \! \left(t \right) \hat{\rho}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
where since in \mapleref{(154)} the coordinates 
{$ (x ,y ,z) $} depend on \textit{t}, in \mapleref{(168)}, not just 
{$ \rho (t) $} and 
{$ z (t) $} but also the unit vector 
{$ \hat{\rho}(t) $} depends on \textit{t}. The velocity is computed as usual, differentiating
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(168)},t) $}

% \mapleresult
\begin{dmath}\label{(169)}
{\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)={\moverset{\mathbf{.}}{\mathrm{z}}}\! \left(t \right) \hat{k}+{\moverset{\mathbf{.}}{\rho}}\! \left(t \right) \hat{\rho}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right) \hat{\phi}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
The second term is due to the dependency of 
{$ \hat{\rho} $} on the coordinate 
{$ \varphi  $} together with the chain rule 
{$ {\moverset{}{{\moverset{}{\frac{d}{d t}\hat{\rho}(t)}}}}=(\frac{d}{d \phi}\hat{\rho}) {\moverset{\mathbf{.}}{\phi}}(t)=\hat{\phi}(t){\moverset{\mathbf{.}}{\phi}}(t) $}. The dependency of curvilinear unit vectors on the coordinates is automatically taken into account when differentiating due to the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Setup}{Setup} setting \textit{geometricdifferentiation = true}. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
For the acceleration,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(169)},t) $}

% \mapleresult
\begin{dmath}\label{(170)}
{\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)=\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
where the term involving 
{$ {\moverset{\mathbf{.}}{\phi}}(t)^{2} $} comes from differentiating 
{$ \hat{\phi}(t) $} in \mapleref{(169)} taking into account the dependency of 
{$ \hat{\phi} $} on the coordinate 
{$ \varphi . $} This result can also be obtained by directly changing variables in the acceleration 
{$ {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t) $}, in equation \mapleref{(156)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{lhs} (\mapleref{(156)})=\mathit{ChangeBasis} (\mathit{rhs} (\mapleref{(156)}),\mathit{cylindrical} ,\mathit{alsocomponents}) $}

% \mapleresult
\begin{dmath}\label{(171)}
{\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)=\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Newton's 2\textsuperscript{nd} law becomes
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{F\_} (t)=\,m \cdot \mathit{rhs} (\mapleref{(170)}) $}

% \mapleresult
\begin{dmath}\label{(172)}
{\moverset{\rightarrow}{F}}\! \left(t \right)=m \left(\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}\right)
\end{dmath}
\begin{Maple Normal}
In the absence of external forces, equating to 0 the vector components (coefficients of the unit vectors) of the acceleration 
{$ {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t) $} we get the system of differential equations for 
{$ \rho (t),\phi (t),z (t) $} whose solution is the trajectory of the particle in cylindrical coordinates
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} ([\hat{\rho}(t),\hat{\phi}(t),\hat{k}]\,.\,\mathit{rhs} (\mapleref{(170)}))\mequaltilde \,0 $}

% \mapleresult
\begin{dmath}\label{(173)}
\left[{\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2} \hiderel{=} 0,2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hiderel{=} 0,{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{solve} (\mapleref{(173)},\mathit{diff} (\{\rho (t),\varphi (t),z (t)\},t ,t)) $}

% \mapleresult
\begin{dmath}\label{(174)}
\left\{{\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hiderel{=} -\frac{2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)}{\rho \! \left(t \right)},{\moverset{\mathbf{..}}{\rho}}\! \left(t \right) \hiderel{=} \rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2},{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0\right\}
\end{dmath}
\begin{Maple Normal}
In this formulation \mapleref{(174)} with 
{$ {\moverset{\rightarrow}{F}}(t)=0 $}, although 
{$ {\moverset{\mathbf{..}}{\mathrm{z}}}(t)=0 $}, no acceleration in the 
{$ \hat{k} $} direction, is naturally expected, the same cannot be said about the other two equations for 
{$ {\moverset{\mathbf{..}}{\phi}}(t) $} and 
{$ {\moverset{\mathbf{..}}{\rho}}(t) $}, discussed below under \textbf{Coriolis and Centripetal forces}. The key observation at this point, however, is that the right-hand sides of both unexpected equations involve 
{$ {\moverset{\mathbf{.}}{\phi}}(t) $}, \textit{rotation} around the \textit{z} axis.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Tensor notation}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The same equations \mapleref{(172)} and \mapleref{(174)} result when using tensor notation. For that purpose, one can transform the position, velocity and acceleration tensors \mapleref{(159)}, \mapleref{(160)}, \mapleref{(161)}, but since they are expressed as functions of a parameter (the time), it is simpler to \textit{transform only the underlying metric }using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-TransformCoordinates}{TransformCoordinates}. That has the advantage that all the geometrical subtleties of curvilinear coordinates, like scale factors and dependency of unit vectors on curvilinear coordinates, get automatically, succinctly, encoded in the metric:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TransformCoordinates} (\mathit{tr} ,\textit{g\_} [j ,k],[\mathrm{rho},\mathrm{phi},z],\mathit{setmetric})\colon  $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Coordinates}\mathit{:} [\rho,\phi,z] \mathit{.}\mathit{\,Signature}\mathit{:} (\mathit{+}\mathit{+}\mathit{+})\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[{g{\idn{a}\idn{b}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & \rho^{2} & 0 
\\
 0 & 0 & 1 
\end{array}\right]\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(175)}
 \underline{\hspace{68.75 ex}}
\end{dmath}
\begin{Maple Normal}
The computation of geodesics assumes that the coordinates 
{$ (\rho ,\varphi ,z) $} depend on a parameter. That parameter is passed as the first argument to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Geodesics}{Geodesics}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Geodesics} (t) $}

% \mapleresult
\begin{dmath}\label{(176)}
\left[{\moverset{\mathbf{..}}{\rho}}\! \left(t \right) \hiderel{=} \rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2},{\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hiderel{=} -\frac{2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)}{\rho \! \left(t \right)},{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0\right]
\end{dmath}
\begin{Maple Normal}
These equations of motion \mapleref{(176)} are the same as the equations \mapleref{(174)} computed using standard vector notation, differentiating and taking into account the dependency of curvilinear unit vectors on the curvilinear coordinates in \mapleref{(169)} and \mapleref{(170)}.  One of the interesting features of computing with tensors is, as said, that the geometrical subtleties of curvilinear coordinates are automatically encoded in the metric \mapleref{(175)}. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
To understand how are the geodesic equations computed in one go in \mapleref{(176)}, one can perform the calculation in steps: 
\end{Maple Normal}
\begin{Maple Ordered List 1}
\item Make 
{$ \rho  $} be a function of 
{$ t  $} directly in the metric
\item Compute - not the final form of the equations \mapleref{(176)} - but the intermediate form expressing the geodesic equation using tensor notation, in terms of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Christoffel}{Christoffel symbols}
\item Compute the components of that tensorial equation for the geodesic (using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-TensorArray}{TensorArray})
\end{Maple Ordered List 1}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
For step 1, we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} (\mathrm{rho}=\,\mathrm{rho}(t),\textit{g\_} []) $}

% \mapleresult
\begin{dmath}\label{(177)}
{g{\idn{a}\idn{b}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & \rho \! \left(t \right)^{2} & 0 
\\
 0 & 0 & 1 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
Set this metric where 
{$ \rho \esequiv \rho (t) $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mapleref{(177)})\colon  $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Coordinates}\mathit{:} [\rho,\phi,z] \mathit{.}\mathit{\,Signature}\mathit{:} (\mathit{+}\mathit{+}\mathit{+})\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[{g{\idn{a}\idn{b}}}=\left[\begin{array}{ccc}
1 & 0 & 0 
\\
 0 & \rho (t)^{2} & 0 
\\
 0 & 0 & 1 
\end{array}\right]\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(178)}
 \underline{\hspace{68.75 ex}}
\end{dmath}
\begin{Maple Normal}
For step 2, the geodesic equations in tensor notation with the coordinates depending on the time \textit{t} are computed passing the optional argument \textit{tensornotation}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Geodesics} (t ,\mathit{tensornotation}) $}

% \mapleresult
\begin{dmath}\label{(179)}
{\moverset{\mathbf{..}}{{X{\iup{}\iup{a}}}}}\! \left(t \right)+{\Gamma{\iup{}\iup{a}\idn{b}\idn{c}}} {\moverset{\mathbf{.}}{{X{\iup{}\iup{b}}}}}\! \left(t \right) {\moverset{\mathbf{.}}{{X{\iup{}\iup{c}}}}}\! \left(t \right)=0
\end{dmath}
\begin{Maple Normal}
Step 3: compute the components of this tensorial equation
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TensorArray} (\mapleref{(179)},\mathit{output} =\mathit{listofequations}) $}

% \mapleresult
\begin{dmath}\label{(180)}
\left[{\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2} \hiderel{=} 0,\frac{2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)}{\rho \! \left(t \right)} \hiderel{=} 0,{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0\right]
\end{dmath}
\begin{Maple Normal}
These are the same equations \mapleref{(176)}. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Having the tensorial equation \mapleref{(179)} is also useful to formulate the equations of motion in the presence of force. For that purpose, redefine the contravariant tensor 
{$ F^{j} $} to represent the force in the cylindrical basis
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (F [\mtilde j]=[F_{\rho}(t),F_{\varphi}(t),F_{z}(t)]) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,objects\,with\,tensor\,properties\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(181)}
\left\{{\triangledown{\idn{a}}},{\textcolor{olive}{\gamma}{\idn{a}}},{F{\idn{j}}},{\textcolor{olive}{\sigma}{\idn{a}}},{R{\idn{a}\idn{b}}},{R{\idn{a}\idn{b}\idn{c}\idn{d}}},{C{\idn{a}\idn{b}\idn{c}\idn{d}}},{\partial{\idn{a}}},{g{\idn{a}\idn{b}}},{\Gamma{\idn{a}\idn{b}\idn{c}}},{G{\idn{a}\idn{b}}},{\epsilon{\idn{a}\idn{b}\idn{c}}},{X{\idn{a}}}\right\}
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Newton's 2\textsuperscript{nd} law \mapleref{(172)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(172)} $}

% \mapleresult
\begin{dmath}\label{(182)}
{\moverset{\rightarrow}{F}}\! \left(t \right)=m \left(\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}\right)
\end{dmath}
\begin{Maple Normal}
now using tensorial notation, becomes
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} F [\mtilde a]=\,m \cdot \mathit{lhs} (\mapleref{(179)}) $}

% \mapleresult
\begin{dmath}\label{(183)}
{F{\iup{}\iup{a}}}=m \left({\moverset{\mathbf{..}}{{X{\iup{}\iup{a}}}}}\! \left(t \right)+{\Gamma{\iup{}\iup{a}\idn{b}\idn{c}}} {\moverset{\mathbf{.}}{{X{\iup{}\iup{b}}}}}\! \left(t \right) {\moverset{\mathbf{.}}{{X{\iup{}\iup{c}}}}}\! \left(t \right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TensorArray} (\mapleref{(183)}) $}

% \mapleresult
\begin{dmath}\label{(184)}
\left[\begin{array}{ccc}
F_{\rho}\! \left(t \right)=m \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right) & F_{\phi}\! \left(t \right)=\frac{m \left(2 {\moverset{\mathbf{.}}{\rho}}\left(t \right) {\moverset{\mathbf{.}}{\phi}}\left(t \right)+\rho \left(t \right) {\moverset{\mathbf{..}}{\phi}}\left(t \right)\right)}{\rho \left(t \right)} & F_{z}\! \left(t \right)=m {\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
where we recall (see \href{https://www.mapleprimes.com/posts/212253-Vectors-In-Spherical-Coordinates-Using}{related Mapleprimes post}) that to obtain the \textit{vector} components entering 
{$ {\moverset{\rightarrow}{F}}(t) $} from these \textit{tensor} components 
{$ {F{\iup{}\iup{a}}} $} we need to multiply the latter by the scale factors 
{$ (1,\rho (t),1) $}, and so, the component of 
{$ {\moverset{\rightarrow}{F}}(t) $} in the direction of 
{$ \hat{\phi} $} is equal to 
{$ \rho (t)\cdot m ({\moverset{\mathbf{..}}{\phi}}(t)+\frac{2 {\moverset{\mathbf{.}}{\rho}}(t) {\moverset{\mathbf{.}}{\phi}}(t)}{\rho (t)}) $}.
\end{Maple Normal}
\subsubsection{\label{bkmrk16}\textbf{\textit{Coriolis force and centripetal force}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
After changing variables the position vector 
{$ {\moverset{\rightarrow}{r}}(t) $} got expressed in \mapleref{(168)} as
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\moverset{\rightarrow}{r}}(t)=z (t) \hat{k}+\hat{\rho}(t) \rho (t) $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
A distinction needs to be made here, according to whether the unit vector 
{$ \hat{\rho} $} depends or not on the time 
{$ t  $}, the former being the general case. When 
{$ \hat{\rho} $} is a constant, the value of the coordinate 
{$ \varphi  $} - the angle between 
{$ \hat{\rho} $} and the \textit{x} axis - does not change, there is \textbf{\textit{no rotation}} around the \textit{z} axis. On the other hand, when 
{$ \hat{\rho}\esequiv \hat{\rho}(t) $}, the orientation of 
{$ \hat{\rho} $} and so the coordinate 
{$ \varphi  $} changes with time, so either the force 
{$ {\moverset{\rightarrow}{F}}(t) $} acting on the particle has a component in the 
{$ \hat{\phi} $} direction that produces rotation around the z axis, or \textit{the system of references - itself - is rotating around the z axis.}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Likewise, the expression \mapleref{(168)}  can represent the position vector measured in the original Galilean (inertial) system of references, where a force 
{$ {\moverset{\rightarrow}{F}}(t) $} is producing rotation around the \textit{z} axis, or it can represent the position of the particle measured in a rotating, non-inertial system references. Hence the transformation \mapleref{(167)} can also be interpreted in two different ways, as representing a choice of different functions (generalized coordinates) to represent the position of the particle in the original inertial system of references, or it can represent a transformation from an inertial to another rotating, non-inertial, system of references.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
This equivalence between the trajectory of a particle subject to an external force, as observed in an inertial system of references, and the same trajectory observed from a non-inertial accelerated system of references where there is no external force, actually at the root of the formulation of general relativity, is also well known in classical mechanics. The (apparent) forces observed in the rotating non-inertial system of references, due only to its acceleration, are called \textit{Coriolis} and \textit{centripetal} forces.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
To see that the equations 
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}

{$ {\moverset{\mathbf{..}}{\rho}}(t)={\moverset{\mathbf{.}}{\phi}}(t)^{2} \rho (t) $},  
{$ {\moverset{\mathbf{..}}{\phi}}(t)=-\frac{2 {\moverset{\mathbf{.}}{\phi}}(t) {\moverset{\mathbf{.}}{\rho}}(t)}{\rho (t)} $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
that appeared in \mapleref{(180)} when in the inertial system of references 
{$ {\moverset{\rightarrow}{F}}(t)=m {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t)=0 $}, are related to the Coriolis and centripetal forces in the non-inertial referential, following \textbf{[1]} introduce a vector 
{$ {\moverset{\rightarrow}{\omega}} $} representing the rotation of that referential around the \textit{z} axis (when, in the inertial system of references, the non-inertial system rotates clockwise, in the non-inertial system 
{$ \varphi  $} increases in value in the anti\textit{-}clockwise direction)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} {\moverset{\rightarrow}{\omega}}=-{\moverset{\mathbf{.}}{\phi}}(t) \hat{k} $}

% \mapleresult
\begin{dmath}\label{(185)}
{\moverset{\rightarrow}{\omega}}=-{\moverset{\mathbf{.}}{\phi}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
According to \textbf{[1]}, (39.7), the acceleration 
{$ {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t) $} in the inertial system is expressed in terms of the quantities in the non-inertial rotating system by the sum of the following three vectorial terms. First, the components of the acceleration 
{$ {\moverset{\rightarrow}{a}}(t) $} measured in the non-inertial system are given by the second derivatives of the coordinates 
{$ (\rho (t),\varphi (t),z (t)) $} multiplied by the scale factors, which in this case are given by 
{$ (1,\rho (t),1) $} (see \href{https://www.mapleprimes.com/posts/212253-Vectors-In-Spherical-Coordinates-Using}{this post in Mapleprimes})
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} {\moverset{\rightarrow}{a}}(t)={\moverset{\mathbf{..}}{\rho}}(t) \hat{\rho}(t)+\rho (t) {\moverset{\mathbf{..}}{\phi}}(t) \hat{\phi}(t)+{\moverset{\mathbf{..}}{\mathrm{z}}}(t) \hat{k} $}

% \mapleresult
\begin{dmath}\label{(186)}
{\moverset{\rightarrow}{a}}\! \left(t \right)={\moverset{\mathbf{..}}{\rho}}\! \left(t \right) \hat{\rho}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hat{\phi}\! \left(t \right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
Second, the Coriolis force divided by the mass, by definition given by 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} 2 \mapleref{(169)}\times \mapleref{(185)} $}

% \mapleresult
\begin{dmath}\label{(187)}
2 {\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}=-2 \rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2} \hat{\rho}\! \left(t \right)+2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right) \hat{\phi}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
Third the centripetal force divided by the mass, defined by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(185)}\times (\mapleref{(168)}\times \mapleref{(185)}) $}

% \mapleresult
\begin{dmath}\label{(188)}
{\moverset{\rightarrow}{\omega}}\times \left({\moverset{\rightarrow}{r}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}\right)=\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2} \hat{\rho}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
Adding these three terms,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(186)}+\mapleref{(187)}+\mapleref{(188)} $}

% \mapleresult
\begin{dmath}\label{(189)}
{\moverset{\rightarrow}{a}}\! \left(t \right)+2 {\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}+{\moverset{\rightarrow}{\omega}}\times \left({\moverset{\rightarrow}{r}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}\right)=\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
where the right-hand side of \mapleref{(189)} is the result computed in \mapleref{(171)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(171)} $}

% \mapleresult
\begin{dmath}\label{(190)}
{\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)=\hat{\rho}\! \left(t \right) \left({\moverset{\mathbf{..}}{\rho}}\! \left(t \right)-\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}\right)+\hat{\phi}\! \left(t \right) \left(2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)\right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}
\end{dmath}
\begin{Maple Normal}
So that
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t)=\mathit{lhs} (\mapleref{(189)}) $}

% \mapleresult
\begin{dmath}\label{(191)}
{\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)={\moverset{\rightarrow}{a}}\! \left(t \right)+2 {\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}+{\moverset{\rightarrow}{\omega}}\times \left({\moverset{\rightarrow}{r}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}\right)
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
From this result, in the absence of external forces, 
{$ {\moverset{\mathbf{..}}{{\moverset{\rightarrow}{r}}}}(t)=0 $} and the acceleration 
{$ {\moverset{\rightarrow}{a}}(t) $} measured in the rotating system is given by the sum of the Coriolis and centripetal accelerations
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{isolate} (\mathit{rhs} (\mapleref{(191)}),{\moverset{\rightarrow}{a}}(t)) $}

% \mapleresult
\begin{dmath}\label{(192)}
{\moverset{\rightarrow}{a}}\! \left(t \right)=-2 {\moverset{\mathbf{.}}{{\moverset{\rightarrow}{r}}}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}-{\moverset{\rightarrow}{\omega}}\times \left({\moverset{\rightarrow}{r}}\! \left(t \right)\times {\moverset{\rightarrow}{\omega}}\right)
\end{dmath}
\begin{Maple Normal}
In conclusion: in the absence of external forces, the acceleration of a particle observed in a rotating (\textit{non-inertial}) system of references is not zero. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Expressing this equation \mapleref{(192)} in terms of 
{$ (\rho (t),\varphi (t),z (t)) $} we get
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} (\mapleref{(186)},-\mapleref{(187)},\mapleref{(188)},\mapleref{(192)}) $}

% \mapleresult
\begin{dmath}\label{(193)}
{\moverset{\mathbf{..}}{\rho}}\! \left(t \right) \hat{\rho}\! \left(t \right)+\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hat{\phi}\! \left(t \right)+{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hat{k}=\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2} \hat{\rho}\! \left(t \right)-2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right) \hat{\phi}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
resulting in the three equations
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(193)}\,.\,\hat{\rho}(t) $}

% \mapleresult
\begin{dmath}\label{(194)}
{\moverset{\mathbf{..}}{\rho}}\! \left(t \right)=\rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(193)}\,.\,\hat{\phi}(t) $}

% \mapleresult
\begin{dmath}\label{(195)}
\rho \! \left(t \right) {\moverset{\mathbf{..}}{\phi}}\! \left(t \right)=-2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(193)}\,.\, \hat{k} $}

% \mapleresult
\begin{dmath}\label{(196)}
{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right)=0
\end{dmath}
\begin{Maple Normal}
which are the equations returned by \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics:-Geodesics}{Geodesics} in \mapleref{(176)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(176)} $}

% \mapleresult
\begin{dmath}\label{(197)}
\left[{\moverset{\mathbf{..}}{\rho}}\! \left(t \right) \hiderel{=} \rho \! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)^{2},{\moverset{\mathbf{..}}{\phi}}\! \left(t \right) \hiderel{=} -\frac{2 {\moverset{\mathbf{.}}{\rho}}\! \left(t \right) {\moverset{\mathbf{.}}{\phi}}\! \left(t \right)}{\rho \! \left(t \right)},{\moverset{\mathbf{..}}{\mathrm{z}}}\! \left(t \right) \hiderel{=} 0\right]
\end{dmath}
\begin{Maple Normal}
\textbf{References}
\end{Maple Normal}
\begin{Maple Normal}
[1] L.D. Landau, E.M. Lifchitz, Mechanics, Course of Theoretical Physics, Volume 1, third edition, Elsevier.
\end{Maple Normal}
\section{\label{bkmrk17}\textbf{Electrodynamics}}
\subsection{\label{bkmrk18}\textbf{\textit{Potential }}\(\! \Phi  \!\)\textbf{\textit{ and electric field }}\(\! \boldsymbol{{\moverset{\mathbf{\rightarrow}}{\mathbf{E}}}} \!\)\textbf{\textit{ of a charged disk}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
Calculate the potential 
{$ \Phi  $} and the electric field 
{$ {\moverset{\rightarrow}{E}} $} of a disc of radius \textit{a,} loaded with a surface density of charge 
{$ \sigma  $} (constant), in points of an axis perpendicular to the disk and passing through its center.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
Given the potential 
{$ \Phi  $}, the general expression of the electric field 
{$ {\moverset{\rightarrow}{E}} $} is 
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\moverset{\rightarrow}{E}}=-\triangledown (\Phi) $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
In turn, the general expression for the potential 
{$ \Phi  $} of a distribution of charges over a surface is given by
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle \Phi ({\moverset{\rightarrow}{r}})=\int_{\Sigma}^{}\frac{\sigma ({\moverset{\rightarrow}{R}})}{{| {\moverset{\rightarrow}{R}}-{\moverset{\rightarrow}{r}}|}}d s  $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where 
{$ {\moverset{\rightarrow}{r}} $} is the position vector of any point in space, 
{$ {\moverset{\rightarrow}{R}} $} is the position vector of any point of the disk, and 
{$ \mathit{ds}  $} is the surface element; the above expression is a surface integral with 
{$ \Sigma  $} representing the integration domain.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The expression for the electric field 
{$ {\moverset{\rightarrow}{E}} $} as the gradient of the potential 
{$ \Phi  $}can be entered as
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} \coloneqq -\mathit{\%\!Gradient} (\mathrm{Phi}) $}

% \mapleresult
\begin{dmath}\label{(198)}
{\moverset{\rightarrow}{E}}\coloneqq -\textcolor{gray}{\nabla}\Phi 
\end{dmath}
\begin{Maple Normal}
where in the above we are using the \textit{inert} form of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors/Gradient}{Gradient} command. The expression for 
{$ \Phi  $} in turn can be entered as a double integral in cylindrical coordinates 
{$ (\rho ,\varphi ,z) $}; the element of surface of a disk in these coordinates is 
{$ \rho  \mathrm{d}\rho \mathrm{d}\phi  $}, with 
{$ \rho  $} varying from 0 to \textit{a }and 
{$ \phi  $} from 0 to 
{$ 2 \pi  $} .
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}\coloneqq \mathit{Int} (\mathit{Int} (\frac{\mathrm{sigma}\,\mathrm{rho}}{\mathit{Norm} (\textit{r\_} -\textit{R\_})},\mathrm{rho}=\,0..a),\mathrm{phi}=\,0..2\,\mathrm{Pi}) $}

% \mapleresult
\begin{dmath}\label{(199)}
\Phi \coloneqq {\textcolor{gray}{\int}}_{\!\!\!0}^{2 \pi}{\textcolor{gray}{\int}}_{\!\!\!0}^{a}\frac{\sigma  \rho}{{\|{\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{R}}\|}}\textcolor{gray}{d}\rho \textcolor{gray}{d}\phi 
\end{dmath}
\begin{Maple Normal}
We choose the origin of the system of references to be the center of the disk and the \textit{z} axis oriented perpendicular to the disk. In this system of references, the position vector of a point over the \textit{z} axis is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(200)}
{\moverset{\rightarrow}{r}}\coloneqq z \hat{k}
\end{dmath}
\begin{Maple Normal}
and the position vector of a point of the disk is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} \coloneqq \mathrm{rho}\,\textit{\_rho}  $}

% \mapleresult
\begin{dmath}\label{(201)}
{\moverset{\rightarrow}{R}}\coloneqq \rho  \hat{\rho}
\end{dmath}
\begin{Maple Normal}
The value of the potential 
{$ \Phi  $} for 
{$ z >0 $} can now be computed.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}\coloneqq \mathit{value} (\mathrm{Phi})\,\mathrm{assuming}\,z \,>\,0 $}

% \mapleresult
\begin{dmath}\label{(202)}
\Phi \coloneqq -2 z \sigma  \pi +2 \sqrt{a^{2}+z^{2}}\, \sigma  \pi 
\end{dmath}
\begin{Maple Normal}
From this we get 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_}  $}

% \mapleresult
\begin{dmath}\label{(203)}
-\textcolor{gray}{\nabla}\left(-2 z \sigma  \pi +2 \sqrt{a^{2}+z^{2}}\, \sigma  \pi \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} \coloneqq \mathit{value} (\mapleref{(203)}) $}

% \mapleresult
\begin{dmath}\label{(204)}
{\moverset{\rightarrow}{E}}\coloneqq \frac{2 \pi  \sigma  \left(\sqrt{a^{2}+z^{2}}-z \right) \hat{k}}{\sqrt{a^{2}+z^{2}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,}  $}

\subsection{\label{bkmrk19}\textbf{\textit{Magnetic field }}\(\! \boldsymbol{{\moverset{\mathbf{\rightarrow}}{\mathbf{H}}}} \!\)\textbf{\textit{ of a rotating charged disk}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
A disk of radius \textit{a}, uniformly charged with a surface density of charge 
{$ \sigma , $} rotates around its axis with a constant angular velocity 
{$ {\moverset{.}{\phi}}=\omega  $}, where 
{$ \phi  $} is the cylindrical coordinate (the polar angle). Calculate the magnetic field on the axis of the disk.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
The expression of the magnetic field 
{$ {\moverset{\rightarrow}{H}}({\moverset{\rightarrow}{r}}) $} due to a current of charges 
{$ {\moverset{\rightarrow}{J}}({\moverset{\rightarrow}{R}}) $} is
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\moverset{\rightarrow}{H}}({\moverset{\rightarrow}{r}})=\int_{\Sigma}^{}\frac{{\moverset{\rightarrow}{J}}({\moverset{\rightarrow}{R}})\times ({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{R}})}{c {| {\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{R}}|}^{3}}d s  $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
where 
{$ {\moverset{\rightarrow}{r}} $} is the position vector of any point in space, 
{$ {\moverset{\rightarrow}{R}} $} is the position vector of any point where the current exists, in this case a disk of radius \textit{a}, and 
{$ \mathit{ds}  $} is the surface element. 
{$ \Sigma  $} represents the integration domain and the above expression is a surface integral.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The expression for 
{$ {\moverset{\rightarrow}{H}} $} can be entered as a double integral in cylindrical coordinates
{$ (\rho ,\varphi ,z) $}; the element of the surface of a disk in these coordinates is 
{$ \rho  \mathrm{d}\rho \mathrm{d}\phi  $}, with 
{$ \rho  $} varying from 0 to \textit{a }and 
{$ \phi  $} from 0 to 
{$ 2 \pi  $}, and to input the cross product you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{H\_} \coloneqq \mathit{Int} (\mathit{Int} (\textit{J\_} \times \frac{(\textit{r\_} -\textit{R\_})}{c \,\mathit{Norm} (\textit{r\_} -\textit{R\_})^{3}}\,\mathrm{rho},\mathrm{rho}=\,0..a),\mathrm{phi}=\,0..2\,\mathrm{Pi}) $}

% \mapleresult
\begin{dmath}\label{(205)}
{\moverset{\rightarrow}{H}}\coloneqq {\textcolor{gray}{\int}}_{\!\!\!0}^{2 \pi}{\textcolor{gray}{\int}}_{\!\!\!0}^{a}\frac{\left({\moverset{\rightarrow}{J}}\times \left({\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{R}}\right)\right) \rho}{c {\|{\moverset{\rightarrow}{r}}-{\moverset{\rightarrow}{R}}\|}^{3}}\textcolor{gray}{d}\rho \textcolor{gray}{d}\phi 
\end{dmath}
\begin{Maple Normal}
We choose the system of references as in the previous problem, with the origin in the center of the disk, and the \textit{z} axis oriented perpendicular to the disk. So again the position vector of a point over the z axis is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(206)}
{\moverset{\rightarrow}{r}}\coloneqq z \hat{k}
\end{dmath}
\begin{Maple Normal}
and the position vector of a point of the disk is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} \coloneqq \mathrm{rho}\,\textit{\_rho}  $}

% \mapleresult
\begin{dmath}\label{(207)}
{\moverset{\rightarrow}{R}}\coloneqq \rho  \hat{\rho}
\end{dmath}
\begin{Maple Normal}
By definition, the current 
{$ {\moverset{\rightarrow}{J}} $} at a point 
{$ {\moverset{\rightarrow}{R}} $} is equal to the value of the density of charge times the velocity of this charge; that is,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{J\_} \coloneqq \mathrm{sigma}\,\textit{V\_}  $}

% \mapleresult
\begin{dmath}\label{(208)}
{\moverset{\rightarrow}{J}}\coloneqq \sigma  {\moverset{\rightarrow}{V}}
\end{dmath}
\begin{Maple Normal}
Finally, the velocity 
{$ {\moverset{\rightarrow}{V}} $} of a point 
{$ {\moverset{\rightarrow}{R}} $} of the disk can be computed as the derivative of 
{$ {\moverset{\rightarrow}{R}} $} with respect to \textit{t} (the time), and in doing so we need to take into account that the unit vector 
{$ \hat{\rho} $} varies with time because it depends on the angle 
{$ \phi  $} and the disk is rotating. This derivative of 
{$ {\moverset{\rightarrow}{R}} $} can be computed in different ways. The simplest way is to state that the unit vector 
{$ \hat{\rho} $} is a function of time \textit{t} and differentiate:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{rho}\,\cdot \,\textit{\_rho} (t) $}

% \mapleresult
\begin{dmath}\label{(209)}
\rho  \hat{\rho}\! \left(t \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(209)},t) $}

% \mapleresult
\begin{dmath}\label{(210)}
\rho  \left(\frac{d}{d t}\phi \! \left(t \right)\right) \hat{\phi}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
Removing now the dependency on \textit{t} and renaming 
{$  {\moverset{\mathbf{.}}{\phi}}\esequiv \omega  $}, we get 
{$ {\moverset{\rightarrow}{V}}=\omega  \rho  \hat{\phi} $}. \

\

Another way, step-by-step, is to make explicit this dependence of  
{$ \hat{\rho} $} on 
{$ \phi  $} by changing the basis onto which 
{$ {\moverset{\rightarrow}{R}} $} is projected from the cylindrical to the Cartesian basis.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ChangeBasis} (\textit{R\_} ,1) $}

% \mapleresult
\begin{dmath}\label{(211)}
\rho  \cos \! \left(\phi \right) \hat{i}+\rho  \sin \! \left(\phi \right) \hat{j}
\end{dmath}
\begin{Maple Normal}
Now make 
{$ \phi  $} depend on \textit{t} and differentiate.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{subs} (\mathrm{phi}=\,\mathrm{phi}(t),\mapleref{(211)}) $}

% \mapleresult
\begin{dmath}\label{(212)}
\rho  \cos \! \left(\phi \! \left(t \right)\right) \hat{i}+\rho  \sin \! \left(\phi \! \left(t \right)\right) \hat{j}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (\mapleref{(212)},t)\, $}

% \mapleresult
\begin{dmath}\label{(213)}
-\rho  \left(\frac{d}{d t}\phi \! \left(t \right)\right) \sin \! \left(\phi \! \left(t \right)\right) \hat{i}+\rho  \left(\frac{d}{d t}\phi \! \left(t \right)\right) \cos \! \left(\phi \! \left(t \right)\right) \hat{j}
\end{dmath}
\begin{Maple Normal}
You recover the result \mapleref{(210)} changing to the cylindrical basis
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ChangeBasis} (\mapleref{(213)},\mathit{cylindrical}) $}

% \mapleresult
\begin{dmath}\label{(214)}
\rho  \left(\frac{d}{d t}\phi \! \left(t \right)\right) \hat{\phi}\! \left(t \right)
\end{dmath}
\begin{Maple Normal}
Introduce 
{$ {\moverset{.}{\phi}}(t)=\omega  $}, and remove the explicit dependence of 
{$ \phi  $} with respect to \textit{t} to arrive at an expression for 
{$ {\moverset{\rightarrow}{V}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{factor} (\mathit{subs} ([\mathit{diff} (\mathrm{phi}(t),t)=\,\mathrm{omega},\mathrm{phi}(t)=\,\mathrm{phi}],\mapleref{(213)})) $}

% \mapleresult
\begin{dmath}\label{(215)}
\omega  \rho  \left(-\sin \! \left(\phi \right) \hat{i}+\cos \! \left(\phi \right) \hat{j}\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ChangeBasis} (\mapleref{(215)},\mathit{cylindrical}) $}

% \mapleresult
\begin{dmath}\label{(216)}
\rho  \omega  \hat{\phi}
\end{dmath}
\begin{Maple Normal}
Yet another manner, knowing that 
{$ \hat{\rho} $} and so 
{$ {\moverset{\rightarrow}{R}}=\rho  $}
{$ \hat{\rho} $} depends on the time only through 
{$ \phi  $}, you can compute 
{$ {\moverset{.}{{\moverset{\rightarrow}{R}}}} $} = 
{$ {\moverset{.}{\phi}} $}
{$ \frac{d}{d \phi}{\moverset{\rightarrow}{R}}(\phi)= \omega \frac{d}{d \phi}{\moverset{\rightarrow}{R}}(\phi) $}. So, differentiating
{$ {\moverset{\rightarrow}{R}} $} with respect to 
{$ \varphi  $} we also get
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{V\_} \coloneqq \mathrm{omega}\,\cdot \,\mathit{diff} (\textit{R\_} ,\mathrm{phi}) $}

% \mapleresult
\begin{dmath}\label{(217)}
{\moverset{\rightarrow}{V}}\coloneqq \rho  \omega  \hat{\phi}
\end{dmath}
\begin{Maple Normal}
At this point, we have all the quantities defined in the system of coordinates chosen and in terms of the constant angular velocity, 
{$ \omega  $}, and the radius of the disk, \textit{a. }The expression of the magnetic field looks like
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{H\_}  $}

% \mapleresult
\begin{dmath}\label{(218)}
{\textcolor{gray}{\int}}_{\!\!\!0}^{2 \pi}{\textcolor{gray}{\int}}_{\!\!\!0}^{a}\frac{\left(\sigma  \,\rho^{2} \omega  \hat{k}+\sigma  \rho  \omega  z \hat{\rho}\right) \rho}{c \left(\rho^{2}+z^{2}\right)^{\frac{3}{2}}}\textcolor{gray}{d}\rho \textcolor{gray}{d}\phi 
\end{dmath}
\begin{Maple Normal}
However, to perform the integrals, we still need to express 
{$ \hat{\rho} $} as a function of 
{$ \phi  $}, one of the integration variables. For that purpose, it suffices to change the vectors involved (
{$ {\moverset{\rightarrow}{R}} $} and 
{$ {\moverset{\rightarrow}{V}} $}) to the Cartesian basis.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{R\_} \coloneqq \mathit{ChangeBasis} (\textit{R\_} ,1) $}

% \mapleresult
\begin{dmath}\label{(219)}
{\moverset{\rightarrow}{R}}\coloneqq \rho  \cos \! \left(\phi \right) \hat{i}+\rho  \sin \! \left(\phi \right) \hat{j}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{V\_} \coloneqq \mathit{ChangeBasis} (\textit{V\_} ,1) $}

% \mapleresult
\begin{dmath}\label{(220)}
{\moverset{\rightarrow}{V}}\coloneqq -\rho  \omega  \sin \! \left(\phi \right) \hat{i}+\rho  \omega  \cos \! \left(\phi \right) \hat{j}
\end{dmath}
\begin{Maple Normal}
With this change, 
{$ {\moverset{\rightarrow}{H}} $} looks like
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{H\_}  $}

% \mapleresult
\begin{dmath}\label{(221)}
{\textcolor{gray}{\int}}_{\!\!\!0}^{2 \pi}{\textcolor{gray}{\int}}_{\!\!\!0}^{a}\frac{\left(\cos \! \left(\phi \right) \omega  \rho  \sigma  z \hat{i}+\sin \! \left(\phi \right) \omega  \rho  \sigma  z \hat{j}+\sigma  \,\rho^{2} \omega  \hat{k}\right) \rho}{c \left(\rho^{2} \cos \! \left(\phi \right)^{2}+\rho^{2} \sin \! \left(\phi \right)^{2}+z^{2}\right)^{\frac{3}{2}}}\textcolor{gray}{d}\rho \textcolor{gray}{d}\phi 
\end{dmath}
\begin{Maple Normal}
and so the integrals can be performed, leading to the desired value of the magnetic field 
{$ {\moverset{\rightarrow}{H}} $} on the axis of the rotating disk.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{H\_} \coloneqq \mathit{value} (\textit{H\_})\,\mathrm{assuming}\,a \,>\,0,z \,>\,0 $}

% \mapleresult
\begin{dmath}\label{(222)}
{\moverset{\rightarrow}{H}}\coloneqq -\frac{2 \omega  \sigma  \pi  \hat{k} \left(2 \sqrt{a^{2}+z^{2}}\, z -a^{2}-2 z^{2}\right)}{\sqrt{a^{2}+z^{2}}\, c}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,}  $}

\subsection{\label{bkmrk20}\textbf{\textit{Magnetic potential }}\(\! {\moverset{\mathbf{\rightarrow}}{\mathbf{A}}} \!\)\textbf{\textit{ and field }}\(\! \boldsymbol{{\moverset{\mathbf{\rightarrow}}{\mathbf{H}}}} \!\)\textbf{\textit{ of an oscillating distribution of currents }}\(\! \boldsymbol{{\moverset{\mathbf{\rightarrow}}{\mathbf{J}}}} \!\) }
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}
A distribution of currents 
{$ {\moverset{\rightarrow}{J}} $} varies according to
\end{Maple Normal}
\begin{center}
\begin{Maple Normal}
{$ \displaystyle {\moverset{\rightarrow}{J}}={\moverset{\rightarrow}{C}}_{} \cos ({\moverset{\rightarrow}{k}}\cdot {\moverset{\rightarrow}{r}}) $}
\end{Maple Normal}
\end{center}
\begin{Maple Normal}
for some constant vectors 
{$ {\moverset{\rightarrow}{C}}_{} $} and 
{$ {\moverset{\rightarrow}{k}} $}, where 
{$ {\moverset{\rightarrow}{r}} $} represents a point in space. Calculate the corresponding magnetic potential 
{$ {\moverset{\rightarrow}{A}}({\moverset{\rightarrow}{r}}) $} and magnetic field 
{$ {\moverset{\rightarrow}{H}}({\moverset{\rightarrow}{r}}) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\begin{Maple Normal}
Maxwell equations are gauge invariant, from where the potential 
{$ {\moverset{\rightarrow}{A}} $} is defined up to the 4-divergence of a 4-vector; we can always explore that freedom to "gauge" 
{$ {\moverset{\rightarrow}{A}} $} according to what may be convenient. For static problems, this means we can freely choose the value of 
{$ \nabla \cdot {\moverset{\rightarrow}{A}} $}; we choose here the Coulomb gauge, that is 
{$ \nabla \cdot {\moverset{\rightarrow}{A}}=0 $}. In this gauge, the expression of the magnetic potential 
{$ {\moverset{\rightarrow}{A}}({\moverset{\rightarrow}{r}}) $} and magnetic vector 
{$ {\moverset{\rightarrow}{H}}({\moverset{\rightarrow}{r}}) $} due to a current of charges 
{$ {\moverset{\rightarrow}{J}}({\moverset{\rightarrow}{r}}) $} are as follows:
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [1]\coloneqq \mathit{\%\!Laplacian} (\textit{A\_})=-4\,\mathrm{Pi}\,\frac{\textit{J\_}}{c} $}

% \mapleresult
\begin{dmath}\label{(223)}
\mathit{eq}_{1}\coloneqq {\textcolor{gray}{\nabla}}^{2}{\moverset{\rightarrow}{A}}=-\frac{4 \pi  {\moverset{\rightarrow}{J}}}{c}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [2]\coloneqq \textit{H\_} =\,\mathit{\%\!Curl} (\textit{A\_}) $}

% \mapleresult
\begin{dmath}\label{(224)}
\mathit{eq}_{2}\coloneqq {\moverset{\rightarrow}{H}}=\textcolor{gray}{\nabla}\times {\moverset{\rightarrow}{A}}
\end{dmath}
\begin{Maple Normal}
where in the above we are using the inert versions of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors,Laplacian}{Laplacian} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors,Curl}{Curl} commands; the computations will be performed by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=value}{value} command afterwards, when convenient. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Given 
{$ {\moverset{\rightarrow}{J}} $}, to compute 
{$ {\moverset{\rightarrow}{A}} $} we need to invert the Laplacian of 
{$ \mathit{eq}_{1} $}. Knowing that the Laplacian is a scalar operator, 
{$ {\moverset{\rightarrow}{A}} $} and 
{$ {\moverset{\rightarrow}{J}} $} are either parallel or antiparallel. In this example the solving approach can also be simplified by the fact that 
{$ {\moverset{\rightarrow}{J}} $} is a pure oscillating function of the position 
{$ {\moverset{\rightarrow}{r}} $}\textbf{,} the second derivative of the cosine function is proportional to itself, and the Laplacian involves second order derivatives with respect to the position. So we can directly search for 
{$ {\moverset{\rightarrow}{A}} $} proportional to 
{$ {\moverset{\rightarrow}{J}} $}; that is,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{A\_} \coloneqq \mathrm{alpha}\,\textit{J\_}  $}

% \mapleresult
\begin{dmath}\label{(225)}
{\moverset{\rightarrow}{A}}\coloneqq \alpha  {\moverset{\rightarrow}{J}}
\end{dmath}
\begin{Maple Normal}
where
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{J\_} \coloneqq \textit{C\_} \,\cos (\textit{k\_} \,.\,\textit{r\_}) $}

% \mapleresult
\begin{dmath}\label{(226)}
{\moverset{\rightarrow}{J}}\coloneqq {\moverset{\rightarrow}{C}} \cos \! \left({\moverset{\rightarrow}{k}}\cdot {\moverset{\rightarrow}{r}}\right)
\end{dmath}
\begin{Maple Normal}
Orienting the \textit{z} axis of the reference system in the direction of the constant vector 
{$ {\moverset{\rightarrow}{C}} $} , we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{C\_} \coloneqq \mathrm{abs}(C)\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(227)}
{\moverset{\rightarrow}{C}}\coloneqq {| C |} \hat{k}
\end{dmath}
\begin{Maple Normal}
where 
{$ {| C |} $} represents the module of 
{$ {\moverset{\rightarrow}{C}} $}. The vectors 
{$ {\moverset{\rightarrow}{k}} $} and 
{$ {\moverset{\rightarrow}{r}} $} are generic.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j} +z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(228)}
{\moverset{\rightarrow}{r}}\coloneqq x \hat{i}+y \hat{j}+z \hat{k}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{k\_} \coloneqq k [1]\,\textit{\_i} +k [2]\,\textit{\_j} +k [3]\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(229)}
{\moverset{\rightarrow}{k}}\coloneqq k_{1} \hat{i}+k_{2} \hat{j}+k_{3} \hat{k}
\end{dmath}
\begin{Maple Normal}
At this point, all of the vectors of the problem are stated and we need to compute the value of the constant of proportionality 
{$ \alpha  $} entering 
{$ \mathit{eq}_{1} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [1] $}

% \mapleresult
\begin{dmath}\label{(230)}
{\textcolor{gray}{\nabla}}^{2}\left(\alpha  {| C |} \hat{k} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right)\right)=-\frac{4 \pi  {| C |} \hat{k} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right)}{c}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mapleref{(230)}) $}

% \mapleresult
\begin{dmath}\label{(231)}
-{| C |} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right) \hat{k} \alpha  \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)=-\frac{4 \pi  {| C |} \hat{k} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right)}{c}
\end{dmath}
\begin{Maple Normal}
Note that 
{$ \hat{k} $} is a common factor in the left- and right-hand sides of this equation, so instead of taking coefficients of 
{$ \hat{k} $}, we can proceed directly with solving for 
{$ \alpha  $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{isolate} (\mapleref{(231)},\mathrm{alpha}) $}

% \mapleresult
\begin{dmath}\label{(232)}
\alpha =\frac{4 \pi}{c \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)}
\end{dmath}
\begin{Maple Normal}
Let's assign this value of 
{$ \alpha  $} so that all expressions start taking it into account automatically.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{assign} (\mapleref{(232)}) $}

\begin{Maple Normal}
So 
{$ {\moverset{\rightarrow}{A}} $} is given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{A\_}  $}

% \mapleresult
\begin{dmath}\label{(233)}
\frac{4 \pi  {| C |} \hat{k} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right)}{c \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)}
\end{dmath}
\begin{Maple Normal}
and 
{$ {\moverset{\rightarrow}{H}} $} is given by 
{$ \mathit{eq}_{2} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eq} [2] $}

% \mapleresult
\begin{dmath}\label{(234)}
{\moverset{\rightarrow}{H}}=\textcolor{gray}{\nabla}\times \left(\frac{4 \pi  {| C |} \hat{k} \cos \! \left(x k_{1}+y k_{2}+z k_{3}\right)}{c \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)}\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mapleref{(234)}) $}

% \mapleresult
\begin{dmath}\label{(235)}
{\moverset{\rightarrow}{H}}=-\frac{4 \pi  {| C |} k_{2} \sin \! \left(x k_{1}+y k_{2}+z k_{3}\right) \hat{i}}{c \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)}+\frac{4 \pi  {| C |} k_{1} \sin \! \left(x k_{1}+y k_{2}+z k_{3}\right) \hat{j}}{c \left(k_{1}^{2}+k_{2}^{2}+k_{3}^{2}\right)}
\end{dmath}
\subsection{\label{bkmrk21}\textbf{\textit{Electric field }}\(\! \boldsymbol{{\moverset{\mathbf{\rightarrow}}{\mathbf{E}}}} \!\) \textbf{\textit{around a conductive neutral sphere in an exterior homogeneous field }}\(\! {\moverset{\mathbf{\rightarrow}}{\mathbf{E}}}_{\boldsymbol{0}} \!\)}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\textbf{Problem}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Determine the electric field 
{$ {\moverset{\rightarrow}{E}} $} around a conductive neutral sphere of radius \textit{a} submersed in an exterior homogeneous electric field 
{$ {\moverset{\rightarrow}{E}}_{0} $}.\


\end{Maple Normal}
\begin{Maple Normal}
\textbf{Solution}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics} [\mathit{Vectors}])\colon  $}

\begin{Maple Normal}
The solution to the problem, generally speaking, is that the (total) electric field can be computed as the negative \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Vectors/Gradient}{gradient} of the (total) potential,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} [T]\coloneqq -\mathit{\%\!Gradient} (\mathrm{Phi}[T]) $}

% \mapleresult
\begin{dmath}\label{(236)}
{\moverset{\rightarrow}{E}}_{T}\coloneqq -\textcolor{gray}{\nabla}\Phi_{T}
\end{dmath}
\begin{Maple Normal}
where the potential is the sum of the potentials associated with the electric field induced in the neutral conductive sphere and the external homogeneous electric field, respectively.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[T]\coloneqq \mathrm{Phi}[s]+\mathrm{Phi}[0] $}

% \mapleresult
\begin{dmath}\label{(237)}
\Phi_{T}\coloneqq \Phi_{s}+\Phi_{0}
\end{dmath}
\begin{Maple Normal}
The expression for the potential 
{$ \Phi_{0} $} for which 
{$ -\triangledown (\Phi_{0})={\moverset{\rightarrow}{E}}_{0} $} is a constant vector can be obtained by reversing this formula; that is, by calculating a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=VectorCalculus[LineInt]}{line integral} with a constant integrand, arriving at:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[0]\coloneqq \textit{E\_} [0]\,.\,\textit{r\_}  $}

% \mapleresult
\begin{dmath}\label{(238)}
\Phi_{0}\coloneqq {\moverset{\rightarrow}{E}}_{0}\cdot {\moverset{\rightarrow}{r}}
\end{dmath}
\begin{Maple Normal}
where 
{$ {\moverset{\rightarrow}{r}} $} is the position vector of \textit{any} point outside the sphere. An expression for the potential of the sphere, 
{$ \Phi_{s} $}, can be derived from the observation that, in the presence of a homogeneous external field, in the neutral conductive sphere, positive and negative charges are polarized (total charge remains 0) so that \textit{a dipole is induced}. The potential of a dipole in an external field, in turn, is \textit{proportional} (by a factor 
{$ \alpha  $} to be determined) to the scalar product of the external field with the potential of an electric "monopole." A multipole expansion of the potential shows that this result is independent of the geometry of the problem. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
For the particular case of a sphere, choosing the origin of the system of references at the center of the sphere and aligning the \textit{z} axis with the external field 
{$ {\moverset{\rightarrow}{E}}_{0} $}, we thus have, for 
{$ \Phi_{s} $}:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[s]\coloneqq \mathrm{alpha}\,\textit{E\_} [0]\,.\,\mathit{\%\!Nabla} (\frac{1}{r}) $}

% \mapleresult
\begin{dmath}\label{(239)}
\Phi_{s}\coloneqq \alpha  \left({\moverset{\rightarrow}{E}}_{0}\cdot \left(\textcolor{gray}{\nabla}\frac{1}{r}\right)\right)
\end{dmath}
\begin{Maple Normal}
That is,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[s]\coloneqq \mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(240)}
\Phi_{s}\coloneqq -\frac{\alpha  \left({\moverset{\rightarrow}{E}}_{0}\cdot \hat{r}\right)}{r^{2}}
\end{dmath}
\begin{Maple Normal}
Note that the output above is directly in spherical coordinates and using the spherical basis of unit vectors; this is because the argument of 
{$ \triangledown  $} is 1/\textit{r}, where \textit{r} is the spherical coordinate. In this orthonormal basis, the position vector 
{$ {\moverset{\rightarrow}{r}} $} is written as
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq r \,\textit{\_r}  $}

% \mapleresult
\begin{dmath}\label{(241)}
{\moverset{\rightarrow}{r}}\coloneqq r \hat{r}
\end{dmath}
\begin{Maple Normal}
The external homogeneous electric field 
{$ {\moverset{\rightarrow}{E}}_{0} $} is a constant vector along the z axis. 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} [0]\coloneqq E [0]\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(242)}
{\moverset{\rightarrow}{E}}_{0}\coloneqq E_{0} \hat{k}
\end{dmath}
\begin{Maple Normal}
In order to proceed, we need to project all of the quantities in the same orthonormal basis; that is, change the projection of 
{$ {\moverset{\rightarrow}{E}}_{0} $} from the Cartesian basis to the spherical basis.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} [0]\coloneqq \mathit{ChangeBasis} (\textit{E\_} [0],3) $}

% \mapleresult
\begin{dmath}\label{(243)}
{\moverset{\rightarrow}{E}}_{0}\coloneqq E_{0} \cos \! \left(\theta \right) \hat{r}-E_{0} \sin \! \left(\theta \right) \hat{\theta}
\end{dmath}
\begin{Maple Normal}
At this point all the relevant quantities have their values derived, so the total potential 
{$ \Phi_{T} $} in spherical coordinates evaluates to
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[T] $}

% \mapleresult
\begin{dmath}\label{(244)}
-\frac{\alpha  E_{0} \cos \! \left(\theta \right)}{r^{2}}+E_{0} \cos \! \left(\theta \right) r 
\end{dmath}
\begin{Maple Normal}
In the above we see that the problem has been mapped into determining the value of a single unknown, the constant of proportionality 
{$ \alpha  $} . This constant can be determined recalling that the potential \textit{on the surface} of a neutral conducting sphere is always constant, and that the actual value of that constant is arbitrary (what we measure is 
{$ {\moverset{\rightarrow}{E}} $}, not 
{$ \Phi  $}). Thus, choosing the value of 
{$ \Phi_{T} $} over the surface of the sphere to be zero, and recalling that the radius of the sphere is equal to \textit{a, }we have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Eval} (\esapos \mathrm{Phi}[T]\esapos ,r =\,a)=\,0 $}

% \mapleresult
\begin{dmath}\label{(245)}
\Phi_{T}\textcolor{gray}{{\raisebox{-0.36em}{$\Big |$}}}{\mstack{}{_{r \hiderel{=}a}}}=0
\end{dmath}
\begin{Maple Normal}
Solving now for 
{$ \alpha  $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{alpha}\coloneqq \mathit{solve} (\mathit{value} (\mapleref{(245)}),\mathrm{alpha}) $}

% \mapleresult
\begin{dmath}\label{(246)}
\alpha \coloneqq a^{3}
\end{dmath}
\begin{Maple Normal}
So 
{$ \Phi_{T} $} is equal to
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathrm{Phi}[T] $}

% \mapleresult
\begin{dmath}\label{(247)}
-\frac{a^{3} E_{0} \cos \! \left(\theta \right)}{r^{2}}+E_{0} \cos \! \left(\theta \right) r 
\end{dmath}
\begin{Maple Normal}
Hence the total electric field 
{$ {\moverset{\rightarrow}{E}}_{T} $} is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{E\_} [T]\coloneqq \mathit{value} (\textit{E\_} [T]) $}

% \mapleresult
\begin{dmath}\label{(248)}
{\moverset{\rightarrow}{E}}_{T}\coloneqq -\frac{E_{0} \cos \! \left(\theta \right) \left(2 a^{3}+r^{3}\right) \hat{r}}{r^{3}}-\frac{\sin \! \left(\theta \right) E_{0} \left(a^{3}-r^{3}\right) \hat{\theta}}{r^{3}}
\end{dmath}
\begin{Maple Normal}
Note in the above the use of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=value}{value} to evaluate the inert \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Vectors/Gradient}{}\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors/Gradient}{\%Gradient}.
\end{Maple Normal}
\section{\label{bkmrk22}\textbf{Special and General Relativity}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The presentation in this section contains two parts.
\end{Maple Normal}
\begin{Maple Ordered List 1}
\item . The following links point to the most relevant Mapleprimes posts about General Relativity using the Physics package of the last couple of years. These posts give an idea of what kind of computation is already doable in general relativity on a worksheet, how close is the input to what we write with paper and pencil, and how close is the typesetting of the output to what we see in textbooks. At the end of each webpage linked below, you will see another link to download the corresponding worksheet, that you can open using Maple and, in that way, reproduce the computation, or change it to adapt it to your problem. The posts are:\

\

\href{https://www.mapleprimes.com/posts/200192-General-Relativity-Using-Computer-Algebra}{General Relativity using Computer Algebra}\

\

\href{https://www.mapleprimes.com/posts/201548-Exact-Solutions-To-Einsteins-Equations}{Exact solutions to Einstein's equations}\

\

\href{https://www.mapleprimes.com/posts/208329-Physics-In-Maple-2017-Special-General}{Classification of solutions to Einstein's equations and the ThreePlusOne (3 + 1) package}\href{https://www.mapleprimes.com/posts/209055-Automatic-Handling-Of-Collision-Of-Tensor}{}\href{https://www.mapleprimes.com/posts/203426-Equivalence-Problem-In-General-Relativity}{}\

\

\href{https://www.mapleprimes.com/posts/203426-Equivalence-Problem-In-General-Relativity}{}\href{https://www.mapleprimes.com/posts/203425-Tetrads-And-Weyl-Scalars-In-Canonical-Form}{}\href{https://www.mapleprimes.com/posts/203425-Tetrads-And-Weyl-Scalars-In-Canonical-Form}{}\href{https://www.mapleprimes.com/posts/203425-Tetrads-And-Weyl-Scalars-In-Canonical-Form}{}\href{https://www.mapleprimes.com/posts/203425-Tetrads-And-Weyl-Scalars-In-Canonical-Form}{Tetrads and Weyl scalars in canonical form}\href{https://www.mapleprimes.com/posts/203425-Tetrads-And-Weyl-Scalars-In-Canonical-Form}{}\href{https://www.mapleprimes.com/posts/203426-Equivalence-Problem-In-General-Relativity}{}\

\

\href{https://www.mapleprimes.com/posts/203426-Equivalence-Problem-In-General-Relativity}{Equivalence problem in General Relativity}\

\

\href{https://www.mapleprimes.com/posts/209055-Automatic-Handling-Of-Collision-Of-Tensor}{Automatic handling of collision of tensor indices in products}\

\

\href{https://www.mapleprimes.com/posts/209047-Minimize-The-Number-Of-Tensor-Components}{Minimize the number of tensor components according to its symmetries}\href{https://www.mapleprimes.com/posts/208329-Physics-In-Maple-2017-Special-General}{}\


\item . A textbook-like presentation on how to work with tensors in special and general relativity using the Physics package
\end{Maple Ordered List 1}
\subsection{\label{bkmrk23}\textbf{Spacetime, Tensors and Relativity}}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon  $}

\begin{Maple Normal}
To define a system of references (coordinates system) and the related spacetime vector you can use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Setup]}{Setup} or \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Coordinates]}{Coordinates} 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Coordinates} (X) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(\mathit{x1},\mathit{x2},\mathit{x3},\mathit{x4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(249)}
\left\{X \right\}
\end{dmath}
\begin{Maple Normal}
You can now use \textit{X} to represent function dependency, as in 
{$ F (X)= $}\textit{F}(
{$ \mathit{x1} ,\mathit{x2} ,\mathit{x3} ,\mathit{x4}  $}), and also as the spacetime vector 
{$ {X{\iup{}\iup{\mu}}} $} (see also \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[SpaceTimeVector]}{SpaceTimeVector}). To indicate that an index is contravariant, prefix it with ~ (tilde)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} X [\mtilde \mathrm{mu}],X [\mathrm{mu}] $}

% \mapleresult
\begin{dmath}\label{(250)}
{X{\iup{}\iup{\mu}}},{X{\idn{\mu}}}
\end{dmath}
\begin{Maple Normal}
With the default signature, (- - - +), the symbol 
{$ \mathit{x0}  $} is automatically mapped into 
{$ \mathit{x4}  $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{x0} =\,\mathit{x4}  $}

% \mapleresult
\begin{dmath}\label{(251)}
\mathit{x4} =\mathit{x4} 
\end{dmath}
\begin{Maple Normal}
You can change the signature using \href{http://Physics,Setup}{Setup} (e.g. 
{$ \mathit{Setup} (\mathit{signature} =\mathit{---+}) $}). \href{http://Physics}{Physics} can work with four different signatures, (- - - +), (+ + + -), (+ - - -) and (- + + +). The first two of them have the different sign in position 4, so that \textit{x0} is automatically mapped to \textit{x4}. When using signatures with the \textit{different sign} in position 1, \textit{x0} is automatically mapped to \textit{x1.}
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
You can also set the coordinates to be any sequence of four names. Three predefined sets are 'cartesian', 'cylindrical' and 'spherical'
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Coordinates} (X =\,\mathit{cartesian}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(x,y,z,t)\}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(252)}
\left\{X \right\}
\end{dmath}
\begin{Maple Normal}
In all cases you will still be able to refer to each coordinate using the generic symbols \textit{x1}, \textit{x2}, ... 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{x1} ,\mathit{x2}  $}

% \mapleresult
\begin{dmath}\label{(253)}
x ,y 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{x0} =\,\mathit{x4}  $}

% \mapleresult
\begin{dmath}\label{(254)}
t =t 
\end{dmath}
\begin{Maple Normal}
You can set many systems of coordinates simultaneously - although only one is considered the 'default differentiation variables' for the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_} \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[dAlembertian]}{dAlembertian} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[D_]}{D\_} operators (and that is the system of references were are all the general relativity tensors are defined).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Coordinates} (Y) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(x,y,z,t),Y=(\mathit{y1},\mathit{y2},\mathit{y3},\mathit{y4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(255)}
\left\{X ,Y \right\}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{y0} =\mathit{y4}  $}

% \mapleresult
\begin{dmath}\label{(256)}
\mathit{y4} =\mathit{y4} 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{diff}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \textit{Default\,differentiation\,variables\,for\,d\_\,},\textit{\,D\_}\mathit{\,and\,dAlembertian\,are\,}\mathit{:}  {\{X=(x,y,z,t)\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(257)}
\left[\mathit{differentiationvariables} =\left[X \right]\right]
\end{dmath}
\begin{Maple Normal}
To change the differentiation variables enter for instance 
{$ \mathit{Setup} (\mathit{diff} =Y) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
When you load \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics}, some package's commands that are automatically set as spacetime tensors, such as the metric \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[g_]}{g\_[mu, nu]} or the differential operator \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_[mu]}. Every other symbol that you want to be considered a spacetime tensor must be defined as such using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Define]}{Define} command, and \textbf{nothing else} will be considered a spacetime tensor during computations. To see the tensors predefined you can call \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Define]}{Define} without arguments
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} () $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,as\,tensors\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(258)}
\left\{{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}},{X{\idn{\mu}}},{Y{\idn{\mu}}}\right\}
\end{dmath}
\begin{Maple Normal}
This set includes the special relativity tensors as well as the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Psigma]}{Pauli} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Dgamma]}{Dirac} matrices. In curved spacetimes the returned set includes also the general relativity tensors.
\end{Maple Normal}
\begin{Maple Normal}
The default dimension of spacetime is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{dimension}) $}

% \mapleresult
\begin{dmath}\label{(259)}
\left[\mathit{dimension} =4\right]
\end{dmath}
\begin{Maple Normal}
To change the value of the spacetime dimension use 
{$ \mathit{Setup} (\mathit{dimension} =N) $} where N is any positive integer greater than 1. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
To see the values of the components of the metric you can enter the spacetime metric \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[g_]}{g\_} without indices; when you load the package it is of Minkowski type
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} []; $}

% \mapleresult
\begin{dmath}\label{(260)}
{g{\idn{\mu}\idn{\nu}}}=\left[\begin{array}{cccc}
-1 & 0 & 0 & 0 
\\
 0 & -1 & 0 & 0 
\\
 0 & 0 & -1 & 0 
\\
 0 & 0 & 0 & 1 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
The spacetime indexed differentiation operator
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} [\mathrm{mu}](F (X)) $}

% \mapleresult
\begin{dmath}\label{(261)}
{\partial{\idn{\mu}}}\! \left(F \! \left(X \right)\right)
\end{dmath}
\begin{Maple Normal}
This operator is also a representation for the \textit{differential} of a function; for that purpose enter it without indices
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} (F (X)) $}

% \mapleresult
\begin{dmath}\label{(262)}
{\partial{\idn{\mu}}}\! \left(F \! \left(X \right)\right) \boldsymbol{\mathrm{d}}\! \left({X{\iup{}\iup{\mu}}}\right)
\end{dmath}
\begin{Maple Normal}
Using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_} you can express the differential of any coordinate defined using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Coordinates]}{Coordinates}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} (\mathit{x0}) $}

% \mapleresult
\begin{dmath}\label{(263)}
\boldsymbol{\mathrm{d}}\! \left(t \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} (\mathit{y0}) $}

% \mapleresult
\begin{dmath}\label{(264)}
\boldsymbol{\mathrm{d}}\! \left(\mathit{y4} \right)
\end{dmath}
\begin{Maple Normal}
The differential of everything else is zero
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} (a) $}

% \mapleresult
\begin{dmath}\label{(265)}
0
\end{dmath}
\begin{Maple Normal}
The \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[diff]}{diff} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_} operators are interconnected
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{diff} (F (X),X [\mtilde \mathrm{mu}]) $}

% \mapleresult
\begin{dmath}\label{(266)}
{\partial{\idn{\mu}}}\! \left(F \! \left(X \right)\right)
\end{dmath}
\begin{Maple Normal}
By applying it two times you get the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[dAlembertian]}{dAlembertian} 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{d\_} [\mathrm{mu}](\textit{d\_} [\mathrm{mu}](F (X))) $}

% \mapleresult
\begin{dmath}\label{(267)}
\square \! \left(F \! \left(X \right)\right)
\end{dmath}
\begin{Maple Normal}
You can enter any pair of contracted indices one covariant and one contravariant, not being relevant which one is of which kind, so you can also enter both covariant or both contravariant and the system will automatically rewrite them as one covariant and one contravariant. 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mathrm{mu},\mathrm{nu}]^{2} $}

% \mapleresult
\begin{dmath}\label{(268)}
{g{\idn{\mu}\idn{\nu}}} {g{\iup{}\iup{\mu}\iup{\nu}}}
\end{dmath}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Define]}{Define} two tensors \textit{A} and \textit{B} for exploration purposes 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (A ,B) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,objects\,with\,tensor\,properties\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(269)}
\left\{A ,B ,{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}},{X{\idn{\mu}}},{Y{\idn{\mu}}}\right\}
\end{dmath}
\begin{Maple Normal}
Note the automatic rewriting of repeated indices as one covariant and one contravariant
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mathrm{alpha},\mathrm{mu}]\,A [\mathrm{mu}]\,\textit{g\_} [\mathrm{alpha},\mathrm{nu}]\,B [\mathrm{nu},\mathrm{sigma},\mathrm{sigma}] $}

% \mapleresult
\begin{dmath}\label{(270)}
{B{\idn{\nu}\idn{\sigma}\iup{\sigma}}} {g{\idn{\alpha}\idn{\mu}}} {g{\iup{}\iup{\alpha}\iup{\nu}}} {A{\iup{}\iup{\mu}}}
\end{dmath}
\begin{Maple Normal}
When a pair of contracted indices is already one covariant and one contravariant, it is left unchanged. Although it is not recommended, you can switch off the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics} evaluator that performs this automatic rewriting of contracted indices by entering 
{$ \mathit{Setup} (\mathit{usephysicsevaluator} =\mathit{false}) $}. 
\end{Maple Normal}
\begin{Maple Normal}
To determine the repeated and free indices in an expression use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Check]}{Check}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Check} (\mapleref{(270)},\mathit{all}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{The\,repeated\,indices\,per\,term\,are\,}\mathit{:} [{\{\mathit{.}\mathit{.}\mathit{.}\}},{\{\mathit{.}\mathit{.}\mathit{.}\}},\mathit{.}\mathit{.}\mathit{.}] ,\mathit{\,the\,free\,indices\,are\,}\mathit{:} {\{\mathit{.}\mathit{.}\mathit{.}\}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(271)}
\left[\left\{\alpha ,\mu ,\nu ,\sigma \right\}\right],\varnothing 
\end{dmath}
\begin{Maple Normal}
The main simplifier in the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics} package is \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Simplify]}{Simplify}. The simplification of tensor indices takes into account the sum rule for repeated indices
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mapleref{(270)})\, $}

% \mapleresult
\begin{dmath}\label{(272)}
{B{\idn{\nu}\idn{\sigma}\iup{\sigma}}} {A{\iup{}\iup{\nu}}}
\end{dmath}
\begin{Maple Normal}
Besides its use in quantum mechanics, the Physics \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[`.`]}{`.`} operator is also a handy shortcut for simplifying contracted indices - you use it replacing the product operator *. This is useful when you want the simplification to happen only in some places. Recalling that multiplication is left associative, you may need to put parenthesis to get what you want. For example, replace in (??) only the third `*` by `.`
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mathrm{alpha},\mathrm{mu}]\,A [\mathrm{mu}]\,(\textit{g\_} [\mathrm{alpha},\mathrm{nu}]\,.\,B [\mathrm{nu},\mathrm{sigma},\mathrm{sigma}]) $}

% \mapleresult
\begin{dmath}\label{(273)}
{B{\idn{\alpha}\idn{\sigma}\iup{\sigma}}} {A{\idn{\mu}}} {g{\iup{}\iup{\alpha}\iup{\mu}}}
\end{dmath}
\begin{Maple Normal}
Set the spacetime metric to be the Schwarzschild metric in spherical coordinates: you can now do that in various manners, the simplest of which is to pass part of the identifying keyword directly to the metric tensor \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[g_]}{g\_} and in this way you also set the corresponding coordinates all in one step (setting thus automatically redefines the coordinates label 
{$ X  $})
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mathit{sc}] $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(r,\theta,\phi,t),Y=(\mathit{y1},\mathit{y2},\mathit{y3},\mathit{y4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \textit{Default\,differentiation\,variables\,for\,d\_\,},\textit{\,D\_}\mathit{\,and\,dAlembertian\,are\,}\mathit{:}  {\{X=(r,\theta,\phi,t)\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Setting} \textit{lowercaselatin\_}\mathit{is} \mathit{\,letters\,to\,represent\,} \mathit{space} \mathit{\,indices}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{The\,Schwarzschild\,metric\,in\,coordinates\,}  [r,\theta,\phi,t]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Parameters}\mathit{:} [m]\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Signature}\mathit{:} (\mathit{-}\mathit{-}\mathit{-}\mathit{+})\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(274)}
{g{\idn{\mu}\idn{\nu}}}=\left[\begin{array}{cccc}
\frac{r}{2 m -r} & 0 & 0 & 0 
\\
 0 & -r^{2} & 0 & 0 
\\
 0 & 0 & -r^{2} \sin \! \left(\theta \right)^{2} & 0 
\\
 0 & 0 & 0 & \frac{r -2 m}{r} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
The metric can also be set passing any line element to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Setup]}{Setup}, as in 
{$ \mathit{Setup} (\mathit{metric} =\textit{line\_element}) $}. The line element is expected to be quadratic in the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{differentials} of the coordinates that should have been defined using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Coordinates]}{Coordinates} or \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Setup]}{Setup}, or can be defined simultaneously for instance as in 
{$ \mathit{Setup} (\mathit{coordinates} =(Z =[...]),\mathit{metric} =\textit{line\_element}) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Note that after setting a non-galilean metric, the general relativity tensors \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Christoffel]}{Christoffel}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Einstein]}{Einstein}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Weyl]}{Weyl} as well as the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[D_]}{covariant derivative} 
{$ \triangledown_{\mu} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} () $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,as\,tensors\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(275)}
\left\{{A{\iup{}\iup{\mu}}},{B{\idn{\nu}\idn{\sigma}\iup{\sigma}}},{\triangledown{\idn{\mu}}},{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{R{\idn{\mu}\idn{\nu}}},{R{\idn{\mu}\idn{\nu}\idn{\alpha}\idn{\beta}}},{C{\idn{\mu}\idn{\nu}\idn{\alpha}\idn{\beta}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\gamma{\idn{i}\idn{j}}},{\Gamma{\idn{\mu}\idn{\nu}\idn{\alpha}}},{G{\idn{\mu}\idn{\nu}}},
\\
{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}},{X{\idn{\mu}}},{Y{\idn{\mu}}}\right\}
\end{dmath}
\begin{Maple Normal}
As a rule for all the relativity tensors, you can see their components for different covariant or contravariant indices by entering the tensor with the indices and the keyword matrix at the end, as in
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mathrm{mu},\mtilde \mathrm{nu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(276)}
{\delta{\idn{\mu}\iup{\nu}}}=\left[\begin{array}{cccc}
1 & 0 & 0 & 0 
\\
 0 & 1 & 0 & 0 
\\
 0 & 0 & 1 & 0 
\\
 0 & 0 & 0 & 1 
\end{array}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mtilde \mathrm{mu},\mtilde \mathrm{nu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(277)}
{g{\iup{}\iup{\mu}\iup{\nu}}}=\left[\begin{array}{cccc}
\frac{2 m -r}{r} & 0 & 0 & 0 
\\
 0 & -\frac{1}{r^{2}} & 0 & 0 
\\
 0 & 0 & -\frac{1}{r^{2} \sin \left(\theta \right)^{2}} & 0 
\\
 0 & 0 & 0 & -\frac{r}{2 m -r} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
You can also check the value of any tensor component by giving numerical values to the indices; prefix them with ~ to indicate that they are contravariant
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [1,1] $}

% \mapleresult
\begin{dmath}\label{(278)}
\frac{r}{2 m -r}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{g\_} [\mtilde 1,\mtilde 1] $}

% \mapleresult
\begin{dmath}\label{(279)}
\frac{2 m -r}{r}
\end{dmath}
\begin{Maple Normal}
A coordinate transformation to a conformal Euclidean form, i.e. with line element proportional to 
{$ \partial (\rho)^{2}+\rho^{2} (\partial (\theta)^{2}+\sin (\theta)^{2} \partial (\phi)^{2}) $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TR} \coloneqq r =(1+\frac{2 m}{4 \rho})^{2} \rho  $}

% \mapleresult
\begin{dmath}\label{(280)}
\mathit{TR} \coloneqq r =\left(1+\frac{m}{2 \rho}\right)^{2} \rho 
\end{dmath}
\begin{Maple Normal}
To transform coordinates in a tensor expression - this is the standard tensor transformation related to its free indices - use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[TransformCoordinates]}{TransformCoordinates}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TransformCoordinates} (\mathit{TR} ,\textit{g\_} [\mathrm{mu},\mathrm{nu}],[\mathrm{rho},\mathrm{theta},\mathrm{phi},t]) $}

% \mapleresult
\begin{dmath}\label{(281)}
\left[\begin{array}{cccc}
-\frac{\left(2 \rho +m \right)^{4}}{16 \rho^{4}} & 0 & 0 & 0 
\\
 0 & -\frac{\left(2 \rho +m \right)^{4}}{16 \rho^{2}} & 0 & 0 
\\
 0 & 0 & -\frac{\left(2 \rho +m \right)^{4} \sin \left(\theta \right)^{2}}{16 \rho^{2}} & 0 
\\
 0 & 0 & 0 & \frac{\left(m -2 \rho \right)^{2}}{\left(2 \rho +m \right)^{2}} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
Check the line element using the related option; the differentials of the coordinates are expressed using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{TransformCoordinates} (\mathit{TR} ,\textit{g\_} [\mathrm{mu},\mathrm{nu}],[\mathrm{rho},\mathrm{theta},\mathrm{phi},t],\mathit{output} =\,\textit{line\_element}) $}

% \mapleresult
\begin{dmath}\label{(282)}
-\frac{\left(2 \rho +m \right)^{4} \left(\left(\textcolor{gray}{\boldsymbol{\mathrm{d}}}\! \left(\rho \right)\right)^{2}+\left(\sin \! \left(\theta \right)^{2} \left(\textcolor{gray}{\boldsymbol{\mathrm{d}}}\! \left(\phi \right)\right)^{2}+\left(\textcolor{gray}{\boldsymbol{\mathrm{d}}}\! \left(\theta \right)\right)^{2}\right) \rho^{2}\right)}{16 \rho^{4}}+\frac{\left(m -2 \rho \right)^{2} \left(\textcolor{gray}{\boldsymbol{\mathrm{d}}}\! \left(t \right)\right)^{2}}{\left(2 \rho +m \right)^{2}}
\end{dmath}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[TransformCoordinates]}{TransformCoordinates} does not set the metric to the result of the transformation; you can do that by passing its output to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Setup]}{Setup}, in this example that would be 
{$ \mathit{Setup} (\mathit{metric} =) $}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The general relativity tensors automatically update their value when you set the metric. This is for instance contraction of all the indices of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann} tensor for the (current) Schwarzschild metric
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mathrm{alpha},\mathrm{beta},\mathrm{mu},\mathrm{nu}]\,.\,\mathit{Riemann} [\mathrm{alpha},\mathrm{beta},\mathrm{mu},\mathrm{nu}] $}

% \mapleresult
\begin{dmath}\label{(283)}
\frac{48 m^{2}}{r^{6}}
\end{dmath}
\begin{Maple Normal}
When computing algebraically with the general relativity tensors of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics} package, their indices  are automatically sorted according to their symmetry properties to facilitate zero recognition
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mathrm{mu},\mathrm{mu},\mathrm{beta},\mathrm{alpha}] $}

% \mapleresult
\begin{dmath}\label{(284)}
0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mathrm{nu},\mathrm{mu},\mathrm{beta},\mathrm{alpha}]-\mathit{Riemann} [\mathrm{alpha},\mathrm{beta},\mathrm{nu},\mathrm{mu}] $}

% \mapleresult
\begin{dmath}\label{(285)}
2 {R{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}}
\end{dmath}
\begin{Maple Normal}
Besides algebraic computations, it is possible to check the value of all or a subset of the tensor's components in a visual way. These are the values of 
{$ \Gamma_{ 2,2}^{ 1} $} and 
{$ \Gamma_{1,2,2} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [1,2,2] $}

% \mapleresult
\begin{dmath}\label{(286)}
r 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [\mtilde 1,2,2] $}

% \mapleresult
\begin{dmath}\label{(287)}
2 m -r 
\end{dmath}
\begin{Maple Normal}
The 2 x 2 matrix corresponding to the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Christoffel]}{Christoffel} symbols  
{$ \Gamma_{ \alpha ,\beta}^{ 1} $} with the first index contravariant is displayed when you pass the keyword matrix as an extra index
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [\mtilde 1,\mathrm{alpha},\mathrm{mu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(288)}
{\Gamma{\iup{}\iup{1}\idn{\alpha}\idn{\mu}}}=\left[\begin{array}{cccc}
\frac{m}{r \left(2 m -r \right)} & 0 & 0 & 0 
\\
 0 & 2 m -r  & 0 & 0 
\\
 0 & 0 & \left(2 m -r \right) \sin \! \left(\theta \right)^{2} & 0 
\\
 0 & 0 & 0 & \frac{-2 m^{2}+r m}{r^{3}} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
Compare with the matrix for 
{$ \Gamma_{1,\alpha ,\beta} $} (so the first index is covariant and then not prefixed with ~)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [1,\mathrm{alpha},\mathrm{mu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(289)}
{\Gamma{\idn{1}\idn{\alpha}\idn{\mu}}}=\left[\begin{array}{cccc}
\frac{m}{\left(2 m -r \right)^{2}} & 0 & 0 & 0 
\\
 0 & r  & 0 & 0 
\\
 0 & 0 & r \sin \! \left(\theta \right)^{2} & 0 
\\
 0 & 0 & 0 & -\frac{m}{r^{2}} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
The nonzero components of 
{$ \Gamma_{ \alpha ,\beta}^{ \mu} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [\mtilde \mathrm{mu},\mathrm{alpha},\mathrm{beta},\mathit{nonzero}] $}

% \mapleresult
\begin{dmath}\label{(290)}
{\Gamma{\iup{}\iup{\mu}\idn{\alpha}\idn{\beta}}}=\left\{\left(1,1,1\right) \hiderel{=} \frac{m}{r \left(2 m -r \right)},\left(1,2,2\right) \hiderel{=} 2 m -r ,\left(1,3,3\right) \hiderel{=} \left(2 m -r \right) \sin \! \left(\theta \right)^{2},
\\
\left(1,4,4\right)\hiderel{=}\frac{-2 m^{2}+r m}{r^{3}},\left(2,1,2\right) \hiderel{=} \frac{1}{r},\left(2,2,1\right) \hiderel{=} \frac{1}{r},
\\
\left(2,3,3\right)\hiderel{=}-\sin \! \left(\theta \right) \cos \! \left(\theta \right),\left(3,1,3\right) \hiderel{=} \frac{1}{r},\left(3,2,3\right) \hiderel{=} \frac{\cos \! \left(\theta \right)}{\sin \! \left(\theta \right)},\left(3,3,1\right) \hiderel{=} \frac{1}{r},
\\
\left(3,3,2\right)\hiderel{=}\frac{\cos \! \left(\theta \right)}{\sin \! \left(\theta \right)},\left(4,1,4\right) \hiderel{=} -\frac{m}{r \left(2 m -r \right)},\left(4,4,1\right) \hiderel{=} -\frac{m}{r \left(2 m -r \right)}\right\}
\end{dmath}
\begin{Maple Normal}
For the all covariant 
{$ \Gamma_{\mu ,\alpha ,\beta} $} you can pass all the indices covariant, or simpler: pass the keyword nonzero alone
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Christoffel} [\mathit{nonzero}] $}

% \mapleresult
\begin{dmath}\label{(291)}
{\Gamma{\idn{\alpha}\idn{\mu}\idn{\nu}}}=\left\{\left(1,1,1\right) \hiderel{=} \frac{m}{\left(2 m -r \right)^{2}},\left(1,2,2\right) \hiderel{=} r ,\left(1,3,3\right) \hiderel{=} r \sin \! \left(\theta \right)^{2},\left(1,4,4\right) \hiderel{=} -\frac{m}{r^{2}},
\\
\left(2,1,2\right)\hiderel{=}-r ,\left(2,2,1\right) \hiderel{=} -r ,\left(2,3,3\right) \hiderel{=} r^{2} \sin \! \left(\theta \right) \cos \! \left(\theta \right),
\\
\left(3,1,3\right)\hiderel{=}-r \sin \! \left(\theta \right)^{2},\left(3,2,3\right) \hiderel{=} -r^{2} \sin \! \left(\theta \right) \cos \! \left(\theta \right),
\\
\left(3,3,1\right)\hiderel{=}-r \sin \! \left(\theta \right)^{2},\left(3,3,2\right) \hiderel{=} -r^{2} \sin \! \left(\theta \right) \cos \! \left(\theta \right),\left(4,1,4\right) \hiderel{=} \frac{m}{r^{2}},
\\
\left(4,4,1\right)\hiderel{=}\frac{m}{r^{2}}\right\}
\end{dmath}
\begin{Maple Normal}
With the Schwarzschild metric, the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci} tensor has all its components equal to zero. To see the matrix form, either pass the keyword matrix, or simpler: pass no indices
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ricci} [] $}

% \mapleresult
\begin{dmath}\label{(292)}
{R{\idn{\mu}\idn{\nu}}}=\left[\begin{array}{cccc}
0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
As is the case in the literature, both the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci} and the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann} tensors are displayed with a capital \textit{R}, but the correct value for each case is retrieved through copy and paste. 
\end{Maple Normal}
\begin{Maple Normal}
The \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci} tensor is defined in terms of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann} tensor as 
{$ R_{\mu ,\nu}=R_{ \mu ,\alpha ,\nu}^{ \alpha} $} You can see how the four \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]#}{Riemann} matrices add to form the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci} matrix; for this purpose give values to the 1st and 3rd indices and pass the extra keyword matrix. This is the first matrix
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mtilde 1,\mathrm{beta},1,\mathrm{nu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(293)}
{R{\iup{}\iup{1}\idn{\beta}\idn{1}\idn{\nu}}}=\left[\begin{array}{cccc}
0 & 0 & 0 & 0 
\\
 0 & -\frac{m}{r} & 0 & 0 
\\
 0 & 0 & -\frac{m \sin \left(\theta \right)^{2}}{r} & 0 
\\
 0 & 0 & 0 & \frac{4 m^{2}-2 r m}{r^{4}} 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
To add the four of them use +
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mtilde 1,\mathrm{beta},1,\mathrm{nu},\mathit{matrix}]+\mathit{Riemann} [\mtilde 2,\mathrm{beta},2,\mathrm{nu},\mathit{matrix}]+\mathit{Riemann} [\mtilde 3,\mathrm{beta},3,\mathrm{nu},\mathit{matrix}]+\mathit{Riemann} [\mtilde 4,\mathrm{beta},4,\mathrm{nu},\mathit{matrix}] $}

% \mapleresult
\begin{dmath}\label{(294)}
{R{\iup{}\iup{1}\idn{\beta}\idn{1}\idn{\nu}}}+{R{\iup{}\iup{2}\idn{\beta}\idn{2}\idn{\nu}}}+{R{\iup{}\iup{3}\idn{\beta}\idn{3}\idn{\nu}}}+{R{\iup{}\iup{4}\idn{\beta}\idn{4}\idn{\nu}}}=\left[\begin{array}{cccc}
0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & \frac{4 m^{2}-2 r m}{r^{4}}+\frac{2 \left(-2 m^{2}+r m \right)}{r^{4}} 
\end{array}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{simplify} (\mapleref{(294)}) $}

% \mapleresult
\begin{dmath}\label{(295)}
{R{\iup{}\iup{1}\idn{\beta}\idn{1}\idn{\nu}}}+{R{\iup{}\iup{2}\idn{\beta}\idn{2}\idn{\nu}}}+{R{\iup{}\iup{3}\idn{\beta}\idn{3}\idn{\nu}}}+{R{\iup{}\iup{4}\idn{\beta}\idn{4}\idn{\nu}}}=\left[\begin{array}{cccc}
0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\\
 0 & 0 & 0 & 0 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
The \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann} scalars 
{$ S_{1}=\frac{1}{48}(R_{\alpha ,\beta ,\mu ,\nu} R^{\alpha ,\beta ,\mu ,\nu}-i R_{\alpha ,\beta ,\mu ,\nu} ({\moverset{*}{R}})^{\alpha ,\beta ,\mu ,\nu}) $} and 
{$ S_{2}=\frac{1}{96}(R_{\alpha ,\beta ,\mu ,\nu} R_{}^{\alpha ,\beta ,\rho ,\beta} R_{\rho ,\beta}^{ \mu ,\nu}+i R_{\alpha ,\beta ,\mu ,\nu} R_{}^{\alpha ,\beta ,\rho ,\beta} ({\moverset{*}{R}})_{\rho ,\beta}^{ \mu ,\nu}) $} (see the corresponding help page)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Riemann} [\mathit{scalars}] $}

% \mapleresult
\begin{dmath}\label{(296)}
S_{1} \hiderel{=} \frac{m^{2}}{r^{6}},S_{2} \hiderel{=} -\frac{m^{3}}{r^{9}}
\end{dmath}
\begin{Maple Normal}
The covariant derivative of 
{$ {A{\idn{\nu}}}(r ,\theta ,\phi ,t) $} 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{D\_} [\mathrm{mu}](A [\mathrm{nu}](X)) $}

% \mapleresult
\begin{dmath}\label{(297)}
{\triangledown{\idn{\mu}}}\! \left({A{\idn{\nu}}}\! \left(X \right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(297)}) $}

% \mapleresult
\begin{dmath}\label{(298)}
{\partial{\idn{\mu}}}\! \left({A{\idn{\nu}}}\! \left(X \right)\right)-{\Gamma{\iup{}\iup{\alpha}\idn{\mu}\idn{\nu}}} {A{\idn{\alpha}}}\! \left(X \right)
\end{dmath}
\begin{Maple Normal}
The divergence of 
{$ {A{\idn{\mu}}}(r ,\theta ,\phi ,t) $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{D\_} [\mathrm{mu}](A [\mathrm{mu}](X)) $}

% \mapleresult
\begin{dmath}\label{(299)}
{\triangledown{\idn{\mu}}}\! \left({A{\iup{}\iup{\mu}}}\! \left(X \right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(299)}) $}

% \mapleresult
\begin{dmath}\label{(300)}
\frac{2 {A{\iup{}\iup{\mu}}}\! \left(X \right) {\partial{\idn{\mu}}}\! \left(r \right)}{r}+\frac{{\partial{\idn{\mu}}}\! \left(\theta \right) \cos \! \left(\theta \right) {A{\iup{}\iup{\mu}}}\! \left(X \right)}{\sin \! \left(\theta \right)}+{\partial{\idn{\mu}}}\! \left({A{\iup{}\iup{\mu}}}\! \left(X \right)\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{simplify} (\mapleref{(300)})\,\mathrm{assuming}\,\mathit{positive}  $}

% \mapleresult
\begin{dmath}\label{(301)}
\frac{2 {A{\iup{}\iup{\mu}}}\! \left(X \right) {\partial{\idn{\mu}}}\! \left(r \right)}{r}+\frac{{\partial{\idn{\mu}}}\! \left(\theta \right) \cos \! \left(\theta \right) {A{\iup{}\iup{\mu}}}\! \left(X \right)}{\sin \! \left(\theta \right)}+{\partial{\idn{\mu}}}\! \left({A{\iup{}\iup{\mu}}}\! \left(X \right)\right)
\end{dmath}
\begin{Maple Normal}
The covariant derivative for a tensor with mixed indices; in some cases \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=expand}{expand} will expand not just the covariant derivative; you can be more selective using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=convert}{convert}; to avoid redundant display of the functionality of 
{$ B  $} use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=PDEtools:-declare}{PDEtools:-declare}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{PDEtools} \mcoloneq \mathit{declare} (B (X)) $}

% \mapleresult
\begin{dmath}\label{(302)}
B \! \left(X \right) \mathit{will\,now\,be\,displayed\,as\,} B 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{D\_} [\mathrm{mu}](B [\mtilde \mathrm{alpha},\mathrm{beta},\mtilde \mathrm{nu}](X)) $}

% \mapleresult
\begin{dmath}\label{(303)}
{\triangledown{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{convert} (\mapleref{(303)},\textit{d\_}) $}

% \mapleresult
\begin{dmath}\label{(304)}
{\partial{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)-{\Gamma{\iup{}\iup{\kappa}\idn{\beta}\idn{\mu}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}}+{\Gamma{\iup{}\iup{\alpha}\idn{\kappa}\idn{\mu}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}}+{\Gamma{\iup{}\iup{\nu}\idn{\kappa}\idn{\mu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}}
\end{dmath}
\begin{Maple Normal}
This expression can be rewritten in different ways. For example, rewrite \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Christoffel]}{Christoffel} in terms of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[g_]}{g\_} and its derivatives, expand, then revert back the rewriting
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{convert} (\mapleref{(304)},\textit{g\_}) $}

% \mapleresult
\begin{dmath}\label{(305)}
{\partial{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)-\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} \left({\partial{\idn{\mu}}}\! \left({g{\idn{\beta}\idn{\lambda}}}\right)+{\partial{\idn{\beta}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)-{\partial{\idn{\lambda}}}\! \left({g{\idn{\beta}\idn{\mu}}}\right)\right) {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}}}{2}+\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} \left({\partial{\idn{\mu}}}\! \left({g{\idn{\kappa}\idn{\lambda}}}\right)+{\partial{\idn{\kappa}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)-{\partial{\idn{\lambda}}}\! \left({g{\idn{\kappa}\idn{\mu}}}\right)\right) {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}}}{2}+\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} \left({\partial{\idn{\mu}}}\! \left({g{\idn{\kappa}\idn{\lambda}}}\right)+{\partial{\idn{\kappa}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)-{\partial{\idn{\lambda}}}\! \left({g{\idn{\kappa}\idn{\mu}}}\right)\right) {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}}}{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(305)}) $}

% \mapleresult
\begin{dmath}\label{(306)}
{\partial{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)-\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} {\partial{\idn{\mu}}}\! \left({g{\idn{\beta}\idn{\lambda}}}\right)}{2}-\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} {\partial{\idn{\beta}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} {\partial{\idn{\lambda}}}\! \left({g{\idn{\beta}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} {\partial{\idn{\mu}}}\! \left({g{\idn{\kappa}\idn{\lambda}}}\right)}{2}+\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} {\partial{\idn{\kappa}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)}{2}-\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} {\partial{\idn{\lambda}}}\! \left({g{\idn{\kappa}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} {\partial{\idn{\mu}}}\! \left({g{\idn{\kappa}\idn{\lambda}}}\right)}{2}+\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} {\partial{\idn{\kappa}}}\! \left({g{\idn{\lambda}\idn{\mu}}}\right)}{2}-\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} {\partial{\idn{\lambda}}}\! \left({g{\idn{\kappa}\idn{\mu}}}\right)}{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{convert} (\mapleref{(306)},\mathit{Christoffel}) $}

% \mapleresult
\begin{dmath}\label{(307)}
{\partial{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)-\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} \left({\Gamma{\idn{\lambda}\idn{\beta}\idn{\mu}}}+{\Gamma{\idn{\beta}\idn{\lambda}\idn{\mu}}}\right)}{2}-\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} \left({\Gamma{\idn{\mu}\idn{\beta}\idn{\lambda}}}+{\Gamma{\idn{\lambda}\idn{\beta}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\kappa}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\kappa}\iup{\nu}}} \left({\Gamma{\idn{\mu}\idn{\beta}\idn{\lambda}}}+{\Gamma{\idn{\beta}\idn{\lambda}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} \left({\Gamma{\idn{\lambda}\idn{\kappa}\idn{\mu}}}+{\Gamma{\idn{\kappa}\idn{\lambda}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} \left({\Gamma{\idn{\mu}\idn{\kappa}\idn{\lambda}}}+{\Gamma{\idn{\lambda}\idn{\kappa}\idn{\mu}}}\right)}{2}-\frac{{g{\iup{}\iup{\alpha}\iup{\lambda}}} {B{\iup{}\iup{\kappa}\idn{\beta}\iup{\nu}}} \left({\Gamma{\idn{\mu}\idn{\kappa}\idn{\lambda}}}+{\Gamma{\idn{\kappa}\idn{\lambda}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} \left({\Gamma{\idn{\lambda}\idn{\kappa}\idn{\mu}}}+{\Gamma{\idn{\kappa}\idn{\lambda}\idn{\mu}}}\right)}{2}+\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} \left({\Gamma{\idn{\mu}\idn{\kappa}\idn{\lambda}}}+{\Gamma{\idn{\lambda}\idn{\kappa}\idn{\mu}}}\right)}{2}-\frac{{g{\iup{}\iup{\lambda}\iup{\nu}}} {B{\iup{}\iup{\alpha}\idn{\beta}\iup{\kappa}}} \left({\Gamma{\idn{\mu}\idn{\kappa}\idn{\lambda}}}+{\Gamma{\idn{\kappa}\idn{\lambda}\idn{\mu}}}\right)}{2}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mapleref{(307)}) $}

% \mapleresult
\begin{dmath}\label{(308)}
-{\Gamma{\idn{\lambda}\idn{\beta}\idn{\mu}}} {B{\iup{}\iup{\alpha}\iup{\lambda}\iup{\nu}}}+{\Gamma{\iup{}\iup{\alpha}\idn{\mu}\iup{\lambda}}} {B{\idn{\lambda}\idn{\beta}\iup{\nu}}}+{\Gamma{\iup{}\iup{\nu}\idn{\mu}\iup{\lambda}}} {B{\iup{}\iup{\alpha}\idn{\beta}\idn{\lambda}}}+{\partial{\idn{\mu}}}\! \left({B{\iup{}\iup{\alpha}\idn{\beta}\iup{\nu}}}\right)
\end{dmath}
\begin{Maple Normal}
which is the same as \mapleref{(304)}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mapleref{(304)}-\mapleref{(308)}) $}

% \mapleresult
\begin{dmath}\label{(309)}
0
\end{dmath}
\begin{Maple Normal}
For more details see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Conventions]}{Spacetime, tensor simplification and default settings}, and the help pages for \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Coordinates]}{Coordinates}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[d_]}{d\_}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[D_]}{D\_}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Einstein]}{Einstein}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[D_]}{g\_}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[KroneckerDelta]}{KroneckerDelta} (abbreviation: kd\_), \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[LeviCivita]}{LeviCivita} (abbreviation: ep\_), \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Ricci]}{Ricci}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Riemann]}{Riemann}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[SpaceTimeVector]}{SpaceTimeVector} and \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Weyl]}{Weyl}.
\end{Maple Normal}
\section{\label{bkmrk24}\textbf{Classical Field Theory}}
\subsection{\label{bkmrk25}\textbf{\textit{Maxwell equations departing from the Action for electrodynamics}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Maxwell equations result from taking the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Fundiff]}{functional derivative} of the Action. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Let X and Y represent two spacetime points
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{Coordinates} (X ,Y) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \textit{Default\,differentiation\,variables\,for\,d\_\,},\textit{\,D\_}\mathit{\,and\,dAlembertian\,are\,}\mathit{:}  {\{X=(\mathit{x1},\mathit{x2},\mathit{x3},\mathit{x4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \mathit{Systems\,of\,spacetime\,coordinates\,are\,}\mathit{:}  {\{X=(\mathit{x1},\mathit{x2},\mathit{x3},\mathit{x4}),Y=(\mathit{y1},\mathit{y2},\mathit{y3},\mathit{y4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(310)}
\left\{X ,Y \right\}
\end{dmath}
\begin{Maple Normal}
Define now the 4-D electromagnetic potential
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{tensors} =\,A [\mathrm{mu}](X)) $}

% \mapleresult
\begin{dmath}\label{(311)}
\left[\mathit{tensors} =\left\{{A{\idn{\mu}}},{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}},{X{\idn{\mu}}},{Y{\idn{\mu}}}\right\}\right]
\end{dmath}
\begin{Maple Normal}
From herein avoid \textit{displaying} the functionality whenever it is X
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{CompactDisplay} (A (X)) $}

% \mapleresult
\begin{dmath}\label{(312)}
A \! \left(X \right) \mathit{will\,now\,be\,displayed\,as\,} A 
\end{dmath}
\begin{Maple Normal}
Also to avoid having to repeat saying who are the differentiation variables of the operators 
{$ {\partial{\idn{\mu}}} $} and 
{$ \square  $} just set them 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{var} =X) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{var} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{differentiationvariables} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[ \textit{Default\,differentiation\,variables\,for\,d\_\,},\textit{\,D\_}\mathit{\,and\,dAlembertian\,are\,}\mathit{:}  {\{X=(\mathit{x1},\mathit{x2},\mathit{x3},\mathit{x4})\}}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(313)}
\left[\mathit{differentiationvariables} =\left[X \right]\right]
\end{dmath}
\begin{Maple Normal}
Query about the dimension and signature ...
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{dimension} ,\mathit{signature}) $}

% \mapleresult
\begin{dmath}\label{(314)}
\left[\mathit{dimension}  \hiderel{=} 4,\mathit{signature}  \hiderel{=} \mathit{-\,-\,-\,+\,} \right]
\end{dmath}
\begin{Maple Normal}
Everything is set. Let's define the electromagnetic field tensor 
{$ F_{\mu ,\nu} $} in terms of the derivatives of 
{$ A_{\mu} $}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} F [\mathrm{mu},\mathrm{nu}]\coloneqq \textit{d\_} [\mathrm{mu}](A [\mathrm{nu}](X))-\textit{d\_} [\mathrm{nu}](A [\mathrm{mu}](X)) $}

% \mapleresult
\begin{dmath}\label{(315)}
F_{\mu ,\nu}\coloneqq {\partial{\idn{\mu}}}\! \left({A{\idn{\nu}}}\right)-{\partial{\idn{\nu}}}\! \left({A{\idn{\mu}}}\right)
\end{dmath}
\begin{Maple Normal}
Define now the Action 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} S \coloneqq \mathit{Intc} (F [\mathrm{mu},\mathrm{nu}]^{2},X) $}

% \mapleresult
\begin{dmath}\label{(316)}
S \coloneqq {\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\left({\partial{\idn{\mu}}}\! \left({A{\idn{\nu}}}\right)-{\partial{\idn{\nu}}}\! \left({A{\idn{\mu}}}\right)\right)^{2}\textcolor{gray}{d}\mathit{x1} \textcolor{gray}{d}\mathit{x2} \textcolor{gray}{d}\mathit{x3} \textcolor{gray}{d}\mathit{x4} 
\end{dmath}
\begin{Maple Normal}
Take now the functional derivative of S (use ' to delay the computation, to see what is that will be computed)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \esapos \mathit{Fundiff} \esapos (S \,,A [\mathrm{rho}]) $}

% \mapleresult
\begin{dmath}\label{(317)}
\left(\frac{\delta}{\delta  {A{\idn{\rho}}}}\right)\! {\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\left({\partial{\idn{\mu}}}\! \left({A{\idn{\nu}}}\right)-{\partial{\idn{\nu}}}\! \left({A{\idn{\mu}}}\right)\right)^{2}\textcolor{gray}{d}\mathit{x1} \textcolor{gray}{d}\mathit{x2} \textcolor{gray}{d}\mathit{x3} \textcolor{gray}{d}\mathit{x4} 
\end{dmath}
\begin{Maple Normal}
Release now the computation
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \%  $}

% \mapleresult
\begin{dmath}\label{(318)}
\left(2 {\partial{\idn{\mu}}}\! \left({\partial{\idn{\nu}}}\! \left({A{\iup{}\iup{\nu}}}\right)\right)-2 \square \! \left({A{\idn{\mu}}}\right)\right) {g{\iup{}\iup{\mu}\iup{\rho}}}+\left(-2 \square \! \left({A{\idn{\nu}}}\right)+2 {\partial{\idn{\mu}}}\! \left({\partial{\idn{\nu}}}\! \left({A{\iup{}\iup{\mu}}}\right)\right)\right) {g{\iup{}\iup{\nu}\iup{\rho}}}
\end{dmath}
\begin{Maple Normal}
To simplify the contracted spacetime indices, use the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Simplify]}{Simplify} command, resulting in the Maxwell equations in their familiar 4-D tensorial form
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mapleref{(318)}) $}

% \mapleresult
\begin{dmath}\label{(319)}
-4 \square \! \left({A{\iup{}\iup{\rho}}}\right)+4 {\partial{\idn{\nu}}}\! \left({\partial{\iup{}\iup{\rho}}}\! \left({A{\iup{}\iup{\nu}}}\right)\right)
\end{dmath}
\begin{Maple Normal}
Note that in \mapleref{(317)} one could, more formally, enter 
{$ \esapos \mathit{Fundiff} \esapos (S ,A [\mathrm{rho}](Y)) $}, indicating the functional dependency in 
{$ {A{\idn{\rho}}}(Y) $}, and that would result in \mapleref{(318)} expressed as a function of \textit{Y} instead of \textit{X}. Indicating the \textit{differentiation function} as 
{$ {A{\idn{\rho}}} $} is equivalent to indicating 
{$ {A{\idn{\rho}}}(Y) $} followed by replacing \textit{Y} by \textit{X} in the result.
\end{Maple Normal}
\subsection{\label{bkmrk26}\textbf{\textit{The field equations for the }}\(\! \lambda \Phi^{4} \!\)\textbf{\textit{ model}}}
\begin{Maple Normal}
\

The Lagrangian of the 
{$ \lambda \Phi^{4} $} model, the corresponding Action, and the field equations: 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{CompactDisplay} (\Phi (X)) $}

% \mapleresult
\begin{dmath}\label{(320)}
\Phi \! \left(X \right) \mathit{will\,now\,be\,displayed\,as\,} \Phi 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq \frac{1}{2}\,\textit{d\_} [\mathrm{mu}](\mathrm{Phi}(X))\,\textit{d\_} [\mathrm{mu}](\mathrm{Phi}(X))-\frac{m^{2}}{2}\,\mathrm{Phi}(X)^{2}+\frac{\mathrm{lambda}}{4}\,\mathrm{Phi}(X)^{4} $}

% \mapleresult
\begin{dmath}\label{(321)}
L \coloneqq \frac{{\partial{\idn{\mu}}}\! \left(\Phi \right) {\partial{\iup{}\iup{\mu}}}\! \left(\Phi \right)}{2}-\frac{m^{2} \Phi^{2}}{2}+\frac{\lambda  \,\Phi^{4}}{4}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} S \coloneqq \mathit{Intc} (L ,X) $}

% \mapleresult
\begin{dmath}\label{(322)}
S \coloneqq {\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\left(\frac{{\partial{\idn{\mu}}}\! \left(\Phi \right) {\partial{\iup{}\iup{\mu}}}\! \left(\Phi \right)}{2}-\frac{m^{2} \Phi^{2}}{2}+\frac{\lambda  \,\Phi^{4}}{4}\right)\textcolor{gray}{d}\mathit{x1} \textcolor{gray}{d}\mathit{x2} \textcolor{gray}{d}\mathit{x3} \textcolor{gray}{d}\mathit{x4} 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Fundiff} (S ,\mathrm{Phi}) $}

% \mapleresult
\begin{dmath}\label{(323)}
-\square \! \left(\Phi \right)-\Phi  \left(-\Phi^{2} \lambda +m^{2}\right)
\end{dmath}
\subsection{\label{The EnergyMomentum tensor for the Proca Lagrangian}\textbf{\textit{The EnergyMomentum tensor for the Proca Lagrangian}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
To express the Proca Lagrangian density, define the tensors entering the formulation
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} ;
\\
 \mathit{with} (\mathit{Physics})\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (a [\mathrm{mu}],T [\mathrm{mu},\mathrm{nu}]) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,objects\,with\,tensor\,properties\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(324)}
\left\{{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{T{\idn{\mu}\idn{\nu}}},{a{\idn{\mu}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}}\right\}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Define} (f [\mathrm{mu},\mathrm{nu}],\mathit{antisymmetric}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{Defined\,objects\,with\,tensor\,properties\,}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(325)}
\left\{{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{T{\idn{\mu}\idn{\nu}}},{a{\idn{\mu}}},{\partial{\idn{\mu}}},{f{\idn{\mu}\idn{\nu}}},{g{\idn{\mu}\idn{\nu}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}}\right\}
\end{dmath}
\begin{Maple Normal}
The Lagrangian:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq (-\frac{1}{4}f [\mathrm{alpha},\mathrm{beta}]f [\mathrm{xi},\mathrm{eta}]\textit{g\_} [\mtilde \mathrm{alpha},\mtilde \mathrm{xi}]\textit{g\_} [\mtilde \mathrm{beta},\mtilde \mathrm{eta}]+\frac{1}{2}\,m^{2}\,a [\mathrm{alpha}]\,a [\mathrm{xi}]\,\textit{g\_} [\mtilde \mathrm{alpha},\mtilde \mathrm{xi}])\mathrm{sqrt}(-\textit{{\rm\,\%}\!g\_\,} [\mathit{determinant}]) $}

% \mapleresult
\begin{dmath}\label{(326)}
L \coloneqq \left(-\frac{1}{4} {f{\idn{\alpha}\idn{\beta}}} {f{\idn{\xi}\idn{\eta}}} {g{\iup{}\iup{\alpha}\iup{\xi}}} {g{\iup{}\iup{\beta}\iup{\eta}}}+\frac{1}{2} m^{2} {a{\idn{\alpha}}} {a{\idn{\xi}}} {g{\iup{}\iup{\alpha}\iup{\xi}}}\right) \sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}
\end{dmath}
\begin{Maple Normal}
By definition, the contravariant components of the energy momentum tensor are given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} T [\mtilde \mathrm{nu},\mtilde \mathrm{mu}]=-\frac{2\,\mathit{\%\!diff} (\mathit{\%\!L} ,\textit{g\_} [\mathrm{mu},\mathrm{nu}])}{\sqrt{-\textit{{\rm\,\%}\!g\_\,} [\mathit{determinant}]}} $}

% \mapleresult
\begin{dmath}\label{(327)}
{T{\iup{}\iup{\nu}\iup{\mu}}}=-\frac{2 \left(\frac{\textcolor{gray}{\partial}}{\textcolor{gray}{\partial}{g{\idn{\mu}\idn{\nu}}}}\textcolor{gray}{L}\right)}{\sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}}
\end{dmath}
\begin{Maple Normal}
Instead of using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=value}{value} on the whole expression, which would result in the computation of 
{$ {\textcolor{gray}{g}{\idn{\mathit{determinant}}}} $}, selectively activate \textit{\%diff and \%L}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eval} (\mapleref{(327)},[\mathit{\%\!L} =L ,\mathit{\%\!diff} =\mathit{diff}]) $}

% \mapleresult
\begin{dmath}\label{(328)}
{T{\iup{}\iup{\nu}\iup{\mu}}}=-\frac{2 \left(-\frac{\left(-\frac{1}{4} {f{\idn{\alpha}\idn{\beta}}} {f{\idn{\xi}\idn{\eta}}} {g{\iup{}\iup{\alpha}\iup{\xi}}} {g{\iup{}\iup{\beta}\iup{\eta}}}+\frac{1}{2} m^{2} {a{\idn{\alpha}}} {a{\idn{\xi}}} {g{\iup{}\iup{\alpha}\iup{\xi}}}\right) {g{\iup{}\iup{\mu}\iup{\nu}}} {\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}{2 \sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}}-\left(-\frac{{f{\idn{\alpha}\idn{\beta}}} {f{\idn{\xi}\idn{\eta}}} {g{\iup{}\iup{\beta}\iup{\eta}}}}{4}+\frac{m^{2} {a{\idn{\alpha}}} {a{\idn{\xi}}}}{2}\right) \sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}\, {g{\iup{}\iup{\alpha}\iup{\mu}}} {g{\iup{}\iup{\nu}\iup{\xi}}}+\frac{{f{\idn{\alpha}\idn{\beta}}} {f{\idn{\xi}\idn{\eta}}} {g{\iup{}\iup{\alpha}\iup{\xi}}} \sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}\, {g{\iup{}\iup{\beta}\iup{\mu}}} {g{\iup{}\iup{\eta}\iup{\nu}}}}{4}\right)}{\sqrt{-{\vert \textcolor{gray}{\boldsymbol{\textrm{ g}}}\vert}}}
\end{dmath}
\begin{Maple Normal}
Simplifying the contracted tensor indices we get the expected result
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mapleref{(328)}) $}

% \mapleresult
\begin{dmath}\label{(329)}
{T{\iup{}\iup{\nu}\iup{\mu}}}=\frac{{g{\iup{}\iup{\mu}\iup{\nu}}} \left(-2 m^{2} {a{\idn{\beta}}} {a{\iup{}\iup{\beta}}}+{f{\idn{\beta}\idn{\xi}}} {f{\iup{}\iup{\beta}\iup{\xi}}}\right)}{4}+m^{2} {a{\iup{}\iup{\mu}}} {a{\iup{}\iup{\nu}}}-{f{\idn{\beta}\iup{\mu}}} {f{\iup{}\iup{\beta}\iup{\nu}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,}  $}

\subsection{\label{The Gross-Pitaevskii field equations for a quantum system of identical particles}\textbf{\textit{The Gross-Pitaevskii field equations for a quantum system of identical particles}}}
\begin{Maple Normal}
\

The field equation describing the ground state of a quantum system of identical particles (bosons), that is, \href{http://en.wikipedia.org/wiki/Gross–Pitaevskii_equation}{the Gross-Pitaevskii equation} (GPE), is relevant in the description of Bose-Einstein condensates (BEC). To derive the GPE we proceed in two steps:
\end{Maple Normal}
\begin{Maple Bullet Item}
\item Construct the Lagrangian for the system, and with it write the action functional
\item Minimize the action by equating to zero its functional derivative with respect to the boson field.
\end{Maple Bullet Item}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} ;
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{with} (\mathit{Vectors})\colon  $}


{$ \displaystyle \texttt{>\,} \mathit{interface} (\mathit{imaginaryunit} =\,i)\colon  $}
{$ \displaystyle \texttt{>\,}  $}\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{macro} (\mathrm{Psi}=\,\mathrm{psi}(x ,y ,z ,t))\colon  $}

\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{CompactDisplay} ((\psi ,V)(x ,y ,z ,t)) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\psi (x ,y ,z ,t) \mathit{will\,now\,be\,displayed\,as\,} \psi \]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(330)}
V \! \left(x ,y ,z ,t \right) \mathit{will\,now\,be\,displayed\,as\,} V 
\end{dmath}
\begin{Maple Normal}
\

The energy density 
{$ E  $} for a quantum system of identical boson particles is ([3])
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} E \coloneqq \frac{\hslash^{2}}{2\,m}\,\mathit{Norm} (\mathit{\%\!Gradient} (\mathrm{Psi}))^{2}+V (x ,y ,z ,t)\,\mathrm{abs}(\mathrm{Psi})^{2}+\frac{G}{2}\,\mathrm{abs}(\mathrm{Psi})^{4} $}

% \mapleresult
\begin{dmath}\label{(331)}
E \coloneqq \frac{\hslash^{2} {\|\textcolor{gray}{\nabla}\psi \|}^{2}}{2 m}+V {| \psi |}^{2}+\frac{G {| \psi |}^{4}}{2}
\end{dmath}
\begin{Maple Normal}
where 
{$ \psi (x ,y ,z ,t) $} is a complex field, 
{$ V (x ,y ,z ,t) $} an external potential, and the term 
{$ \frac{G {| \psi |}^{4}}{2} $} is the atom-atom interaction.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{realobjects} =\,\{t ,m ,\hslash ,G ,V (x ,y ,z ,t)\},\mathit{automaticsimplification} =\,\mathit{true})\colon  $}

\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The Lagrangian density 
{$ L  $} in terms of the Energy \textit{E} according to standard formulas
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L \coloneqq (\frac{i \,\hslash}{2})\,(\mathit{conjugate} (\mathrm{Psi})\,\mathit{diff} (\mathrm{Psi},t)-\mathrm{Psi}\,\mathit{diff} (\mathit{conjugate} (\mathrm{Psi}),t))-E  $}

% \mapleresult
\begin{dmath}\label{(332)}
L \coloneqq \frac{-\mathrm{i} \hslash  \left({\overline{\psi}}_{t}\right) \psi  m -\hslash^{2} {\|\textcolor{gray}{\nabla}\psi \|}^{2}+m \left(-G {| \psi |}^{4}+\mathrm{i} \left(\psi_{t}\right) \overline{\psi} \hslash -2 V {| \psi |}^{2}\right)}{2 m}
\end{dmath}
\begin{Maple Normal}
Construct the action and equate to zero the functional derivative
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \esapos \mathit{Fundiff} \esapos (\mathit{Intc} (L ,x ,y ,z ,t),\mathrm{psi})=\,0 $}

% \mapleresult
\begin{dmath}\label{(333)}
\left(\frac{\delta}{\delta  \psi}\right)\! {\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\frac{-\mathrm{i} \hslash  \left({\overline{\psi}}_{t}\right) \psi  m -\hslash^{2} {\|\textcolor{gray}{\nabla}\psi \|}^{2}+m \left(-G {| \psi |}^{4}+\mathrm{i} \left(\psi_{t}\right) \overline{\psi} \hslash -2 V {| \psi |}^{2}\right)}{2 m}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z \textcolor{gray}{d}t =0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mapleref{(333)} $}

% \mapleresult
\begin{dmath}\label{(334)}
\frac{-2 G \psi  \overline{\psi}^{2} m -2 \,\mathrm{i} \hslash  \left({\overline{\psi}}_{t}\right) m +\hslash^{2} \left({\overline{\psi}}_{x ,x}\right)+\left({\overline{\psi}}_{y ,y}\right) \hslash^{2}+\hslash^{2} \left({\overline{\psi}}_{z ,z}\right)-2 \overline{\psi} V m}{2 m}=0
\end{dmath}
\begin{Maple Normal}
Make the Laplacian explicit
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathit{Laplacian} =\,\mathit{\%\!Laplacian})(\mathrm{Psi}) $}

% \mapleresult
\begin{dmath}\label{(335)}
\psi_{x ,x}+\psi_{y ,y}+\psi_{z ,z}={\textcolor{gray}{\nabla}}^{2}\psi 
\end{dmath}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{simplify} (\mathit{conjugate} (\mapleref{(334)}),\{\mapleref{(335)}\}) $}

% \mapleresult
\begin{dmath}\label{(336)}
\frac{2 \,\mathrm{i} \hslash  \left(\psi_{t}\right) m +\hslash^{2} \left({\textcolor{gray}{\nabla}}^{2}\psi \right)-2 m \psi  \left(G \overline{\psi} \psi +V \right)}{2 m}=0
\end{dmath}
\begin{Maple Normal}
The standard form of the Gross–Pitaevskii equation:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} i \,\hslash \,\mathit{isolate} (\mapleref{(336)},\mathit{diff} (\mathrm{Psi},t)) $}

% \mapleresult
\begin{dmath}\label{(337)}
\mathrm{i} \hslash  \left(\psi_{t}\right)=\frac{-\hslash^{2} \left({\textcolor{gray}{\nabla}}^{2}\psi \right)+2 m \psi  \left(G \overline{\psi} \psi +V \right)}{2 m}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{collect} (\mathit{convert} (\mathit{expand} (\mapleref{(337)}),\mathrm{abs}),\mathrm{psi}) $}

% \mapleresult
\begin{dmath}\label{(338)}
\mathrm{i} \hslash  \left(\psi_{t}\right)=\left(G {| \psi |}^{2}+V \right) \psi -\frac{\hslash^{2} \left({\textcolor{gray}{\nabla}}^{2}\psi \right)}{2 m}
\end{dmath}
\begin{Maple Bullet Item}
\item For a continuation of this computation deriving a continuity equation for a system of identical particles, see the Mapleprimes post \href{http://www.mapleprimes.com/posts/200109-Quantum-Mechanics-Using-Computer-Algebra}{"Quantum Mechanics using Computer Algebra"} .
\item For the Bogoliubov spectrum and dispersion relations of this problem above see the Mapleprimes post \href{http://www.mapleprimes.com/posts/200120-Quantum-Mechanics-II}{"Quantum Mechanics II"}.
\item For a derivation of the Landau criterion for superfluidity in a system of identical particles see the Mapleprimes post \href{http://www.mapleprimes.com/posts/200240-Superfluidity-In-Quantum-Mechanics}{"Superfluidity in Quantum Mechanics"}
\end{Maple Bullet Item}
\mapleinput
{$ \displaystyle \texttt{>\,}  $}

\section{\label{bkmrk27}\textbf{Quantum Mechanics}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The presentation in this section contains two parts.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Ordered List 1}
\item . The following links point to the most relevant Mapleprimes posts about Quantum Mechanics using the Physics package of the last couple of years. Tackling from basic to advanced problems, these posts give an idea of what kind of computation is already doable in quantum mechanics on a worksheet, how close is the input to what we write with paper and pencil, and how close is the typesetting of the output to what we see in textbooks. At the end of each webpage linked below, you will see another link to download the corresponding worksheet, that you can open using Maple and, in that way, reproduce the computation, or change it to adapt it to your problem. The posts are:\

\

\href{https://www.mapleprimes.com/posts/208710-Quantum-Commutation-Rules-Basics}{Quantum Commutation Rules Basics}\

\

\href{https://www.mapleprimes.com/posts/205867-Quantum-Mechanics-Schrdinger-Vs-Heisenberg}{Quantum Mechanics: Schrödinger vs Heisenberg picture}\

\

\href{https://www.mapleprimes.com/posts/206511-Quantization-Of-The-Lorentz-Force}{Quantization of the Lorentz Force}\

\

\href{https://www.mapleprimes.com/posts/208635-Magnetic-Traps-In-Coldatom-Physics}{Magnetic traps in cold-atom physics}\

\

\href{https://www.mapleprimes.com/posts/208810-The-Hidden-SO4-Symmetry-Of-The-Hydrogen-Atom}{The hidden SO(4) symmetry of the hydrogen atom}|\

\

\href{https://www.mapleprimes.com/posts/200109-Quantum-Mechanics-Using-Computer-Algebra}{(I) Ground state of a quantum system of identical boson particles}\

\

\href{https://www.mapleprimes.com/posts/200120-Quantum-Mechanics-II}{(II) The Gross-Pitaevskii equation and Bogoliubov spectrum}\

\

\href{https://www.mapleprimes.com/posts/200240-Superfluidity-In-Quantum-Mechanics}{(III) The Landau criterion for Superfluidity}\

\

\href{https://www.mapleprimes.com/posts/209099-Tensor-Product-Of-Quantum-State-Spaces}{Tensor Products of Quantum State Spaces}\


\item . An organized textbook-like presentation of the mathematical tools used in Quantum Mechanics using Dirac's notation, plus two subsections with examples.\


\end{Maple Ordered List 1}
\subsection{\label{bkmrk28}\textbf{\textit{Mathematical tools and their representation in Dirac notation}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
This section aims to summarize the mathematical objects entering formulations in quantum mechanics and to show how these objects are entered and represented in the Maple worksheet.
\end{Maple Normal}
\subsubsection{\label{bkmrk29}\textbf{\textit{Kets and Bras}}}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon  $}

\begin{Maple Normal}
The quantum state of a system, belonging to a space of quantum states, is represented in Dirac notation by a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{Ket} state-vector.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (u) $}

% \mapleresult
\begin{dmath}\label{(339)}
{| u \rangle}
\end{dmath}
\begin{Maple Normal}
The above is the quantum analog of a non-projected vector 
{$ {\moverset{\rightarrow}{u}} $} of a 3-D Euclidean space. The norm of a generic Ket 
{$ {| u \rangle} $} is not predefined and can be indicated by \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup#bracketrules}{setting a bracket rule}, as shown \hyperref[scalarproduct]{below}. Every \textbf{Ket} can be projected onto a basis of state-vectors of the space to which the \textbf{Ket} belongs. The \textbf{Kets} conforming a basis (analogous to 3-D unit vectors) are distinguished from a generic Ket 
{$ {| u \rangle} $} by the fact that they have one or many \textit{quantum numbers,} as in 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (v ,n) $}

% \mapleresult
\begin{dmath}\label{(340)}
{| v_{n}\rangle}
\end{dmath}
\begin{Maple Normal}
\textbf{Kets} having quantum numbers are always assumed to belong to a basis of quantum states, are orthogonal to each other, have norm equal to 1, and are distinguished from each other by the values of these quantum numbers. For example, an orthonormal basis of a two dimensional space of quantum states is 
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (v ,0),\mathit{Ket} (v ,1) $}

% \mapleresult
\begin{dmath}\label{(341)}
{| v_{0}\rangle},{| v_{1}\rangle}
\end{dmath}
\begin{Maple Normal}
There are no restrictions on the number of \textit{quantum numbers} that a \textbf{Ket} can have. This is a \textbf{Ket }belonging to a basis of a space that depends on four quantum numbers.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (v ,j ,k ,m ,n) $}

% \mapleresult
\begin{dmath}\label{(342)}
{| v_{j ,k ,m ,n}\rangle}
\end{dmath}
\begin{Maple Normal}
You can associate a space of states with each quantum number, so a \textbf{Ket }with many quantum numbers represents a state in a space constructed as a \textit{tensor product of spaces}. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
There is a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bra}{Bra} associated with each \textbf{Ket},\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bra}{} obtained from the \textbf{Ket} by performing the Hermitian conjugate, or \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Dagger}{Dagger}, operation.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Dagger} (\%) $}

% \mapleresult
\begin{dmath}\label{(343)}
{\langle v_{j ,k ,m ,n}|}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Dagger} (\%) $}

% \mapleresult
\begin{dmath}\label{(344)}
{| v_{j ,k ,m ,n}\rangle}
\end{dmath}
\begin{Maple Normal}
You can enter \textbf{Bras} directly by using the \textbf{Bra} function.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bra} (v ,j ,k ,m ,n) $}

% \mapleresult
\begin{dmath}\label{(345)}
{\langle v_{j ,k ,m ,n}|}
\end{dmath}
\begin{Maple Normal}
The space of \textbf{Bras} of a system is the dual of the space of \textbf{Kets} of that system.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\subsubsection{\label{bkmrk30}\textbf{\textit{Discrete and continuous basis of states}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{Kets} belong to either a discrete or a continuous spaces of quantum states. A discrete space of states is one where the quantum numbers of its \textbf{Kets} vary discretely. These \textbf{Kets} thus belong to \textit{discrete bases of quantum states}. A continuous space is one where the quantum numbers vary continuously and its \textbf{Kets }belong to \textit{continuous bases of quantum states}. Unless explicitly stated otherwise, \textbf{Kets }are assumed to belong to discrete space of states.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
You can indicate that a label \textit{R} identifies a continuous space of states by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{continuous} =R) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{continuous} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{quantumcontinuousbasis} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(346)}
\left[\mathit{quantumcontinuousbasis} =\left\{R \right\}\right]
\end{dmath}
\begin{Maple Normal}
\textbf{Kets }of a continuous space of states can also have any number of \textit{quantum numbers}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (R ,x) $}

% \mapleresult
\begin{dmath}\label{(347)}
{| R_{x}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (R ,x ,y ,z) $}

% \mapleresult
\begin{dmath}\label{(348)}
{| R_{x ,y ,z}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Dagger} (\%) $}

% \mapleresult
\begin{dmath}\label{(349)}
{\langle R_{x ,y ,z}|}
\end{dmath}
\subsubsection{\label{bkmrk31}\textbf{\textit{Scalar product and orthonormalization relation}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
The scalar product is defined between a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bra}{Bra} and a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{Ket}, in that order, and can be performed by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/.}{dot operator `.`} of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics} package, or by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bracket}{Bracket} function; both represent the same object.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bra} (u)\,.\,\mathit{Ket} (v) $}

% \mapleresult
\begin{dmath}\label{(350)}
{\langle u | v \rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (\mathit{Bra} (u),\mathit{Ket} (v)) $}

% \mapleresult
\begin{dmath}\label{(351)}
{\langle u | v \rangle}
\end{dmath}
\begin{Maple Normal}
\textbf{Note} that when the scalar product is just represented, not actually computed, as in the above, the result is always expressed in terms of the \textbf{Bracket} function. A shortcut notation for entering the scalar product using the \textbf{Bracket} function is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (u ,v) $}

% \mapleresult
\begin{dmath}\label{(352)}
{\langle u | v \rangle}
\end{dmath}
\begin{Maple Normal}
Under the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Dagger}{Dagger} operation, 
{$ (\textcolor{olive}{A}\cdot \textcolor{olive}{B})^{\dag}={\textcolor{olive}{B}}^{\dag}\cdot {\textcolor{olive}{A}}^{\dag} $} so that the \textbf{Bracket} becomes
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Dagger} (\%) $}

% \mapleresult
\begin{dmath}\label{(353)}
{\langle v | u \rangle}
\end{dmath}
\begin{Maple Normal}
For the \textbf{Bracket}, the same happens under \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=conjugate}{conjugation}:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{conjugate} (\%) $}

% \mapleresult
\begin{dmath}\label{(354)}
{\langle u | v \rangle}
\end{dmath}
\begin{Maple Normal}
Two generic \textbf{Kets} such as the above may or not belong to the same space. To make practical use of \textbf{Kets}, depending on the problem you may want to set a \textit{bracket rule}, stating the value of the \textbf{Bracket} between them, by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\% =\,f (u ,v)) $}

% \mapleresult
\begin{dmath}\label{(355)}
\left[\mathit{bracketrules} =\left\{{\textcolor{gray}{\langle}u \textcolor{gray}{|}v \textcolor{gray}{\rangle}}=f \! \left(u ,v \right)\right\}\right]
\end{dmath}
\begin{Maple Normal}
After that, both the \textit{dot operator} of the \textbf{Physics} package and the \textbf{Bracket} function know how to perform their scalar product.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (u ,v) $}

% \mapleresult
\begin{dmath}\label{(356)}
f \! \left(u ,v \right)
\end{dmath}
\begin{Maple Normal}
\textbf{Kets} belonging to a discrete basis of states satisfy an \textbf{\textit{orthonormalization relation}} involving the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/KroneckerDelta}{KroneckerDelta} symbol, and when the quantum numbers are present, you do not need to specify a bracket rule.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Bracket} (\mathit{Bra} (u ,n)\,,\mathit{Ket} (u ,m))=\,\mathit{Bra} (u ,n)\,.\,\mathit{Ket} (u ,m) $}

% \mapleresult
\begin{dmath}\label{(357)}
{\textcolor{gray}{\langle}u_{n}\textcolor{gray}{|}u_{m}\textcolor{gray}{\rangle}}={\delta{\idn{m}\idn{n}}}
\end{dmath}
\begin{Maple Normal}
Note in the above the inert form \textbf{\%Bracket}. It is sometimes useful to represent mathematical operations without having them actually performed. For that purpose, use any command with the name prefixed by the symbol \textbf{\%}. To have the inert operation performed, use the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=value}{value} command.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(358)}
{\delta{\idn{m}\idn{n}}}={\delta{\idn{m}\idn{n}}}
\end{dmath}
\begin{Maple Normal}
Evaluate the output two operations above at 
{$ m =n  $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eval} (\mapleref{(357)},m =\,n) $}

% \mapleresult
\begin{dmath}\label{(359)}
{\textcolor{gray}{\langle}u_{n}\textcolor{gray}{|}u_{n}\textcolor{gray}{\rangle}}=1
\end{dmath}
\begin{Maple Normal}
The \textbf{Bracket} of state-vectors depending on many quantum numbers results in products of \textbf{KroneckerDelta} symbols. The shortcut notation of the \textbf{Bracket} function also works in the presence of quantum numbers (\textbf{tip}: to avoid typographical mistakes, it is practical to group the objects visually, by leaving spaces or not after the commas).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (u ,i ,j ,k ,u ,n ,m ,l) $}

% \mapleresult
\begin{dmath}\label{(360)}
{\delta{\idn{i}\idn{n}}} {\delta{\idn{j}\idn{m}}} {\delta{\idn{k}\idn{l}}}
\end{dmath}
\begin{Maple Normal}
\textbf{Kets} of a continuous basis of states satisfy an \textbf{\textit{orthonormalization relation}} involving the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Dirac}{Dirac} function (recall that \textit{R} has been set as a label of a continuous space, by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command, above).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (R ,x ,R ,y) $}

% \mapleresult
\begin{dmath}\label{(361)}
\delta \! \left(-y +x \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Bracket} (R ,x ,y ,z ,R ,a ,b ,c)\colon 
\\
 \% =\,\mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(362)}
{\langle R_{x ,y ,z}| R_{a ,b ,c}\rangle}=\delta^{\left(3\right)}\! \left(\left[a -x ,b -y ,c -z \right]\right)
\end{dmath}
\begin{Maple Normal}
In the above, the 3-dimensional \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Dirac}{Dirac} function can be expanded using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=expand}{expand}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mapleref{(362)}) $}

% \mapleresult
\begin{dmath}\label{(363)}
{\textcolor{gray}{\langle}R_{x ,y ,z}\textcolor{gray}{|}R_{a ,b ,c}\textcolor{gray}{\rangle}}=\delta \! \left(a -x \right) \delta \! \left(b -y \right) \delta \! \left(c -z \right)
\end{dmath}
\subsubsection{\label{bkmrk32}\textbf{\textit{Closure relation, Projectors}}}
\begin{center}
\begin{Maple Normal}

\end{Maple Normal}
\end{center}
\begin{Maple Normal}
Every \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{Ket} of a space of states can be expanded into a basis of that space. The operator that performs the expansion is called a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Projector#}{Projector}. To construct these projectors, information about the basis dimension is necessary. You can indicate this dimension directly to the \textbf{Projector} command, or set it by using \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup}. The information available at this point is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{basisdim} ,\mathit{cont}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{basisdim} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{quantumbasisdimension} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{cont} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{quantumcontinuousbasis} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(364)}
\left[\mathit{quantumbasisdimension}  \hiderel{=} \mathit{none} ,\mathit{quantumcontinuousbasis}  \hiderel{=} \left\{R \right\}\right]
\end{dmath}
\begin{Maple Normal}
By default, continuous bases are assumed to range from 
{$ -\infty  $} to 
{$ \infty  $}, so this information on \textit{R} is enough to compute its \textbf{Projector}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} P [R]\coloneqq \mathit{Projector} (\mathit{Ket} (R ,x ,y ,z)) $}

% \mapleresult
\begin{dmath}\label{(365)}
\textcolor{olive}{P}_{R}\coloneqq {\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{| R_{x ,y ,z}\rangle} {\langle R_{x ,y ,z}|}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z 
\end{dmath}
\begin{Maple Normal}
This expression 
{$ P_{R} $} for the projector is also called the \textbf{\textit{closure relation}}; together with the \textbf{\textit{orthonormalization relation }}
{$ {\langle R_{x ,y ,z}| R_{a ,b ,c}\rangle}=\delta^{(3)}([a -x ,b -y ,c -z]) $}, it tells that the set of Kets \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket#}{}
{$ {\{{| R_{x ,y ,z}\rangle}\}} $} containing all the possible values of \textit{x}, \textit{y}, and \textit{z} forms a basis, and so any\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket#}{} 
{$ {| \psi \rangle} $} has a unique expansion onto 
{$ {\{{| R_{x ,y ,z}\rangle}\}} $}\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket#}{}. Note that the scalar product of 
{$ P_{R} $} with itself is equal to itself.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} P [R]\,.\,P [R] $}

% \mapleresult
\begin{dmath}\label{(366)}
{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{| R_{x ,y ,z}\rangle} {\langle R_{x ,y ,z}|}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z 
\end{dmath}
\begin{Maple Normal}
The following is the projector for a basis generically labeled \textit{u} that has not been set to represent a continuous basis. By default, if nothing is known about the label of a basis, it is assumed to be related to a discrete space of states. The dimension of the basis can be indicated directly to the \textbf{Projector} command.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} P [u]\coloneqq \mathit{Projector} (\mathit{Ket} (u ,n),\mathit{dimension} =\,N) $}

% \mapleresult
\begin{dmath}\label{(367)}
\textcolor{olive}{P}_{u}\coloneqq \moverset{N -1}{\munderset{n =0}{\textcolor{gray}{\sum}}}\! {| u_{n}\rangle} {\langle u_{n}|}
\end{dmath}
\begin{Maple Normal}
The information passed to \textbf{Projector} is automatically tracked by the system, so you do not need to give it again.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{quantumbasisdimension} ,\mathit{quantumcontinuousbasis}) $}

% \mapleresult
\begin{dmath}\label{(368)}
\left[\mathit{quantumbasisdimension}  \hiderel{=} \left\{R  \hiderel{=} \infty ,u  \hiderel{=} N \right\},\mathit{quantumcontinuousbasis}  \hiderel{=} \left\{R \right\}\right]
\end{dmath}
\begin{Maple Normal}
To change this information, see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} and its \textit{redo} option. In order to compute scalar products of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket#}{Kets} belonging to a basis with other \textbf{Kets} of the same space, you can define a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{bracketrule}\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Bracket} (\mathit{Bra} (R ,x ,y ,z),\mathit{Ket} (\mathrm{psi}))=\,\mathrm{psi}(x ,y ,z) $}

% \mapleresult
\begin{dmath}\label{(369)}
{\textcolor{gray}{\langle}R_{x ,y ,z}\textcolor{gray}{|}\psi \textcolor{gray}{\rangle}}=\psi \! \left(x ,y ,z \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\%) $}

% \mapleresult
\begin{dmath}\label{(370)}
\left[\mathit{bracketrules} =\left\{{\textcolor{gray}{\langle}u \textcolor{gray}{|}v \textcolor{gray}{\rangle}} \hiderel{=} f \! \left(u ,v \right),{\textcolor{gray}{\langle}R_{x ,y ,z}\textcolor{gray}{|}\psi \textcolor{gray}{\rangle}} \hiderel{=} \psi \! \left(x ,y ,z \right)\right\}\right]
\end{dmath}
\begin{Maple Normal}
Now \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bracket}{Bracket} and the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/.}{`.`} operator of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{Physics} package know how to compute a number of related operations.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bracket} (\mathit{Bra} (R ,a ,b ,c),\mathit{Ket} (\mathrm{psi})) $}

% \mapleresult
\begin{dmath}\label{(371)}
\psi \! \left(a ,b ,c \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} P [R]\,.\,\mathit{Ket} (\mathrm{psi}) $}

% \mapleresult
\begin{dmath}\label{(372)}
{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\psi \! \left(x ,y ,z \right) {| R_{x ,y ,z}\rangle}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bra} (\mathrm{psi})\,.\,P [R] $}

% \mapleresult
\begin{dmath}\label{(373)}
{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}\overline{\psi \! \left(x ,y ,z \right)} {\langle R_{x ,y ,z}|}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Bra} (\mathrm{psi})\,.\,P [R]\,.\,\mathit{Ket} (\mathrm{psi}) $}

% \mapleresult
\begin{dmath}\label{(374)}
{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{| \psi \! \left(x ,y ,z \right)|}^{2}\textcolor{gray}{d}x \textcolor{gray}{d}y \textcolor{gray}{d}z 
\end{dmath}
\begin{Maple Normal}
This is a bracket rule for the scalar product of a state-vector of the discrete basis \textit{u} and 
{$ {| \psi \rangle} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Bracket} (\mathit{Bra} (u ,n),\mathit{Ket} (\mathrm{psi}))=\,\mathrm{psi}(n) $}

% \mapleresult
\begin{dmath}\label{(375)}
{\textcolor{gray}{\langle}u_{n}\textcolor{gray}{|}\psi \textcolor{gray}{\rangle}}=\psi \! \left(n \right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\%) $}

% \mapleresult
\begin{dmath}\label{(376)}
\left[\mathit{bracketrules} =\left\{{\textcolor{gray}{\langle}u \textcolor{gray}{|}v \textcolor{gray}{\rangle}} \hiderel{=} f \! \left(u ,v \right),{\textcolor{gray}{\langle}u_{n}\textcolor{gray}{|}\psi \textcolor{gray}{\rangle}} \hiderel{=} \psi \! \left(n \right),
\\
{\textcolor{gray}{\langle}R_{x ,y ,z}\textcolor{gray}{|}\psi \textcolor{gray}{\rangle}}\hiderel{=}\psi \! \left(x ,y ,z \right)\right\}\right]
\end{dmath}
\begin{Maple Normal}
This rule for 
{$ {\langle u_{n}| \psi \rangle} $} permits projecting 
{$ {\langle \psi | \psi \rangle} $} onto the \textit{u} basis, which is equivalent to inserting a projector between 
{$ {\langle \psi |} $} and 
{$ {| \psi \rangle} $}. \textbf{Note} the use of \textit{delay evaluation quotes} surrounding the Bracket; the operation is performed in the next line by using \%.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \esapos \,\mathit{Bracket} (\mathrm{psi},P [u],\mathrm{psi})\,\esapos  $}

% \mapleresult
\begin{dmath}\label{(377)}
{\langle \psi | \textcolor{olive}{P}_{u}| \psi \rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \%  $}

% \mapleresult
\begin{dmath}\label{(378)}
\moverset{N -1}{\munderset{n =0}{\textcolor{gray}{\sum}}}\! {| \psi \! \left(n \right)|}^{2}
\end{dmath}
\begin{Maple Normal}
A \textbf{Ket} can have different types of spaces associated with its quantum numbers. In the following example, \textbf{Kets} from a basis \textit{B} have four quantum numbers, two of which, 
{$ B_{3} $} and 
{$ B_{4} $}, are associated with continuous spaces, and the dimension of the space associated with each quantum number is different.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{quantumcontinuousbasis} =\,\{B [3],B [4]\},\mathit{quantumbasisdimension} =\,\{B [1]=-1/2..1/2,B [2]=\,0..N ,B [3]=-a ..a ,B [4]=-\mathrm{infinity}..\mathrm{infinity}\})
\\
  $}

% \mapleresult
\begin{dmath}\label{(379)}
\left[\mathit{quantumbasisdimension}  \hiderel{=} \left\{R  \hiderel{=} \infty ,u  \hiderel{=} N ,B_{1} \hiderel{=} -\frac{1}{2}..\frac{1}{2},B_{2} \hiderel{=} 0..N ,B_{3} \hiderel{=} -a ..a ,B_{4} \hiderel{=} -\infty ..\infty \right\},
\\
\mathit{quantumcontinuousbasis} \hiderel{=}\left\{R ,B_{3},B_{4}\right\}\right]
\end{dmath}
\begin{Maple Normal}
This is the projector onto the basis \textit{B}:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Projector} (\mathit{Ket} (B ,n ,m ,x ,y)) $}

% \mapleresult
\begin{dmath}\label{(380)}
{\textcolor{gray}{\int}}_{\!\!\!-\infty}^{\infty}{\textcolor{gray}{\int}}_{\!\!\!-a}^{a}\left(\moverset{N}{\munderset{m =0}{\textcolor{gray}{\sum}}}\! \moverset{1}{\munderset{n =0}{\textcolor{gray}{\sum}}}\! {| B_{n -\frac{1}{2},m ,x ,y}\rangle} {\langle B_{n -\frac{1}{2},m ,x ,y}|}\right)\textcolor{gray}{d}x \textcolor{gray}{d}y 
\end{dmath}
\subsubsection{\label{bkmrk33}\textbf{\textit{Quantum operators, eigenvectors, eigenvalues and commutators}}}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
To indicate to the system that a letter represents a quantum operator, use the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command; this sets \textit{B} as a quantum operator.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{op} =B) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{op} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{quantumoperators} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(381)}
\left[\mathit{quantumoperators} =\left\{\textcolor{olive}{B}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Note that the display of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=type,noncommutative}{noncommutative} objects in different colors; to change this color, see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{?Setup}.  Because \textit{B} is now a quantum operator, 
{$ {| B_{m ,n ,x ,y}\rangle} $} is an eigenvector of the four operators 
{$ \textcolor{olive}{B}_{1},\textcolor{olive}{B}_{2},\textcolor{olive}{B}_{3} $}, and 
{$ \textcolor{olive}{B}_{4} $}, with eigenvalues \textit{m}, \textit{n}, \textit{x}, and \textit{y}, respectively. For example,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} B [2]\,.\,\mathit{Ket} (B ,m ,n ,x ,y) $}

% \mapleresult
\begin{dmath}\label{(382)}
n {| \textcolor{olive}{B}_{m ,n ,x ,y}\rangle}
\end{dmath}
\begin{Maple Normal}
Quantum operators can also be 3-D Euclidean vectors; for that purpose, you must load the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors}{Physics[Vectors]} subpackage.\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics}{}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{with} (\mathit{Vectors}) $}

% \mapleresult
\begin{dmath}\label{(383)}
\left[\mathit{\&x} ,\mathit{+},\mathit{.},\mathit{ChangeBasis} ,\mathit{ChangeCoordinates} ,\mathit{Component} ,
\\
\mathit{Curl} ,\mathit{DirectionalDiff} ,\mathit{Divergence} ,\mathit{Gradient} ,\mathit{Identify} ,
\\
\mathit{Laplacian} ,\nabla ,\mathit{Norm} ,\mathit{Setup} ,\mathit{diff} \right]
\end{dmath}
\begin{Maple Normal}
Set the vectors 
{$ {\moverset{\rightarrow}{L}} $}, 
{$ {\moverset{\rightarrow}{r}} $}, and 
{$ {\moverset{\rightarrow}{p}} $} as quantum operators (note the use of the option \textit{redo} to erase previous definitions of quantum operators).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{op} =\,\{\textit{L\_} ,\textit{r\_} ,\textit{p\_} ,x ,y ,z ,{p{\idn{x}}},{p{\idn{y}}},{p{\idn{z}}},L_{x},L_{y},L_{z}\},\mathit{redo}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{op} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{quantumoperators} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(384)}
\left[\mathit{quantumoperators} =\left\{{\moverset{\rightarrow}{\textcolor{olive}{L}}},\textcolor{olive}{L}_{\textcolor{olive}{x}},\textcolor{olive}{L}_{\textcolor{olive}{y}},\textcolor{olive}{L}_{\textcolor{olive}{z}},{\moverset{\rightarrow}{\textcolor{olive}{p}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\moverset{\rightarrow}{\textcolor{olive}{r}}},\textcolor{olive}{x},\textcolor{olive}{y},\textcolor{olive}{z}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Define 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} as the angular momentum operator 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}}={\moverset{\rightarrow}{\textcolor{olive}{r}}}\times {\moverset{\rightarrow}{\textcolor{olive}{p}}} $}, and set commutation rules for the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors/Component}{components} of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $}. To enter the cross product you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{L\_} \coloneqq \textit{r\_} \times \textit{p\_}  $}

% \mapleresult
\begin{dmath}\label{(385)}
{\moverset{\rightarrow}{\textcolor{olive}{L}}}\coloneqq {\moverset{\rightarrow}{\textcolor{olive}{r}}}\times {\moverset{\rightarrow}{\textcolor{olive}{p}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j} +z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(386)}
{\moverset{\rightarrow}{\textcolor{olive}{r}}}\coloneqq \hat{i} \textcolor{olive}{x}+\hat{j} \textcolor{olive}{y}+\hat{k} \textcolor{olive}{z}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{p\_} \coloneqq {p{\idn{x}}}\,\textit{\_i} +{p{\idn{y}}}\,\textit{\_j} +{p{\idn{z}}}\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(387)}
{\moverset{\rightarrow}{\textcolor{olive}{p}}}\coloneqq \hat{i} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}+\hat{j} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}+\hat{k} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}
\end{dmath}
\begin{Maple Normal}
Vector calculus with noncommutative components preserves 
{$ {\moverset{\rightarrow}{\textcolor{olive}{A}}}\cdot {\moverset{\rightarrow}{\textcolor{olive}{B}}}={\moverset{\rightarrow}{\textcolor{olive}{B}}}\cdot {\moverset{\rightarrow}{\textcolor{olive}{A}}} $}  and  
{$ {\moverset{\rightarrow}{\textcolor{olive}{A}}}\times {\moverset{\rightarrow}{\textcolor{olive}{B}}}=-{\moverset{\rightarrow}{\textcolor{olive}{B}}}\times {\moverset{\rightarrow}{\textcolor{olive}{A}}} $}. This is achieved by symmetrizing and antisymmetrizing, respectively, each of these products. For example, below is the \textbf{Component} of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} along the \textit{x-}axis.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{\_i} \,.\,\textit{L\_}  $}

% \mapleresult
\begin{dmath}\label{(388)}
\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}
\end{dmath}
\begin{Maple Normal}
To enter the commutation rules between each component of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $} with each other, you can write these commutators and pass the whole set to \textbf{Setup}. When there are many, as in this case, it is more convenient to use a Matrix and an indexing function. Enter the core information as a procedure: \textit{C} represents the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Commutator}{Commutator} of the \textbf{Components} of the vectors 
{$ {\moverset{\rightarrow}{a}} $} and 
{$ {\moverset{\rightarrow}{b}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} C \coloneqq (\textit{a\_} ,i ,\textit{b\_} ,j)\,\rightarrow \,\mathit{\%\!Commutator} (\mathit{Component} (\textit{a\_} ,i),\mathit{Component} (\textit{b\_} ,j)) $}

% \mapleresult
\begin{dmath}\label{(389)}
C \coloneqq \left({\moverset{\rightarrow}{a}},i ,{\moverset{\rightarrow}{b}},j \right)\hiderel{\mapsto }\left[\left({\moverset{\rightarrow}{a}}\right)_{i},\left({\moverset{\rightarrow}{b}}\right)_{j}\right]_{-}
\end{dmath}
\begin{Maple Normal}
So, given \textit{i} and \textit{j} from 1 to 3 identifying the components of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $}, an algebra can be set as set as follows.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{algebra} \coloneqq (i ,j)\,\rightarrow \,(C (\textit{r\_} ,i ,\textit{p\_} ,j)=\,I *\mathit{KroneckerDelta} [i ,j], \,C (\textit{r\_} ,i ,\textit{r\_} ,j)=\,0, \,C (\textit{p\_} ,i ,\textit{p\_} ,j)=\,0) $}

% \mapleresult
\begin{dmath}\label{(390)}
\mathit{algebra} \coloneqq \left(i ,j \right)\hiderel{\mapsto }\left(C \! \left({\moverset{\rightarrow}{\textcolor{olive}{r}}},i ,{\moverset{\rightarrow}{\textcolor{olive}{p}}},j \right) \hiderel{=} \mathrm{I} {\delta{\idn{i}\idn{j}}},C \! \left({\moverset{\rightarrow}{\textcolor{olive}{r}}},i ,{\moverset{\rightarrow}{\textcolor{olive}{r}}},j \right) \hiderel{=} 0,
\\
C \! \left({\moverset{\rightarrow}{\textcolor{olive}{p}}},i ,{\moverset{\rightarrow}{\textcolor{olive}{p}}},j \right)\hiderel{=}0\right)
\end{dmath}
\begin{Maple Normal}
Now all of the commutators between each component of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $} can be constructed with one call to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Matrix}{Matrix}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Matrix} (3,3,\mathit{algebra}) $}

% \mapleresult
\begin{dmath}\label{(391)}
\left[\begin{array}{ccc}
\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{x},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\\
 \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{y},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\\
 \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{z},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\end{array}\right]
\end{dmath}
\begin{Maple Normal}
Pass this \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Matrix}{Matrix} to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} to set the algebra rules.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\%) $}

% \mapleresult
\begin{dmath}\label{(392)}
\left[\mathit{algebrarules} =\left\{\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,
\\
\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-}\hiderel{=}0,\left[\textcolor{olive}{x},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} \mathrm{I},
\\
\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-}\hiderel{=}0,\left[\textcolor{olive}{y},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} \mathrm{I}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Set, for instance, the values of 
{$ \textcolor{olive}{\mathit{Lx}},\textcolor{olive}{\mathit{Ly}} $}, and 
{$ \textcolor{olive}{\mathit{Lz}} $}, the components of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L_{x}\coloneqq \textit{\_i} \,.\,\textit{L\_}  $}

% \mapleresult
\begin{dmath}\label{(393)}
\textcolor{olive}{L}_{\textcolor{olive}{x}}\coloneqq \textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L_{y}\coloneqq \textit{\_j} \,.\,\textit{L\_}  $}

% \mapleresult
\begin{dmath}\label{(394)}
\textcolor{olive}{L}_{\textcolor{olive}{y}}\coloneqq \textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L_{z}\coloneqq \textit{\_k} \,.\,\textit{L\_}  $}

% \mapleresult
\begin{dmath}\label{(395)}
\textcolor{olive}{L}_{\textcolor{olive}{z}}\coloneqq \textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}-\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}
\end{dmath}
\begin{Maple Normal}
Verify the commutator algebra for these components of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Commutator} (L_{x},L_{y})=\,I \,L_{z} $}

% \mapleresult
\begin{dmath}\label{(396)}
-\mathrm{I} \textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}+\mathrm{I} \textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}=\mathrm{I} \left(\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}-\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Commutator} (L_{z},L_{x})=\,I \,L_{y} $}

% \mapleresult
\begin{dmath}\label{(397)}
-\mathrm{I} \textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}+\mathrm{I} \textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}=\mathrm{I} \left(\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right)
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Commutator} (L_{y},L_{z})=\,I \,L_{x} $}

% \mapleresult
\begin{dmath}\label{(398)}
-\mathrm{I} \textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}+\mathrm{I} \textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}=\mathrm{I} \left(\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right)
\end{dmath}
\begin{Maple Normal}
The three equations above are identically true. 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
Other operators frequently used in different contexts are the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Annihilation}{Annihilation and Creation} operators: they augment or diminish the value of a quantum number by one. These operators are suitable, for instance, for working with multi-particle vector states; in that context the quantum numbers are called occupation numbers. This constructs a pair of annihilation/creation operators acting on the basis \textit{A} involving only one quantum number.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{am} \coloneqq \mathit{Annihilation} (A) $}

% \mapleresult
\begin{dmath}\label{(399)}
\mathit{am} \coloneqq {\textcolor{olive}{a}}^{\textcolor{olive}{-}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ap} \coloneqq \mathit{Creation} (A) $}

% \mapleresult
\begin{dmath}\label{(400)}
\mathit{ap} \coloneqq {\textcolor{olive}{a}}^{\textcolor{olive}{+}}
\end{dmath}
\begin{Maple Normal}
\textbf{Annihilation} and \textbf{Creation} operators act on \textbf{Kets} belonging to discrete bases and assume that the "lower" state happens when the quantum number is equal to zero (frequently called "vacuum": a ket with occupation number equal to zero represents a state with "no particles").
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{am} \,.\,\mathit{Ket} (A ,n) $}

% \mapleresult
\begin{dmath}\label{(401)}
\sqrt{n}\, {| A_{n -1}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{am} \,.\,\%  $}

% \mapleresult
\begin{dmath}\label{(402)}
\sqrt{n}\, \sqrt{n -1}\, {| A_{n -2}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ap} \,.\,\mathit{Ket} (A ,n) $}

% \mapleresult
\begin{dmath}\label{(403)}
\sqrt{n +1}\, {| A_{n +1}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{ap} \,.\,\%  $}

% \mapleresult
\begin{dmath}\label{(404)}
\sqrt{n +1}\, \sqrt{n +2}\, {| A_{n +2}\rangle}
\end{dmath}
\begin{Maple Normal}
The \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Commutator}{Commutator} of the operators 
{$ \textcolor{olive}{a}\textcolor{olive}{\mathit{-}} $} and 
{$ \textcolor{olive}{a}\textcolor{olive}{\mathit{+}} $} are automatically set when these operators are constructed, and satisfy (note the use of the inert form \textbf{\%Commutator}):
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Commutator} (\mathit{am} ,\mathit{ap}) $}

% \mapleresult
\begin{dmath}\label{(405)}
\left[{\textcolor{olive}{a}}^{\textcolor{olive}{-}},{\textcolor{olive}{a}}^{\textcolor{olive}{+}}\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(406)}
1
\end{dmath}
\begin{Maple Normal}
To indicate that the Kets of a basis are fermionic, use an \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=type,anticommutative}{anticommutative} variable to label the basis. To set the prefix identifier of anticommutative variables use the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{anticommutativeprefix} =\,\mathrm{Theta}) $}

% \mapleresult
\begin{dmath}\label{(407)}
\left[\mathit{anticommutativeprefix} =\left\{\textcolor{purple}{\Theta}\right\}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{type} (\mathrm{Theta},\mathit{anticommutative}) $}

% \mapleresult
\begin{dmath}\label{(408)}
\mathit{true} 
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (\mathrm{Theta}) $}

% \mapleresult
\begin{dmath}\label{(409)}
{| \textcolor{purple}{\Theta}\rangle}
\end{dmath}
\begin{Maple Normal}
Construct \textbf{Annihilation} and \textbf{Creation} operators acting on this basis; use the option \textit{notation = explicit} so that the basis and the quantum numbers onto which these operators act are explicit.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Am} \coloneqq \mathit{Annihilation} (\mathrm{Theta},\mathit{notation} =\,\mathit{explicit}) $}

% \mapleresult
\begin{dmath}\label{(410)}
\mathit{Am} \coloneqq {\textcolor{olive}{a}}^{\textcolor{olive}{-}}_{\textcolor{purple}{\Theta}_{1}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ap} \coloneqq \mathit{Creation} (\mathrm{Theta},\mathit{notation} =\,\mathit{explicit}) $}

% \mapleresult
\begin{dmath}\label{(411)}
\mathit{Ap} \coloneqq {\textcolor{olive}{a}}^{\textcolor{olive}{+}}_{\textcolor{purple}{\Theta}_{1}}
\end{dmath}
\begin{Maple Normal}
The \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/AntiCommutator}{AntiCommutator} of these operators satisfy
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!AntiCommutator} (\mathit{Am} ,\mathit{Ap}) $}

% \mapleresult
\begin{dmath}\label{(412)}
\left[{\textcolor{olive}{a}}^{\textcolor{olive}{-}}_{\textcolor{purple}{\Theta}_{1}},{\textcolor{olive}{a}}^{\textcolor{olive}{+}}_{\textcolor{purple}{\Theta}_{1}}\right]_{+}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(413)}
1
\end{dmath}
\begin{Maple Normal}
According to Pauli's exclusion principle, only one fermionic particle can be in a given state, so starting from the vacuum,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ket} (\mathrm{Theta},0) $}

% \mapleresult
\begin{dmath}\label{(414)}
{| \textcolor{purple}{\Theta}_{0}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ap} \,.\,\%  $}

% \mapleresult
\begin{dmath}\label{(415)}
{| \textcolor{purple}{\Theta}_{1}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Ap} \,.\,\%  $}

% \mapleresult
\begin{dmath}\label{(416)}
0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Am} \,.\,\%\%  $}

% \mapleresult
\begin{dmath}\label{(417)}
{| \textcolor{purple}{\Theta}_{0}\rangle}
\end{dmath}
\begin{Maple Normal}
And as is always the case, the annihilation operator acting on the vacuum returns zero
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Am} \,.\,\%  $}

% \mapleresult
\begin{dmath}\label{(418)}
0
\end{dmath}
\subsection{\label{bkmrk34}\textbf{\textit{The commutation relation }}\(\! [\textcolor{olive}{Q},\textcolor{olive}{P}]_{-}=\mathrm{I} \hslash  \!\)\textbf{\textit{ implies }}\(\! \frac{\hslash^{2}}{4}\le {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{P})}^{2}\rangle} {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{Q})}^{2}\rangle} \!\)}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon  $}

\begin{Maple Normal}
Consider two conjugate observables \textit{Q}, \textit{P}, and the corresponding Hermitian operators satisfying 
{$ [\textcolor{olive}{Q},\textcolor{olive}{P}]_{-}=\mathrm{I} \hslash  $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{macro} (h =\,\hslash)\colon 
\\
 \mathit{Setup} (\mathit{Hermitian} =\,\{P ,Q \},\mathit{\%\!Commutator} (Q ,P)=\,h *I) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{Hermitian} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{hermitianoperators} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(419)}
\left[\mathit{algebrarules}  \hiderel{=} \left\{\left[\textcolor{olive}{Q},\textcolor{olive}{P}\right]_{-}=\mathrm{I} \hslash \right\},\mathit{hermitianoperators}  \hiderel{=} \left\{\textcolor{olive}{P},\textcolor{olive}{Q}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Suppose now that the system where 
{$ \textcolor{olive}{Q} $} and 
{$ \textcolor{olive}{P} $} act is in some state 
{$ {| \psi \rangle} $} normalized to 1, and set 
{$ {| \psi \rangle} $} as the default state for computing \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Bracket}{Brackets}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{\%\!Bracket} (\mathrm{psi},\mathrm{psi})=\,1,\mathit{bracketbasis} =\,\mathrm{psi}) $}

% \mapleresult
\begin{dmath}\label{(420)}
\left[\mathit{bracketbasis}  \hiderel{=} \psi ,\mathit{bracketrules}  \hiderel{=} \left\{{\textcolor{gray}{\langle}\psi \textcolor{gray}{|}\psi \textcolor{gray}{\rangle}}=1\right\}\right]
\end{dmath}
\begin{Maple Normal}
The mean values of the operators 
{$ \textcolor{olive}{Q} $} and 
{$ \textcolor{olive}{P} $} in the state 
{$ {| \psi \rangle} $} are then given by:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Qm} \coloneqq \mathit{Bracket} (Q)\,\esnum \mathit{\,\,\,Shortcut\,for\,Bracket(psi,\,Q,\,psi)\,after\,having\,set\,the\,bracketbasis\,to\,psi\,}  $}

% \mapleresult
\begin{dmath}\label{(421)}
\mathit{Qm} \coloneqq {\langle \textcolor{olive}{Q}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Pm} \coloneqq \mathit{Bracket} (P) $}

% \mapleresult
\begin{dmath}\label{(422)}
\mathit{Pm} \coloneqq {\langle \textcolor{olive}{P}\rangle}
\end{dmath}
\begin{Maple Normal}
Let's introduce another Hermitian operator, 
{$ \textcolor{olive}{\Delta} $}, and denote 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{Q}) $} and 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{P}) $} the operators representing the observable deviations from these mean values by 
{$ {\langle \textcolor{olive}{Q}\rangle} $} and 
{$ {\langle \textcolor{olive}{P}\rangle} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{her} =\,\mathrm{Delta}) $}

% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\mathit{*}\mathit{\,Partial\,match\,of\,}\mathit{\esapos} \mathit{her} \mathit{\esapos}\mathit{\,against\,keyword\,}\mathit{\esapos} \mathit{hermitianoperators} \mathit{\esapos}\]}
\end{maplelatex}
% \mapleresult
\begin{maplelatex}
\mapleinline{inert}{2d}{}
{\[\underline{\hspace{68.75 ex}}\]}
\end{maplelatex}
% \mapleresult
\begin{dmath}\label{(423)}
\left[\mathit{hermitianoperators} =\left\{\textcolor{olive}{\Delta},\textcolor{olive}{P},\textcolor{olive}{Q}\right\}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{DQ} \coloneqq \mathrm{Delta}(Q)=\,Q -\mathit{Bracket} (Q) $}

% \mapleresult
\begin{dmath}\label{(424)}
\mathit{DQ} \coloneqq \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)=\textcolor{olive}{Q}-{\langle \textcolor{olive}{Q}\rangle}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{DP} \coloneqq \mathrm{Delta}(P)=\,P -\mathit{Bracket} (P) $}

% \mapleresult
\begin{dmath}\label{(425)}
\mathit{DP} \coloneqq \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)=\textcolor{olive}{P}-{\langle \textcolor{olive}{P}\rangle}
\end{dmath}
\begin{Maple Normal}
The value of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Commutator}{Commutator} between 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{Q}) $} and 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{P}) $} is a consequence of the value of the Commutator between 
{$ \textcolor{olive}{Q} $} and 
{$ \textcolor{olive}{P} $}, and so it can be computed by rewriting the deviations in terms of 
{$ \textcolor{olive}{Q} $} and 
{$ \textcolor{olive}{P} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Commutator} (\mathrm{Delta}(Q),\mathrm{Delta}(P)) $}

% \mapleresult
\begin{dmath}\label{(426)}
\left[\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right),\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{eval} (\% ,\{\mathit{DQ} ,\mathit{DP} \}) $}

% \mapleresult
\begin{dmath}\label{(427)}
\left[\textcolor{olive}{Q}-{\langle \textcolor{olive}{Q}\rangle},\textcolor{olive}{P}-{\langle \textcolor{olive}{P}\rangle}\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%) $}

% \mapleresult
\begin{dmath}\label{(428)}
\mathrm{I} \hslash 
\end{dmath}
\begin{Maple Normal}
Track this result as an algebra rule, so that in what follows we compute directly with 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{Q}) $} and 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{P}) $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\%\%\% =\,\%) $}

% \mapleresult
\begin{dmath}\label{(429)}
\left[\mathit{algebrarules} =\left\{\left[\textcolor{olive}{Q},\textcolor{olive}{P}\right]_{-} \hiderel{=} \mathrm{I} \hslash ,\left[\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right),\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)\right]_{-} \hiderel{=} \mathrm{I} \hslash \right\}\right]
\end{dmath}
\begin{Maple Normal}
To show now that 
{$ [\textcolor{olive}{Q},\textcolor{olive}{P}]_{-}=\mathrm{I} \hslash  $} implies 
{$ \frac{\hslash^{2}}{4}\le {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{P})}^{2}\rangle} {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{Q})}^{2}\rangle} $}, consider the action of these deviation operators 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{Q}) $} and 
{$ \textcolor{olive}{\Delta}(\textcolor{olive}{P}) $}on the state of the system 
{$ {| \psi \rangle} $}, and construct with them a new \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Ket}{Ket} involving a real parameter 
{$ \lambda  $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} (\mathrm{Delta}(Q)+I \,\mathrm{lambda}\,\mathrm{Delta}(P))\,.\,\mathit{Ket} (\mathrm{psi}) $}

% \mapleresult
\begin{dmath}\label{(430)}
\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)\cdot {| \psi \rangle}+\mathrm{I} \lambda  \left(\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)\cdot {| \psi \rangle}\right)
\end{dmath}
\begin{Maple Normal}
The square of the norm of this Ket, for 
{$ \lambda  $} real, is
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Dagger} (\%)\cdot \% \mathrm{assuming}\,\lambda ::\mathit{real}  $}

% \mapleresult
\begin{dmath}\label{(431)}
{\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)}^{2}\rangle} \lambda^{2}+\mathrm{I} \lambda  {\langle \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right) \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)\rangle}-\mathrm{I} {\langle \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right) \textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)\rangle} \lambda +{\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)}^{2}\rangle}
\end{dmath}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Simplify}{Simplify} this norm, taking into account the commutator 
{$ [\textcolor{olive}{\Delta}(\textcolor{olive}{Q}),\textcolor{olive}{\Delta}(\textcolor{olive}{P})]_{-}=\mathrm{I} \hslash  $}, set in \textbf{(6.2.12)}
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\%) $}

% \mapleresult
\begin{dmath}\label{(432)}
-\hslash  \lambda +{\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)}^{2}\rangle} \lambda^{2}+{\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)}^{2}\rangle}
\end{dmath}
\begin{Maple Normal}
This is a polynomial in 
{$ \lambda  $} of second degree; its \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=discrim}{discriminant} is negative or zero.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{discrim} (\% ,\mathrm{lambda})\,\le \,0 $}

% \mapleresult
\begin{dmath}\label{(433)}
\hslash^{2}-4 {\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)}^{2}\rangle} {\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)}^{2}\rangle}\le 0
\end{dmath}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=isolate}{isolating} 
{$ \frac{\hslash^{2}}{4} $}, we obtain the lower bound for 
{$ {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{P})}^{2}\rangle} {\langle {\textcolor{olive}{\Delta}(\textcolor{olive}{Q})}^{2}\rangle} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \frac{\mathit{isolate} (\% ,h^{2})}{4} $}

% \mapleresult
\begin{dmath}\label{(434)}
\frac{\hslash^{2}}{4}\le {\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{P}\right)}^{2}\rangle} {\langle {\textcolor{olive}{\Delta}\! \left(\textcolor{olive}{Q}\right)}^{2}\rangle}
\end{dmath}
\begin{Maple Normal}
Note that this result is a consequence of 
{$ [\textcolor{olive}{\Delta}(\textcolor{olive}{Q}),\textcolor{olive}{\Delta}(\textcolor{olive}{P})]_{-}=\mathrm{I} \hslash  $}, which in turn is a consequence of 
{$ [\textcolor{olive}{Q},\textcolor{olive}{P}]_{-}=\mathrm{I} \hslash  $}, so that 
{$ \textcolor{olive}{Q} $} and 
{$ \textcolor{olive}{P} $} too satisfy 
{$ \frac{\hslash^{2}}{4}\le {\langle {\textcolor{olive}{P}}^{2}\rangle} {\langle {\textcolor{olive}{Q}}^{2}\rangle} $}, and in fact the product of \textit{any} two conjugate Hermitian operators, as well as of the root-mean square deviations of them, satisfy this inequality.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\subsection{\label{bkmrk35}\textbf{\textit{Angular momentum: }}\(\! [{\|{\moverset{\rightarrow}{\textcolor{olive}{L}}}\|}^{2},\textcolor{olive}{L}_{i}]_{-}=0 \!\) \textbf{\textit{and}}  \(\! [\textcolor{olive}{L}_{i},\textcolor{olive}{L}_{j}]_{-}=\mathrm{I} \epsilon_{i ,j ,k} \textcolor{olive}{L}_{k} \!\)}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
1. Consider the angular momentum operators 
{$ {\|{\moverset{\rightarrow}{\textcolor{olive}{L}}}\|}^{2} $}, 
{$ \textcolor{olive}{L}_{\textcolor{olive}{x}} $}, 
{$ \textcolor{olive}{L}_{\textcolor{olive}{y}} $}, and 
{$ \textcolor{olive}{L}_{\textcolor{olive}{z}} $} in quantum mechanics. We want to verify that the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Commutator}{Commutator} of 
{$ {\|{\moverset{\rightarrow}{\textcolor{olive}{L}}}\|}^{2} $} with any of the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors/Component}{components} of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} is zero (see, for instance, Chapter VI of Cohen-Tannoudji). For that purpose, a 3-D vector-quantum-operator representation of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} is constructed with the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Vectors}{Vectors} package (\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup#vectorpostfix}{vectorpostfix identifier} is '\_'), and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}}, $}
{$ \textcolor{olive}{L}_{\textcolor{olive}{x}},\textcolor{olive}{L}_{\textcolor{olive}{y}} $}, and 
{$ \textcolor{olive}{L}_{\textcolor{olive}{z}} $} as well as 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $} and their components are set as quantum operators.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{restart} \colon 
\\
 \mathit{with} (\mathit{Physics})\colon 
\\
 \mathit{with} (\mathit{Vectors})\colon  $}

\begin{Maple Normal}
To set the components 
{$ \textcolor{olive}{L}_{\textcolor{olive}{i}} $} and 
{$ {\textcolor{olive}{p}{\idn{\textcolor{olive}{j}}}} $} as quantum operators, it suffices to set 
{$ \textcolor{olive}{L} $} and 
{$ \textcolor{olive}{p} $}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} \mathit{Setup} (\mathit{quantumoperators} =\{\textit{L\_} ,L ,\textit{r\_} ,x ,y ,z ,\textit{p\_} ,p \}) $}

% \mapleresult
\begin{dmath}\label{(435)}
\mathit{Setup} \left[\mathit{quantumoperators} =\left\{\textcolor{olive}{L},{\moverset{\rightarrow}{\textcolor{olive}{L}}},\textcolor{olive}{p},{\moverset{\rightarrow}{\textcolor{olive}{p}}},{\moverset{\rightarrow}{\textcolor{olive}{r}}},\textcolor{olive}{x},\textcolor{olive}{y},\textcolor{olive}{z}\right\}\right]
\end{dmath}
\begin{Maple Normal}
So for 
{$ {\|{\moverset{\rightarrow}{\textcolor{olive}{L}}}\|}^{2} $} and for 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} itself in terms of the vector operators 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $}, you have
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{LL} \coloneqq \textit{L\_} \,.\,\textit{L\_}  $}

% \mapleresult
\begin{dmath}\label{(436)}
\mathit{LL} \coloneqq {\moverset{\rightarrow}{\textcolor{olive}{L}}}\cdot {\moverset{\rightarrow}{\textcolor{olive}{L}}}
\end{dmath}
\begin{Maple Normal}
To enter the cross product you can use \&x, or the
{$ \times  $} operator from the palette of Common Symbols
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{L\_} \coloneqq \textit{r\_} \times \textit{p\_}  $}

% \mapleresult
\begin{dmath}\label{(437)}
{\moverset{\rightarrow}{\textcolor{olive}{L}}}\coloneqq {\moverset{\rightarrow}{\textcolor{olive}{r}}}\times {\moverset{\rightarrow}{\textcolor{olive}{p}}}
\end{dmath}
\begin{Maple Normal}
where
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{r\_} \coloneqq x \,\textit{\_i} +y \,\textit{\_j} +z \,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(438)}
{\moverset{\rightarrow}{\textcolor{olive}{r}}}\coloneqq \hat{i} \textcolor{olive}{x}+\hat{j} \textcolor{olive}{y}+\hat{k} \textcolor{olive}{z}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \textit{p\_} \coloneqq p [x]\,\textit{\_i} +p [y]\,\textit{\_j} +p [z]\,\textit{\_k}  $}

% \mapleresult
\begin{dmath}\label{(439)}
{\moverset{\rightarrow}{\textcolor{olive}{p}}}\coloneqq \hat{i} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}+\hat{j} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}+\hat{k} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}
\end{dmath}
\begin{Maple Normal}
The \textbf{Commutator} rules for the \textbf{components} of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} are a consequence of the Commutator rules for the \textbf{components} of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{r}}} $} and 
{$ {\moverset{\rightarrow}{\textcolor{olive}{p}}} $}. These rules can be set by using the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup} command, entering all of the commutators between any two of 
{$ {\{\textcolor{olive}{y},\textcolor{olive}{x},\textcolor{olive}{z},\textcolor{olive}{\mathit{px}},\textcolor{olive}{\mathit{py}},\textcolor{olive}{\mathit{pz}}\}} $}, as in 
{$ \mathit{Setup} (\mathit{algebrarules} ={\{\mathit{\%\!Commutator} (x ,p [x])=I ,\mathit{\%\!Commutator} (x ,p [y])=0,\mathit{\%\!Commutator} (x ,y)=0,\mathit{...}\}}) $}. A convenient alternative for situations such as this, where there are many commutators to be entered, is to work with indexed (tensor) notation (see problem 2 below) or create an indexing procedure for a \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Matrix}{Matrix}. For example,
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{algebra} \coloneqq (i ,j)\,\rightarrow \,(\mathit{\%\!Commutator} (\mathit{Component} (\textit{r\_} ,i),\mathit{Component} (\textit{p\_} ,j))=\,I \,\mathit{KroneckerDelta} [i ,j], \,\mathit{\%\!Commutator} (\mathit{Component} (\textit{r\_} ,i),\mathit{Component} (\textit{r\_} ,j))=\,0, \,\mathit{\%\!Commutator} (\mathit{Component} (\textit{p\_} ,i),\mathit{Component} (\textit{p\_} ,j))=\,0) $}

% \mapleresult
\begin{dmath}\label{(440)}
\mathit{algebra} \coloneqq \left(i ,j \right)\hiderel{\mapsto }\left(\left[{\left({\moverset{\rightarrow}{\textcolor{olive}{r}}}\right){\idn{i}}},{\left({\moverset{\rightarrow}{\textcolor{olive}{p}}}\right){\idn{j}}}\right]_{-} \hiderel{=} \mathrm{I} {\delta{\idn{i}\idn{j}}},\left[{\left({\moverset{\rightarrow}{\textcolor{olive}{r}}}\right){\idn{i}}},{\left({\moverset{\rightarrow}{\textcolor{olive}{r}}}\right){\idn{j}}}\right]_{-} \hiderel{=} 0,
\\
\left[{\left({\moverset{\rightarrow}{\textcolor{olive}{p}}}\right){\idn{i}}},{\left({\moverset{\rightarrow}{\textcolor{olive}{p}}}\right){\idn{j}}}\right]_{-}\hiderel{=}0\right)
\end{dmath}
\begin{Maple Normal}
The commutators are then generated by the \textbf{Matrix} constructor and the \textbf{Matrix} itself can be passed to \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup}. (Note that because the matrix elements are commutation rules, you also skip telling Setup that these are 'algebrarules'.)
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Matrix} (3,3,\mathit{algebra}) $}

% \mapleresult
\begin{dmath}\label{(441)}
\left[\begin{array}{ccc}
\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{x},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\\
 \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{y},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\\
 \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},\textcolor{olive}{x}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0 & \left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{z},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0 
\end{array}\right]
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\%) $}

% \mapleresult
\begin{dmath}\label{(442)}
\left[\mathit{algebrarules} =\left\{\left[\textcolor{olive}{x},\textcolor{olive}{y}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},\textcolor{olive}{z}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{x},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,
\\
\left[\textcolor{olive}{y},\textcolor{olive}{z}\right]_{-}\hiderel{=}0,\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[\textcolor{olive}{y},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right]_{-} \hiderel{=} 0,
\\
\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-}\hiderel{=}0,\left[\textcolor{olive}{z},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} \mathrm{I},\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}},{\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-} \hiderel{=} 0\right\}\right]
\end{dmath}
\begin{Maple Normal}
The \textbf{components} of  
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $} are:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L [x]\coloneqq \mathit{Component} (\textit{L\_} ,1) $}

% \mapleresult
\begin{dmath}\label{(443)}
\textcolor{olive}{L}_{\textcolor{olive}{x}}\coloneqq \textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L [y]\coloneqq \mathit{Component} (\textit{L\_} ,2) $}

% \mapleresult
\begin{dmath}\label{(444)}
\textcolor{olive}{L}_{\textcolor{olive}{y}}\coloneqq \textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L [z]\coloneqq \mathit{Component} (\textit{L\_} ,3) $}

% \mapleresult
\begin{dmath}\label{(445)}
\textcolor{olive}{L}_{\textcolor{olive}{z}}\coloneqq \textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}-\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}
\end{dmath}
\begin{Maple Normal}
To verify that 
{$ {\|{\moverset{\rightarrow}{\textcolor{olive}{L}}}\|}^{2} $} commutes with each of 
{$ \textcolor{olive}{L}_{\textcolor{olive}{x}} $}, 
{$ \textcolor{olive}{L}_{\textcolor{olive}{y}} $} and 
{$ \textcolor{olive}{L}_{\textcolor{olive}{z}} $}, an \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Expand}{expansion} of the \textbf{Commutator} is sufficient.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Commutator} (\mathit{LL} ,L [x])\,\esnum \mathit{\,inert\,representation\,of\,Commutator(LL,\,Lx)\,}  $}

% \mapleresult
\begin{dmath}\label{(446)}
\left[\left(\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right)^{2}+\left(\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right)^{2}+\left(\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}-\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right)^{2},\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%)\,\esnum \mathit{\,activates\,the\,inert\,representation\,}  $}

% \mapleresult
\begin{dmath}\label{(447)}
0
\end{dmath}
\begin{Maple Normal}
In cases where activating the operation is not sufficient, you can use \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=expand}{expand} or \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Simplify}{Simplify}.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Commutator} (\mathit{LL} ,L [y]) $}

% \mapleresult
\begin{dmath}\label{(448)}
\left[\left(\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}-\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}\right)^{2}+\left(\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right)^{2}+\left(\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{y}}}}-\textcolor{olive}{y} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}\right)^{2},\textcolor{olive}{z} {\textcolor{olive}{p}{\idn{\textcolor{olive}{x}}}}-\textcolor{olive}{x} {\textcolor{olive}{p}{\idn{\textcolor{olive}{z}}}}\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\% \,) $}

% \mapleresult
\begin{dmath}\label{(449)}
0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\mathit{Commutator} (\mathit{LL} ,L [z])\,) $}

% \mapleresult
\begin{dmath}\label{(450)}
0
\end{dmath}
\begin{Maple Normal}
2. Using tensor notation to represent the quantum operator components of 
{$ {\moverset{\rightarrow}{\textcolor{olive}{L}}} $}, show that 
{$ [\textcolor{olive}{L}_{i},\textcolor{olive}{L}_{j}]_{-}=\mathrm{I} \epsilon_{i ,j ,k} \textcolor{olive}{L}_{k} $} (see the exercises of Chap VI in Cohen-Tannoudji). 
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
For this purpose, signature so that the space part of spacetime is Euclidean and, t follow textbook notation, use \textit{lowercaselatin} space tensor indices (see \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup}).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{signature} =\,\mathit{+++-},\mathit{spaceindices} =\,\mathit{lowercaselatin} ,\mathit{quiet}) $}

% \mapleresult
\begin{dmath}\label{(451)}
\left[\mathit{signature}  \hiderel{=} \mathit{+\,+\,+\,-\,} ,\mathit{spaceindices}  \hiderel{=} \mathit{lowercaselatin} \right]
\end{dmath}
\begin{Maple Normal}
To set \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Commutator}{Commutator} rules for \textit{r} and \textit{p} using tensor notation and have \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Simplify}{Simplify} tackling their products using Einstein's summation convention for repeated indices, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Define}{Define} \textit{r} and \textit{p} as space tensors of this 3-D Euclidean space part of spacetime. Set also the related \textbf{Commutator} rules for the algebra in tensor notation. In doing so, erase previous settings for quantum operators and algebra rules (by using the \textbf{redo} option of \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Setup}{Setup}; this erasure of previous definitions is not necessary in this example, but it is sometimes desired).
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Setup} (\mathit{redo} ,\mathit{tensors} =\,\{r [i],p [j]\},\mathit{quantumoperators} =\,\{L ,r ,p \},\mathit{algebrarules} =\,\{\mathit{\%\!Commutator} (r [i],p [j])=\,I \,\mathit{KroneckerDelta} [i ,j],\mathit{\%\!Commutator} (r [i],r [j])=\,0,\mathit{\%\!Commutator} (p [i],p [j])=\,0\}) $}

% \mapleresult
\begin{dmath}\label{(452)}
\left[\mathit{algebrarules}  \hiderel{=} \left\{\left[{\textcolor{olive}{p}{\idn{i}}},{\textcolor{olive}{p}{\idn{j}}}\right]_{-} \hiderel{=} 0,\left[{\textcolor{olive}{r}{\idn{i}}},{\textcolor{olive}{p}{\idn{j}}}\right]_{-} \hiderel{=} \mathrm{I} {\delta{\idn{i}\idn{j}}},\left[{\textcolor{olive}{r}{\idn{i}}},{\textcolor{olive}{r}{\idn{j}}}\right]_{-} \hiderel{=} 0\right\},
\\
\mathit{quantumoperators} \hiderel{=}\left\{\textcolor{olive}{L},\textcolor{olive}{p},\textcolor{olive}{r}\right\},\mathit{tensors}  \hiderel{=} \left\{{\textcolor{olive}{\gamma}{\idn{\mu}}},{\textcolor{olive}{\sigma}{\idn{\mu}}},{\partial{\idn{\mu}}},{g{\idn{\mu}\idn{\nu}}},{\gamma{\idn{a}\idn{b}}},{\textcolor{olive}{p}{\idn{j}}},{\textcolor{olive}{r}{\idn{i}}},{\epsilon{\idn{\alpha}\idn{\beta}\idn{\mu}\idn{\nu}}}\right\}\right]
\end{dmath}
\begin{Maple Normal}
Note in the above how compact the algebra rules are when written in tensor notation: you have only three instead of fifteen \textbf{Commutator} rules. Verify how these algebra rules work:
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{\%\!Commutator} (r [m],p [n])\,\esnum \mathit{\,inert\,representation\,}  $}

% \mapleresult
\begin{dmath}\label{(453)}
\left[{\textcolor{olive}{r}{\idn{m}}},{\textcolor{olive}{p}{\idn{n}}}\right]_{-}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{value} (\%)\,\esnum \mathit{\,activates\,the\,inert\,representation\,}  $}

% \mapleresult
\begin{dmath}\label{(454)}
\mathrm{I} {\delta{\idn{m}\idn{n}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Commutator} (r [m],r [n]) $}

% \mapleresult
\begin{dmath}\label{(455)}
0
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Commutator} (p [m],p [n]) $}

% \mapleresult
\begin{dmath}\label{(456)}
0
\end{dmath}
\begin{Maple Normal}
Enter now 
{$ [\textcolor{olive}{L}_{i},\textcolor{olive}{L}_{j}]_{-}=\mathrm{I} \epsilon_{i ,j ,k} \textcolor{olive}{L}_{k} $}, and for the 
{$ \textcolor{olive}{L}_{i} $} in terms of 
{$ {\textcolor{olive}{r}{\idn{j}}}  $}and 
{$ {\textcolor{olive}{p}{\idn{k}}} $}. In doing so, use the default abbreviation ep\_ for the \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/LeviCivita}{LeviCivita} pseudo-tensor.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{rule} \coloneqq \mathit{\%\!Commutator} (L [i],L [j])=\,I \,\mathit{LeviCivita} [i ,j ,k]\,L [k]\, $}

% \mapleresult
\begin{dmath}\label{(457)}
\mathit{rule} \coloneqq \left[\textcolor{olive}{L}_{i},\textcolor{olive}{L}_{j}\right]_{-}=\mathrm{I} {\epsilon{\idn{i}\idn{j}\idn{k}}} \textcolor{olive}{L}_{k}
\end{dmath}
\begin{Maple Normal}
Use the abbreviation \textit{ep\_} for LeviCivita
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} L [i]\coloneqq \textit{ep\_} [i ,m ,n]\,r [m]\,p [n] $}

% \mapleresult
\begin{dmath}\label{(458)}
\textcolor{olive}{L}_{i}\coloneqq {\epsilon{\idn{i}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L [j]\coloneqq \mathit{subs} (i =j ,L [i]) $}

% \mapleresult
\begin{dmath}\label{(459)}
\textcolor{olive}{L}_{j}\coloneqq {\epsilon{\idn{j}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} L [k]\coloneqq \mathit{subs} (i =k ,L [i]) $}

% \mapleresult
\begin{dmath}\label{(460)}
\textcolor{olive}{L}_{k}\coloneqq {\epsilon{\idn{k}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}
\end{dmath}
\begin{Maple Normal}
At this point, 
{$ [\textcolor{olive}{L}_{i},\textcolor{olive}{L}_{j}]_{-}=\mathrm{I} \epsilon_{i ,j ,k} \textcolor{olive}{L}_{k} $}  is given by
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{rule}  $}

% \mapleresult
\begin{dmath}\label{(461)}
\left[{\epsilon{\idn{i}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}},{\epsilon{\idn{j}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}\right]_{-}=\mathrm{I} {\epsilon{\idn{i}\idn{j}\idn{k}}} {\epsilon{\idn{k}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}
\end{dmath}
\begin{Maple Normal}
You can either expand this rule, to see the actual value, then \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Simplify}{Simplify} it,
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{expand} (\mathit{rule}) $}

% \mapleresult
\begin{dmath}\label{(462)}
{\epsilon{\idn{i}\idn{m}\idn{n}}} {\epsilon{\idn{a}\idn{b}\idn{j}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}} {\textcolor{olive}{r}{\idn{a}}} {\textcolor{olive}{p}{\idn{b}}}-{\epsilon{\idn{i}\idn{m}\idn{n}}} {\epsilon{\idn{a}\idn{b}\idn{j}}} {\textcolor{olive}{r}{\idn{a}}} {\textcolor{olive}{p}{\idn{b}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}=\mathrm{I} {\epsilon{\idn{i}\idn{j}\idn{k}}} {\epsilon{\idn{k}\idn{m}\idn{n}}} {\textcolor{olive}{r}{\idn{m}}} {\textcolor{olive}{p}{\idn{n}}}
\end{dmath}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\%) $}

% \mapleresult
\begin{dmath}\label{(463)}
-\mathrm{I} {\textcolor{olive}{r}{\idn{j}}} {\textcolor{olive}{p}{\idn{i}}}+\mathrm{I} {\textcolor{olive}{r}{\idn{i}}} {\textcolor{olive}{p}{\idn{j}}}=-\mathrm{I} {\textcolor{olive}{r}{\idn{j}}} {\textcolor{olive}{p}{\idn{i}}}+\mathrm{I} {\textcolor{olive}{r}{\idn{i}}} {\textcolor{olive}{p}{\idn{j}}}
\end{dmath}
\begin{Maple Normal}
or you can \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics/Simplify}{Simplify} the rule without expanding first.
\end{Maple Normal}
\mapleinput
{$ \displaystyle \texttt{>\,} \mathit{Simplify} (\mathit{rule}) $}

% \mapleresult
\begin{dmath}\label{(464)}
-\mathrm{I} {\textcolor{olive}{r}{\idn{j}}} {\textcolor{olive}{p}{\idn{i}}}+\mathrm{I} {\textcolor{olive}{r}{\idn{i}}} {\textcolor{olive}{p}{\idn{j}}}=-\mathrm{I} {\textcolor{olive}{r}{\idn{j}}} {\textcolor{olive}{p}{\idn{i}}}+\mathrm{I} {\textcolor{olive}{r}{\idn{i}}} {\textcolor{olive}{p}{\idn{j}}}
\end{dmath}
\section{\label{bkmrk36}\textbf{References}}
\begin{Maple Dash Item}
\item Weinberg, S. \textbf{The Quantum Theory of Fields}. Cambridge University Press, 2005.
\item Bogoliubov, N.N., and Shirkov, D.V. \textbf{Quantum Fields}. Benjamin Cummings, 1982.
\end{Maple Dash Item}
\begin{Maple Dash Item}
\item Cohen-Tannoudji, C.; Diu, B.; and Laloe, F. \textbf{Quantum Mechanics}. Paris, France: Hermann, 1977.
\end{Maple Dash Item}
\begin{Maple Dash Item}
\item Feynman, R.P.; Leighton, R.B.; and Sands, M. \textbf{The Feynman Lectures on Physics}. Addison-Wesley, 1977.
\end{Maple Dash Item}
\begin{Maple Dash Item}
\item Landau, L.D., and Lifshitz, E.M. \textbf{Course of Theoretical Physics}. Elsevier, 1975.
\end{Maple Dash Item}
\begin{Maple Dash Item}
\item Smirnov. A \textbf{Course of Higher Mathematics}. Addison Wesley, 1964.
\end{Maple Dash Item}
\section{\label{bkmrk37}\textbf{See Also}}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Conventions]}{Physics conventions}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Setup]}{Physics Setup}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics,Updates}{Physics Updates}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Mini-Course Computer Algebra for Physicists}{Mini-Course Computer Algebra for Physicists}, \href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=Physics[Tensors]}{A Complete Guide for performing Tensors computations using Physics}.
\end{Maple Normal}
\begin{Maple Normal}

\end{Maple Normal}
\begin{Maple Normal}
\href{https://www.maplesoft.com/support/help/Maple/view.aspx?path=examples/index}{Return to Index for Example Worksheets}
\end{Maple Normal}
\end{document}
