Is there any consensus about when to use inline math mode and when it is more appropriate to use display math mode when writing in latex (in formal math writing)?
When writing, I feel that it is often easier to read display math mode, but sometimes doing that breaks up the flow of the sentence, expecially when defining variables or functions.
For example
Define $f: \mathbb{R}^2 \to \mathbb{R}$ by $f(x,y) = \frac{27x^3 - 5}{2xy} + \cos x $.
vs.
Define $f: \mathbb{R}^2 \to \mathbb{R}$ by $$f(x,y) = \frac{27x^3 - 5}{2xy} + \cos x .$$