I know that latex doesn't automatically insert new lines in math mode, so the way to prevent margin overflows is to use the align mode, and manually add newlines. But this sometimes leads to equations overflowing the bottom margin like so (margins displayed using 'showframe'):
I couldn't find way to prevent this from happening (I know it isn't really a big problem, but it doesn't seem ideal). And searching for this just brings up results regarding side margin overflows.