# Labeling part of an equation

How do I label part of an equation using the same counter as for equations? For example,

\begin{align}
x^2+bx+c&=x^2+bx+\frac{b^2}{4}-\frac{b^2}{4}+c \label{eq:1}\\
&=(x+b/2)^2+\underbrace{(-\frac{b^2}{4}+c)}{(*)} \label{eq:2}
\end{align}
The quantity~\ref{eq:2}...


produces

But I want the (2) to appear where the (*) is. (I.e., I want to use the equation counter but place the label in an arbitrary location, which is under the underbrace here.)

-
You don't want (2) on the right most place? – Harish Kumar Apr 6 '14 at 15:44
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Christian Hupfer Apr 6 '14 at 16:01
I don't want (2) in the rightmost place, so Herbert's answer was what I was looking for. – Holden Apr 6 '14 at 17:09

\documentclass{article}
\usepackage{mathtools}
\begin{document}

\begin{align}
x^2+bx+c &= x^2+bx+\frac{b^2}{4}-\frac{b^2}{4}+c \label{eq:1}\\
&= (x+b/2)^2+\underbrace{(-\frac{b^2}{4}+c)}_{%
\stepcounter{equation}\mbox{(\theequation)}} \nonumber
\end{align}

The quantity~\ref{eq:2}...
\end{document}


-

Like this?

\documentclass{article}
\usepackage{amsmath}