Did you mean the derivative of (cos x)^x ? Then, use logarithmic differentiation:
y = (cos x)^x
ln(y) = ln[(cos x)^x]
ln(y) = x ln[cos x]
(1/y) y' = 1 ln[cos x] + x (-sin x)/(cos x)
y' / y = ln[cos x] - (x sin x)/(cos x)
y' = y [ ln[cos x] - (x sin x)/(cos x) ]
the key step in the process - the substitution.
You had: y = (cos x)^x, so we will substitute for y.
y' = (cos x)^x [ ln[cos x] - (x sin x)/(cos x) ]
(and this is your final answer)