4

I want a table to show the process involved in integration by parts. Here is what I have (from Equation with vertical arrow):

\documentclass{article}
\usepackage{mathtools}

\newcommand\vertarrowbox[3][6ex]{%
  \begin{array}[t]{@{}c@{}} #2 \\
  \left\uparrow\vcenter{\hrule height #1}\right.\kern-\nulldelimiterspace\\
  \makebox[0pt]{\normalsize#3}
  \end{array}%
 }
\begin{document}

\begin{align*}
\displaystyle \int x\exp(ax)\, dx\, &\vertarrowbox[8pt]{=}{%
\begin{tabular}{|l|l|}
    \hline
    $u=x$ & $du=dx$ \\\hline
    $dv=\exp(ax)\,dx$ & $v=\displaystyle\frac{1}{a}\exp(ax)$\\\hline
\end{tabular}} \frac{x}{a}\exp(ax)-\frac{1}{a}\int\exp(ax)\, dx\\
&=\frac{1}{a}\exp(ax)\left(x-\frac{1}{a}\right)+c.
\end{align*}
\end{document}

enter image description here

I want to align the vertical line of the table with the arrow, and also if possible change the arrow style (like -Latex style in tikz).

6

I propose this solution, using mathtools, makebox and makecell, with some manual adjustment:

\documentclass{article}
\usepackage{mathtools, nccmath}
\usepackage{makebox, array, makecell}

\begin{document}

\bgroup
\setcellgapes{2pt}\makegapedcells
\begin{align*}
 \int x\exp(ax)\, dx\, & = \frac{x}{a}\exp(ax)-\frac{1}{a}\int\exp(ax)\, dx\\
  & \makebox*{${}={}$}{$\uparrow$}\\[-0.5ex]
\MoveEqLeft[-0.2] \mathclap{\begin{array}{|l|l|}
    \hline
    u=x & du=dx \\\hline
    dv=\exp(ax)\,dx & v=\mfrac{1}{a}\exp(ax)\\\hline
\end{array}}\\
&=\frac{1}{a}\exp(ax)\biggl(x-\frac{1}{a}\biggr)+c.
\end{align*}
\egroup

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.