# Changes to Coefficient function in v10.2

In the version Mathemaica 10.4, I am very surprised that the core function Coefficient has changed, e.g.,

Coefficient[3 x x + 8 y y - 24 x y, 2 x y]


0

In previous versions (e.g. v9.0.1, v10.1.0), the result was -12. On the website wolframalpha, the result is still -12. According to comments, it seems like the change has happened from v10.1.0 to v10.2.0.

Yes, this change is very small, but I feel it is very dangerous for my previous research code. How do I know about these kind of changes in new versions? Is there a list explaining such changes?

• I don't see 2*x*y occuring in 24*x*y. – Daniel Lichtblau Aug 10 '16 at 3:56
• Dear @m_goldberg,If this is not a probelm? why v10.1.0 and v11 give different results? Maybe I am dumb. I don't understand why 0 is more reasonable? And I see '2*xy' in '12*xy'. Please give this problem more time before voting to close it, it doesn't hurt, right? – xinxin guo Aug 10 '16 at 7:37
• Looks like a classic case of "undefined behavior". Coefficient wasn't meant to be used that way, so the outcome can change between versions, maybe even different runs of the same version. – Niki Estner Aug 10 '16 at 7:38
• v9.0.1 yields -12 – Hector Aug 10 '16 at 8:33
• What @nikie said. This is very much in the "undefined behavior" realm. In this instance, the old behavior was lost due to a bug fix that involved something slightly closer to intended usage. – Daniel Lichtblau Aug 10 '16 at 14:57