Sometimes, when a page is ended with a formula, it goes below the desired page border. For example, the following code
\documentclass{article}
\usepackage[showframe,
textwidth=4cm,
textheight=5cm]{geometry}
\def\formula{%
x\frac{x\sum_{n=1}^\infty\frac{x^n}{n!}}
{x\sum_{n=1}^\infty\frac{nx^n}{n!}}}
\begin{document}
\[ \formula \]
\vfill
\[ \formula \]
\[ \formula \]
\[ \formula \]
\end{document}
produces this result at page 1:
(I'm using TeXLive 2016 both on Windows and Linux, the result is the same, also the same for pdflatex and lualatex.) Is there a way to make it respect page boundaries?

gather*fromamsmaththat features\displaybreak. – egreg Apr 27 '17 at 08:30amsmathenvironments and\displaybreak. – egreg Apr 27 '17 at 08:34\[...\]is wrong. – egreg Apr 27 '17 at 08:42Some text Some text Some text Some text Some text` The output again shows that the formula which ends a page goes to the bottom margin slightly.
– Sergei Golovan Apr 27 '17 at 08:48\par\vfill j. It would disappear if you set\maxdepth=0pt. – Ulrike Fischer Apr 27 '17 at 09:16