The easiest solution would be to place something invisible that is bigger, but that is hard to do in a consistent manner (\rule[-2ex]{0pt}{5.5ex}
for example). The following defines a macro (\addpad
) that adds 0.5ex of vertical padding on both the height and the depth of its argument (it has an optional argument with which you can change the padding amount).
I also used \extrarowheight
from the array
package so that the horizontal rules don't almost touch the upper case letters in normal-height cells.
The following uses grabbox
so that it should work on arbitrary arguments (including verbatim material), but grabbox
isn't necessary for the approach to work (see below).
\documentclass{article}
\usepackage{longtable,amsmath}
\usepackage{array}
\usepackage{grabbox}
\setlength\extrarowheight{1pt}
\makeatletter
\newsavebox\addpad@Box
\newcommand\addpad[1][.5ex]
{%
\leavevmode
\@grabbox{}\addpad@Box{}\hbox{}
{%
\vrule
height \dimexpr\ht\addpad@Box+#1
depth 0pt
width 0pt
\unhcopy\addpad@Box
\vrule
height 0pt
depth \dimexpr\dp\addpad@Box+#1
width 0pt
}%
}
\makeatother
\begin{document}
\begin{longtable}{|c|c|}
\hline
\textbf{Function} & \textbf{Derivative}\\
\hline
\addpad{$\dfrac{1}{x}$} & $-\dfrac{1}{x^2}$\\
\hline
\end{longtable}
\end{document}

Version without grabbox
\documentclass{article}
\usepackage{longtable,amsmath}
\usepackage{array}
\setlength\extrarowheight{1pt}
\newsavebox\addpadBox
\newcommand\addpad[2][.5ex]
{%
\sbox\addpadBox{#2}%
\ht\addpadBox\dimexpr\ht\addpadBox+#1
\dp\addpadBox\dimexpr\dp\addpadBox+#1
\usebox\addpadBox
}
\begin{document}
\begin{longtable}{|c|c|}
\hline
\textbf{Function} & \textbf{Derivative}\\
\hline
\addpad{$\dfrac{1}{x}$} & $-\dfrac{1}{x^2}$\\
\hline
\end{longtable}
\end{document}