The answer to whether you should file jointly or separately isn't always straightforward.