Question 0. Let's put the issue to Mathematica:


  D[x Cos[xy],x]
  
  D[xCos[x*y],x]
  
  D[x Cos[x y],x]
  
  D[x Cos(x y),x]

Only the third one of these is right.

Up to Test 3 solutions