# Aligning inside equation trouble

I am having a problem in aligning some symbols under an equation... This is the code:

\begin{align*}
D(\ldots,\,&tA^j,\,\ldots)=tD(\ldots,\,&A^j,\,\ldots).\\
& \uparrow & \uparrow \\
& k & k
\end{align*}


...and the output I get: I also tried using the array environment instead, but still can't figure out how to put the arrow (and letter k) in the exact position. How should I do?

P.S.

Same thing happens over here:

\begin{align*}
D(\ldots,\,A^k & +tA^j,\,\ldots) = D(\ldots,&\,A^k,\,\ldots) + D(\ldots,&\,tA^j,\,\ldots) \\
& \uparrow & \uparrow & \uparrow \\
& k & k & k
\end{align*}


which gives: You don't have to align the \uparrows: \underset and a matrix environment will do:

\documentclass{article}
\usepackage[utf8]{inputenc}%
\usepackage{mathtools}

\begin{document}

\begin{align*}
D(\ldots,\,\underset{\begin{matrix} \uparrow \\ k \end{matrix}}{tA^j},\,\ldots) & =tD(\ldots,\,\underset{\begin{matrix} \uparrow \\ k \end{matrix}}{A}^j,\,\ldots) \\
D(\ldots,\,A^k \underset{\begin{matrix} \uparrow \\ k \end{matrix}}{+}tA^j,\,\ldots) & = D(\ldots,\,\underset{\begin{matrix} \uparrow \\ k \end{matrix}}{A}^k,\,\ldots) + D(\ldots,\,\underset{\begin{matrix} \uparrow \\ k \end{matrix}}{tA^j},\,\ldots)
\end{align*}

\end{document} • Didn't know about the \underset command, thanks a lot! Sep 26, 2017 at 17:04