The product rule says that if $u$ and $v$ are functions of $x$ then
\[\simplify[std]{Diff(u * v,x,1) = u * Diff(v,x,1) + v * Diff(u,x,1)}\]
For this example:
\[\simplify[std]{u = x ^ {m}}\Rightarrow \simplify[std]{Diff(u,x,1) = {m}x ^ {m -1}}\]
\[\simplify[std]{v = cos({a} * x+{b})} \Rightarrow \simplify[std]{Diff(v,x,1) = -{a} * sin({a} * x+{b})}\]
Hence on substituting into the product rule above we get:
\[\simplify[std]{Diff(f,x,1) = {m}x ^ {m-1} * cos({a} * x+{b})-{a}x^{m} * sin({a} * x+{b})}\]