How exactly does this reordering "change the meaning of the equation"? The derivative of with respect to x is . In this case, x is c and k is . So the derivative of is or . Multiply that by the constant and the derivative is or exactly as MATLAB showed.
Sure, the way MATLAB displays u is not identical to the way you entered it, but it represents the same value.
Ah, you're thinking it's not a reordering question but a question about operator precedence. Yes, unary minus is lower in priority (at level 4) than the power operations (levels 2 and 3.) I agree, adding parentheses (level 1) can help clarify intent.