If the in-line math contains too long expression, e.g, parenthesis, just add an math space in between the equality and the left parenthesis. Then the line will be broke at the math space. The following graph is the lyx source:
Note that there is math space. The following is the pdf graph.
Or put
\allowbreak in the place for breaking line, e.g.
The pdf output is