Label terms of LaTeX equation [duplicate]

I'm interested in labelling my latex equation, by giving the physical phenomenon contributing to the term. For instance x = f(y) + g(y). So a horizontal curly bracket to explain that f(y) is derived from some phenomenon, say resistance and g(y) is derived some other phenomenon, say gravity.

How can I give a name to f(y) as resistance and g(y) as gravity in the equation? Hope I'm able to explain my intentions.

marked as duplicate by Francis, user13907, Jesse, Maarten Dhondt, Svend TveskægDec 22 '15 at 11:44

You have \underbrace from amsmath and \underbracket from mathtools (which loads amsmath). I added some horizontal adjustment with the \clap command (from mathtools), since the labelled terms are short:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

$x = \underbracket[0.8pt]{f(y)}_\text{\clap{resistance~}} + \underbracket[0.8pt]{g(y)}_\text{\clap{~gravity}}$
$x = \underbrace{f(y)}_\text{\clap{resistance~}} + \underbrace{g(y)}_\text{\clap{~gravity}}$%%

\end{document} Using the amsmath package, you can do this as follows:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$x = \underbrace{f(y)}_{\text{resistance}} + \underbrace{g(y)}_{\text{gravity}}$

\end{document}

This yields: 