# Chemistry - May I treat units (e.g. joules, grams, etc.) in equations as variables?

## Solution 1:

Yes, you may. It is quite common to convert units into each other. The simplest conversion might be the prefixing of units, e.g. $$\mathrm{\frac{km}{m}}=1000 \Longleftrightarrow \mathrm{1~km = 1000~m}.$$

Another example is the interconversion of units of energy. In some parts of chemistry, it is still quite common to use calories, in others Joule, as a SI unit, has taken its place. $$\mathrm{\frac{cal}{J}}=4.184 \Longleftrightarrow \mathrm{1~cal = 4.184~J}.$$

In principle, all units are defined to be constants, special numbers in a wider sense. You can treat them as such.

## Solution 2:

Treating units as if they were algebra is called “dimensional analysis”.

One example given in that article is the question of how many seconds are there in two years.

$$2\ \mathrm{yr} \times 365\ \mathrm{day}\ \mathrm{yr}^{-1} \times 24\ \mathrm{hr}\ \mathrm{day}^{-1} \times 60\ \mathrm{min}\ \mathrm{hr}^{-1} \times 60\ \mathrm{s}\ \mathrm{min}^{-1} = 63072000\ \mathrm{s} $$

Another example question is,

How many atoms of hydrogen can be found in 45 g of ammonia, $\ce{NH3}$?

This is how I would approach this:

$$45\ \mathrm{g}\ \ce{NH3}\ /\ 17\ \mathrm{g}\ \mathrm{mol}^{-1} \approx 2.647\ \ce{NH3}\ \mathrm{mol}$$ $$2.647\ \ce{NH3}\ \mathrm{mol}\ \times\ 6.02 \times 10^{23}\ \mathrm{molecules}\ \mathrm{mol}^{-1} \approx 1.594 \times 10^{24}\ \ce{NH3}\ \mathrm{molecules}$$ $$1.594 \times 10^{24}\ \ce{NH3}\ \mathrm{molecules} \times 3\ \mathrm{(H\ atoms)}\ \mathrm{(\ce{NH3}\ molecules)}^{-1} \approx 4.781 \times 10^{24}\ \ce{H}\ \mathrm{atoms}$$

The article works this out differently, as a single step. I myself find the multi-step approach easier to follow, but everyone’s different. The article renders this as,

$$45\ \mathrm{g}\ \ce{NH3} \times \frac{1\ \mathrm{mol}\ \ce{NH3}}{17\ \mathrm{g}\ \ce{NH3}} \times \frac{6.02 \times 10^{23}\ \mathrm{molecules}\ \ce{NH3}}{1\ \mathrm{mol}\ \ce{NH3}} \times \frac{3\ \mathrm{atoms}\ \ce{H}}{1\ \mathrm{molecule}\ \ce{NH3}}$$

$$ = 4.8 \times 10^{24}\ \mathrm{atoms}\ \ce{H}$$

(to 2 significant figures)

If the units cancel out correctly, that is further indication that you have the right formula. (And if they *don’t* cancel out correctly, that is a certain indication that you don’t have the right formula.)

## Solution 3:

