Here are some options, using \fbox
, \boxed
and \Aboxed
, depending on what you have access to:
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
f(x) &= \sqrt{a^2 + x^2} \\
& + \sqrt{b^2 + x^2} \\[2\jot]
f(x) &= \sqrt{a^2 + x^2} \\
& \fbox{${}+ \sqrt{b^2 + x^2}$} \\[2\jot]
f(x) &= \sqrt{a^2 + x^2}
\hspace{\dimexpr\fboxsep+\fboxrule}
\makebox[0pt][r]{\fbox{\phantom{$f(x) = \sqrt{a^2 + x^2}$}}} \\
& + \sqrt{b^2 + x^2} \\
\Aboxed{f(x) &= \sqrt{a^2 + x^2}} \\
f(x) &= \sqrt{a^2 + x^2} \\
& \boxed{{}+ \sqrt{a^2 + x^2}}
\end{align*}
\end{document}
\Aboxed
is able to manage spanning an alignment &
. However, you can overprint an \fbox
(or \boxed
) to achieve the same effect.
\Aboxed{...}
provided by themathools
package.boxed{...}
provided byamsmath