# MathJax in Comment Gets Corrupted

MathJax bug:

(Of course I don't know whether the bug is in the MathJax engine or in StackExchange code.)

When I enter the following comment in a math.stackexchange.com page, the second \alpha in sin(α_1+α_2) gets split up for some reason, yielding sin(α_1+\a lpha_2), which displays with the \a in red as an unrecognized escape sequence.

It depends on what you mean by "closed-form". Since it is only piecewise differentiable, I don't think you can avoid the presence of constructs like "max" that correspond to an "if-then" in a program, although they can be hidden using closed-form constructs like "if A then B else C"$=B\,sgn(A)^2+C(1-sgn(A)^2)$. Given 2 angles $\alpha_1,\alpha_2$, you can assume a unit-diameter circumcircle and construct all the other parameters: $(s_1,s_2,s_3,\phi_1,\phi_2,\phi_3)=(sin(\alpha_1),sin(\alpha_2),sin(\alpha_1+\alpha_2),0,\alpha_1+\alpha_2,\alpha_2)$. These two tricks should give you what you want.
• @Thursday Thanks for the tip! – Matt Sep 1 '14 at 18:49
• – Martin Aug 19 '18 at 10:19

Workaround: use some whitespace in long formulas when you post them in comments. Something like $(s_1,s_2,s_3,\phi_1,\phi_2,\phi_3)= (sin(\alpha_1),sin(\alpha_2), sin(\alpha_1+\alpha_2),0, \alpha_1+\alpha_2,\alpha_2)$ is safe to use.
I think it's not feasible for the simple comment processor to correctly decide what's a formula and what's not. (Why, oh why did Knuth use symmetric delimiters for math?). Perhaps a more realistic solution would be to train MathJax to ignore HTML entities &zwnj;&#8203;, but this is something you'd need to bring up with MathJax team. For now, manual insertion of whitespace will have to do.