Not only may you, but you absolutely should. As a physics professor, watching students toss away the information contained in units is incredibly frustrating. Typically students drop the units, "do the math," and then put back on whatever final units they think should be there (if they bother with the last step at all). This leads to a shockingly large number of mistakes (even multi-million dollar ones: http://www.cnn.com/TECH/space/9909/30/mars.metric/)

Whenever you write a physical value you should write both the number and the unit and "do the math" on **both**, exactly as you propose. If the units don't work out to a unit that you expect then you know that you've done something wrong.

## Solution 4:

You not only can, but also must treat symbols for units by the ordinary rules of algebra, since unit symbols are mathematical entities and not abbreviations.

The *value* of a *quantity* is expressed as the product of a number and a *unit*. That number is called the *numerical value* of the quantity expressed in this unit.

This relation may be expressed in the form

$$Q = \left\{ Q \right\} \cdot \left[ Q \right]$$

where $Q$ is the symbol for the quantity, $\left[ Q \right]$ is the symbol for the unit, and $\left\{ Q \right\}$ is the symbol for the numerical value of the quantity $Q$ expressed in the unit $\left[ Q \right]$.

For example, the mass of a sample is

$$m = 100\ \mathrm g$$

Here, $m$ is the symbol for the quantity mass, $\mathrm g$ is the symbol for the unit gram (a unit of mass), and $100$ is the numerical value of the mass expressed in grams. Thus, the value of the mass is $100\ \mathrm g$.

It is important to distinguish between the quantity $Q$ itself and the numerical value $\left\{ Q \right\}$ of the quantity expressed in a particular unit $\left[ Q \right]$. The value of a particular quantity $Q$ is independent of the choice of unit $\left[ Q \right]$, although the numerical value $\left\{ Q \right\}$ will be different for different units.

For example, changing the unit for the mass in the previous example from the gram to the kilogram, which is $10^3$ times the gram, leads to a numerical value which is $10^{-3}$ the numerical value of the mass expressed in grams, whereas the value of the mass stays the same.

$$m = 100\ \mathrm g = 0.100\ \mathrm{kg}$$

Since symbols for units are mathematical entities, both the numerical value and the unit may be treated by the ordinary rules of algebra. For example, the equation $m = 100\ \mathrm g$ may equally be written $$m/\mathrm g = 100$$

It is often convenient to label the axes of a graph in this way, so that the tick marks are labelled only with numbers. The quotient of a quantity and a unit may also be used in this way for the heading of a column in a table, so that the entries in the table are all simply numbers.

Performing the mathematical operations of quantities is called *quantity calculus*. Quantities are multiplied and divided by one another according to the rules of algebra, resulting in new quantities.

The quotient of two quantities, $Q_1$ and $Q_2$, satisfies the relation $$\begin{align} \frac{Q_1}{Q_2} &= \frac{ \left\{ Q_1 \right\} \cdot \left[ Q_1 \right] }{ \left\{ Q_2 \right\} \cdot \left[ Q_2 \right] } \\[6pt] &= \frac{ \left\{ Q_1 \right\} }{ \left\{ Q_2 \right\} } \cdot \frac{ \left[ Q_1 \right] }{ \left[ Q_2 \right] } \end{align}$$ Thus, the quotient $\left\{ Q_1 \right\}/\left\{ Q_2 \right\}$ is the numerical value $\left\{ Q_1/Q_2 \right\}$ of the quantity $Q_1/Q_2$, and the quotient $\left[ Q_1 \right]/\left[ Q_2 \right]$ is the unit $\left[ Q_1/Q_2 \right]$ of the quantity $Q_1/Q_2$.

For example, assuming a volume of $V = 0.127\ \mathrm{l}$, the density $\rho$ of the above-mentioned sample is $$\begin{align} \rho &= \frac{m}{V} \\[6pt] &= \frac{ 0.100\ \mathrm{kg} }{ 0.127\ \mathrm{l} } \\[6pt] &= \frac{ 0.100 }{ 0.127 } \cdot \frac{ \mathrm{kg} }{ \mathrm{l} } \\[6pt] &= 0.79\ \mathrm{kg/l} \end{align}$$

Similarly, the product of two quantities, $Q_1$ and $Q_2$, satisfies the relation $$\begin{align} Q_1 \cdot Q_2 &= \left( \left\{ Q_1 \right\} \cdot \left[ Q_1 \right] \right) \cdot \left( \left\{ Q_2 \right\} \cdot \left[ Q_2 \right] \right) \\[6pt] &= \left\{ Q_1 \right\}\left\{ Q_2 \right\} \cdot \left[ Q_1 \right] \left[ Q_2 \right] \end{align}$$

Thus, the product $\left\{ Q_1 \right\}\left\{ Q_2 \right\}$ is the numerical value $\left\{ Q_1Q_2 \right\}$ of the quantity $Q_1Q_2$, and the product $\left[ Q_1 \right]\left[ Q_2 \right]$ is the unit $\left[ Q_1Q_2 \right]$ of the quantity $Q_1Q_2$.

For example, considering the standard acceleration of free fall $g_\mathrm n = 9.80665\ \mathrm{m/s^2}$, the weight $F_\mathrm g$ of the above-mentioned sample is $$\begin{align} F_\mathrm g &= m \cdot g_\mathrm n \\[6pt] &= 0.100\ \mathrm{kg} \times 9.80665\ \frac{\mathrm m}{\mathrm{s^2}} \\[6pt] &= 0.100 \times 9.80665 \times \mathrm{kg} \cdot \frac{\mathrm m}{\mathrm{s^2}} \\[6pt] &= 0.98\ \frac{\mathrm {kg\ m}}{\mathrm{s^2}} \\[6pt] &= 0.98\ \mathrm{N} \end{align}$$

In forming products and quotients of unit symbols, the normal rules of algebraic multiplication or division apply.

For example, the expansion work $W$ at constant pressure $p = 100\,000\ \mathrm{Pa} = 100\,000\ \mathrm{kg\ m^{-1}\ s^{-2}}$ associated with a volume change of $\Delta V = 0.5\ \mathrm{m^3}$ is

$$\begin{align} W &= p \cdot \Delta V \\[6pt] &= 100\,000\ \frac{\mathrm{kg}}{\mathrm{m\ s^{2}}} \times 0.5\ \mathrm{m^3}\\[6pt] &= 50\,000\ \frac{\mathrm{kg}}{\mathrm{m\ s^{2}}}\cdot\mathrm{m^3}\\[6pt] &= 50\,000\ \frac{\mathrm{kg\ m^2}}{\mathrm{s^{2}}}\\[6pt] &= 50\,000\ \mathrm J \end{align}$$

Two or more quantities cannot be added or subtracted unless they belong to the same kind. The expression shall be written as the sum or difference of expressions for the quantities $$l=12\ \mathrm m-7\ \mathrm m$$ or parentheses shall be used to combine the numerical values, placing the common unit symbol after the complete numerical value $$l=\left(12-7\right)\ \mathrm m$$ but it is not permissible to write $$l=12-7\ \mathrm m\quad\color{red}{\small\text{(wrong!)}}$$ For the same reason, quantities on each side of an equal sign in an equation must be of the same kind $$\begin{align} m_\text{total} &= m_1+m_2 \\ 1.8\ \mathrm{kg} &= 1.5\ \mathrm{kg}+0.3\ \mathrm{kg} \end{align}$$ However, quantities of the same kind do not necessarily have the same unit. $$250\ \mathrm g = 0.250\ \mathrm{kg}$$ $$10\ \mathrm{m/s} = 36\ \mathrm{km/h}$$ Anyway, quantities on each side of an equal sign in an equation must not be of different kinds.

$$1\ \mathrm{mol} = 22.414\ \mathrm l\quad\color{red}{\small\text{(wrong!)}}$$

## Solution 5:

May I manipulate the equation as though $T$ and $B$ were the kinds of symbols that we learned to manipulate in math class?

Yes, you can and *should* (that is, never leave out the units when you plug values into an equation: a quantity is always the product of a numerical value and a unit, and leaving out units is asking for disaster). The set of rules that govern the algebraic manipulation of quantities is known as *quantity calculus*.

Among the several references that can be found about quantity calculus and quantity equations (others can be found in this answer on Academia.SE), I suggest you in particular this guide, §7.11, and the following paper, which is geared toward chemists:

- M J ten Hoor, "Quantity calculus for chemists", Chemistry in action n. 57, 1999. Online

However, units are not variables (we strongly believe that units should be immutable quantities: whether they are actually so is a matter of scientific investigation), and to highlight this fact it is recommended to use an upright typeface to typeset the units, instead of the italic typeface reserved to variable quantities. So your quantity equations would be better written as

$$\frac{50\,\mathrm{T}}{20\,\mathrm{B}} = x.$$