\mbox does not draw a box inside align*
Perhaps you are trying to place a box around the last equation. One way to do that is to use Aboxed
from the mathtools
package:
\documentclass{article}
\usepackage{mathtools}
\usepackage{mhchem}
\begin{document}
\begin{align*}
\ce{K_w} &= \ce{[H3O+][OH^-]} \\
-\log \ce{K_w} &= -\log ( \ce{[H3O+][OH^-]} ) \\
-\log \ce{K_w} &= - ( \log \ce{[H3O+]} + \log \ce{[OH^-]} ) & \text{(Using log law for RHS.)}\\
-\log \ce{K_w} &= - \log \ce{[H3O+]} - \log \ce{[OH^-]} \\
-\log \ce{K_w} &= - \log \ce{[H3O+]} + - \log \ce{[OH^-]} \\
\Aboxed{ \ce{pK_w} &= \ce{pH} + \ce{pOH} }
\end{align*}
\end{document}
While it is true that the descriptions of mbox
tell you that it creates a box just wide enough to hold the text, this is not a box that gets drawn. It is a virtual "box" in the TeX sense that does not get split across lines.
If you want the highlighting of the equation to be a bit more subtle, you can modify the \Aboxed
command provided by the mathtools
package. For instance, in the example below, the equation of interest is emphasized with a 15% black background (alternatives is also possible, of course):
\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\usepackage{xcolor}% http://ctan.org/pkg/xcolor
\usepackage[version=3]{mhchem}% http://ctan.org/pkg/mhchem
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\makeatletter
\patchcmd{\@Aboxed}{\boxed{#1#2}}{\colorbox{black!15}{$#1#2$}}{}{}%
\makeatother
\begin{document}
\begin{align*}
\ce{K_w} &= \ce{[H3O+][OH^-]} \\
-\log \ce{K_w} &= -\log ( \ce{[H3O+][OH^-]} ) \\
-\log \ce{K_w} &= - ( \log \ce{[H3O+]} + \log \ce{[OH^-]} ) & \text{(Using log law for RHS.)}\\
-\log \ce{K_w} &= - \log \ce{[H3O+]} - \log \ce{[OH^-]} \\
-\log \ce{K_w} &= - \log \ce{[H3O+]} + - \log \ce{[OH^-]} \\
\Aboxed{ \ce{pK_w} &= \ce{pH} + \ce{pOH} }\\
\end{align*}
\end{document}
Modification of \Aboxed
is performed using \patchcmd{<command>}{<search>}{<replace>}{<success>}{<failure>}
(provided by the etoolbox
package). Specifically, the \boxed{#1#2}
command (that boxes the left- #1
and right-hand side #2
of the equation in align
) is replaced with \colorbox{<color>}{$#1#2$}
allowing for a coloured box. Colour choices is supported by means of xcolor
.