# Is there a package to equate particular parts of an equation?

Just wondering if there's a particular way to do the following in LaTeX:

where I've equated a particular part of the main equation to a little equation, given by T and U.

• Welcome! amsmath provides \underbrace, with usage \underbrace{a^2+b^2+c^2}_{=T}. May 8 '15 at 13:03
• Related: vertical equal sign May 8 '15 at 13:05
• Schrödinger's equation ;-) .. The ^ above the potential operator is out of alignment. It should be over U only
– user31729
May 8 '15 at 13:06
• @1010011010, thank you, that is exactly what I was looking for! You should post that as an answer. May 8 '15 at 13:13
• @HarrySmith: For the typesetting of the kets you might have a look on the braket package
– user31729
May 8 '15 at 13:15

This should get you going. I've introduced a few commands to make it easier to typeset some parts of the equations in a more automated way, or if you wish to change something all over the document at once. *They're not strictly necessary for the obtained result.

\documentclass{article}
\usepackage{amsmath,mathtools}
\newcommand\partt[1][]{%
\ifmmode
\frac{\partial#1\mathstrut}{\partial t}%
\fi
}
\newcommand\ChristianHupfer[1]{%
\ifmmode
\lvert
#1%
\rangle
\fi
}
\newcommand\rotateequal[1]{%
\ifmmode
\underset{#1}{\rotatebox{90}{$=$}}%
\fi
}
\newcommand\myvector[1]{%
\ifmmode
\mathbf#1%
\fi
}
\newcommand\largemathstrut{%
\ifmmode
\frac{\mathstrut}{\mathstrut}
\fi
}
\begin{document}
$i\hbar\partt\ChristianHupfer{\psi(\myvector{r},t)} = \underbrace{\frac{-\hbar^{2}}{2m}\nabla^2\largemathstrut}_{\rotateequal{T}}\ChristianHupfer{\psi(\myvector{r},t)} + \underbrace{\hat{U(\myvector{r})}\largemathstrut}_{\rotateequal{U}}\ChristianHupfer{\psi(\myvector{r},t)}$
\end{document}

• \waveleft? ;-) That's a ket state vector
– user31729
May 8 '15 at 13:26
• @ChristianHupfer Fixed. :-) May 8 '15 at 13:31
• This is a very nice solution. It's a shame the standard \underbrace curly brace symbol is so ugly! May 8 '15 at 13:45
}

\renewcommand\vec[1]{\mathbf{#1}}

\begin{document}

$\newcommand{\BF}{\vphantom{\frac{-\hbar^{2}}{2m}\nabla^2}} % just for this equation i\hbar\pder{t}\ket{\psi(\vec{r},t)} = \underbrace{\frac{-\hbar^{2}}{2m}\nabla^2}_{\substack{\roteq\\T}}\ket{\psi(\vec{r},t)} + \underbrace{\BF\widehat{U(\vec{r})}}_{\substack{\roteq\\U}}\ket{\psi(\vec{r},t)}$

\end{document}