minipage is wider than I wanted

This is a minimal example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\showboxdepth=5 \showboxbreadth=100 
\sbox0{\vbox{\hsize=10pt
  \noindent\begin{align*}\hbox to 15pt{}\end{align*}}}
\showbox0

\sbox0{\vbox{\hsize=10pt
  \noindent\begin{align}\hbox to 15pt{}\end{align}}}
\showbox0

\end{document}

The log file shows

> \box0=
\hbox(29.0+0.0)x15.0
.\vbox(29.0+0.0)x15.0
..\penalty 10000
..\glue(\abovedisplayskip) 10.0 plus 2.0 minus 5.0
..\glue -3.0
..\glue 0.0
..\hbox(8.39996+3.60004)x15.0, display
...\glue(\tabskip) 0.0
...\hbox(8.39996+3.60004)x15.0
....\glue 0.0 plus 1.0fil
....\hbox(8.39996+3.60004)x0.0
.....\vbox(8.39996+3.60004)x0.0 []
....\hbox(0.0+0.0)x15.0
.....\mathon
.....\hbox(0.0+0.0)x15.0
.....\mathoff
...\glue(\tabskip) 0.0
...\hbox(8.39996+3.60004)x0.0
....\hbox(0.0+0.0)x0.0
.....\mathon
.....\hbox(0.0+0.0)x0.0
.....\mathoff
....\glue 0.0 plus 1.0fil
...\glue(\tabskip) 10.0
...etc.
..etc.

! OK.
l.8 \showbox0

> \box0=
\hbox(41.0+0.0)x10.0
.\vbox(41.0+0.0)x10.0
..\penalty 10000
..\glue(\abovedisplayskip) 10.0 plus 2.0 minus 5.0
..\glue -3.0
..\glue 0.0
..\hbox(8.39996+15.60004)x10.0, display
...\glue(\tabskip) 0.0
...\hbox(8.39996+15.60004)x15.0
....\glue 0.0 plus 1.0fil
....\hbox(8.39996+3.60004)x0.0
.....\vbox(8.39996+3.60004)x0.0 []
....\hbox(0.0+0.0)x15.0
.....\mathon
.....\hbox(0.0+0.0)x15.0
.....\mathoff
...\glue(\tabskip) 0.0
...\hbox(8.39996+15.60004)x0.0
....\hbox(0.0+0.0)x0.0
.....\mathon
.....\hbox(0.0+0.0)x0.0
.....\mathoff
....\glue 0.0 plus 1.0fil
...\glue(\tabskip) 10.0
...etc.
..etc.

! OK.
l.12 \showbox0

As you can see, the first box is 15pt wide, because at the outer level inside the \vbox there is

..\hbox(8.39996+3.60004)x15.0, display

while in the second one we find

..\hbox(8.39996+15.60004)x10.0, display

It seems that align boxes the equation to the overall \hsize when it has to place an equation number (shifted down), but doesn't bother to when no equation number is required.

This doesn't happen when equation/equation* or gather/gather* are used.


I tried nesting the culprit in its own minipage within the minipage. That seems to fix the problem. Whatever \vbox might be doing within the inner most box seem not to get inherited in the super-boxes.

\noindent
This seems to work.\\[\baselineskip]
%%
\noindent
\fbox{%
\begin{minipage}[t]{\dummy}
The contents of the next line are too long to fit within this box.\newline
\begin{minipage}{\textwidth}
\begin{align}
    \arctan(x/a) &= \frac{1}{a} \int_0^\infty \sum_{n=0}^{\infty} \left(-t^2/a^2\right)\mathrm{d}t
    \notag
\end{align}~
\end{minipage}\newline
I used \texttt{notag} and the width of the box has been altered.
\end{minipage}}%
\fbox{\begin{minipage}[t]{0.6\textwidth-2\fboxrule-2\fboxsep}%
    \raggedright{}
    \lipsum[23]
\end{minipage}}%

Thanks @egreg. I wouldn't have thought of this sort fix without your input.