# Relative scalar

In mathematics, a relative scalar (of weight w) is a scalar-valued function whose transform under a coordinate transform,
${\bar {x}}^{j}={\bar {x}}^{j}(x^{i})$
on an n-dimensional manifold obeys the following equation
${\bar {f}}({\bar {x}}^{j})=J^{w}f(x^{i})$
where
$J=\left|{\dfrac {\partial (x_{1},\ldots ,x_{n})}{\partial ({\bar {x}}^{1},\ldots ,{\bar {x}}^{n})}}\right|,$
that is, the determinant of the Jacobian of the transformation. A scalar density refers to the $w=1$ case.
Relative scalars are an important special case of the more general concept of a relative tensor.

## Ordinary scalar

An ordinary scalar or absolute scalar refers to the $w=0$ case.
If $x^{i}$ and ${\bar {x}}^{j}$ refer to the same point $P$ on the manifold, then we desire ${\bar {f}}({\bar {x}}^{j})=f(x^{i})$. This equation can be interpreted two ways when ${\bar {x}}^{j}$ are viewed as the "new coordinates" and $x^{i}$ are viewed as the "original coordinates". The first is as ${\bar {f}}({\bar {x}}^{j})=f(x^{i}({\bar {x}}^{j}))$, which "converts the function to the new coordinates". The second is as $f(x^{i})={\bar {f}}({\bar {x}}^{j}(x^{i}))$, which "converts back to the original coordinates. Of course, "new" or "original" is a relative concept.
There are many physical quantities that are represented by ordinary scalars, such as temperature and pressure.

### Weight 0 example

Suppose the temperature in a room is given in terms of the function $f(x,y,z)=2x+y+5$ in Cartesian coordinates $(x,y,z)$ and the function in cylindrical coordinates $(r,t,h)$ is desired. The two coordinate systems are related by the following sets of equations: ${\begin{aligned}r&={\sqrt {x^{2}+y^{2}}}\\t&=\arctan(y/x)\\h&=z\end{aligned}}$ and ${\begin{aligned}x&=r\cos(t)\\y&=r\sin(t)\\z&=h.\end{aligned}}$
Using ${\bar {f}}({\bar {x}}^{j})=f(x^{i}({\bar {x}}^{j}))$ allows one to derive ${\bar {f}}(r,t,h)=2r\cos(t)+r\sin(t)+5$ as the transformed function.
Consider the point $P$ whose Cartesian coordinates are $(x,y,z)=(2,3,4)$ and whose corresponding value in the cylindrical system is $(r,t,h)=({\sqrt {13}},\arctan {(3/2)},4)$. A quick calculation shows that $f(2,3,4)=12$ and ${\bar {f}}({\sqrt {13}},\arctan {(3/2)},4)=12$ also. This equality would have held for any chosen point $P$. Thus, $f(x,y,z)$ is the "temperature function in the Cartesian coordinate system" and ${\bar {f}}(r,t,h)$ is the "temperature function in the cylindrical coordinate system".
One way to view these functions is as representations of the "parent" function that takes a point of the manifold as an argument and gives the temperature.
The problem could have been reversed. One could have been given ${\bar {f}}$ and wished to have derived the Cartesian temperature function $f$. This just flips the notion of "new" vs the "original" coordinate system.
Suppose that one wishes to integrate these functions over "the room", which will be denoted by $D$. (Yes, integrating temperature is strange but that's partly what's to be shown.) Suppose the region $D$ is given in cylindrical coordinates as $r$ from $[0,2]$, $t$ from $[0,\pi /2]$ and $h$ from $[0,2]$ (that is, the "room" is a quarter slice of a cylinder of radius and height 2). The integral of $f$ over the region $D$ is $\int _{0}^{2}\!\int _{0}^{\sqrt {2^{2}-x^{2}}}\!\int _{0}^{2}\!f(x,y,z)\,dz\,dy\,dx=16+10\pi .$ The value of the integral of ${\bar {f}}$ over the same region is $\int _{0}^{2}\!\int _{0}^{\pi /2}\!\int _{0}^{2}\!{\bar {f}}(r,t,h)\,dh\,dt\,dr=12+10\pi .$ They are not equal. The integral of temperature is not independent of the coordinate system used. It is non-physical in that sense, hence "strange". Note that if the integral of ${\bar {f}}$ included a factor of the Jacobian (which is just $r$), we get $\int _{0}^{2}\!\int _{0}^{\pi /2}\!\int _{0}^{2}\!{\bar {f}}(r,t,h)r\,dh\,dt\,dr=16+10\pi ,$ which is equal to the original integral but it is not however the integral of temperature because temperature is a relative scalar of weight 0, not a relative scalar of weight 1.

### Weight 1 example

If we had said $f(x,y,z)=2x+y+5$ was representing mass density, however, then its transformed value should include the Jacobian factor that takes into account the geometric distortion of the coordinate system. The transformed function is now ${\bar {f}}(r,t,h)=(2r\cos(t)+r\sin(t)+5)r$. This time $f(2,3,4)=12$ but ${\bar {f}}({\sqrt {13}},\arctan {(3/2)},4)=12{\sqrt {29}}$. As before is integral (the total mass) in Cartesian coordinates is $\int _{0}^{2}\!\int _{0}^{\sqrt {2^{2}-x^{2}}}\!\int _{0}^{2}\!f(x,y,z)\,dz\,dy\,dx=16+10\pi .$ The value of the integral of ${\bar {f}}$ over the same region is $\int _{0}^{2}\!\int _{0}^{\pi /2}\!\int _{0}^{2}\!{\bar {f}}(r,t,h)\,dh\,dt\,dr=16+10\pi .$ They are equal. The integral of mass density gives total mass which is a coordinate-independent concept. Note that if the integral of ${\bar {f}}$ also included a factor of the Jacobian like before, we get $\int _{0}^{2}\!\int _{0}^{\pi /2}\!\int _{0}^{2}\!{\bar {f}}(r,t,h)r\,dh\,dt\,dr=24+40\pi /3,$ which is not equal to the previous case.

## Other cases

Weights other than 0 and 1 do not arise as often. It can be shown the determinant of a type (0,2) tensor is a relative scalar of weight 2.