If
[tex]f(x) = e^{ax}\cos(bx)[/tex]
then by the product rule,
[tex]f'(x) = \left(e^{ax}\right)' \cos(bx) + e^{ax}\left(\cos(bx)\right)'[/tex]
and by the chain rule,
[tex]f'(x) = e^{ax}(ax)'\cos(bx) - e^{ax}\sin(bx)(bx)'[/tex]
which leaves us with
[tex]f'(x) = \boxed{ae^{ax}\cos(bx) - be^{ax}\sin(bx)}[/tex]
Alternatively, if you exclusively want to use the chain rule, you can carry out logarithmic differentiation:
[tex]\ln(f(x)) = \ln(e^{ax}\cos(bx)} = \ln(e^{ax})+\ln(\cos(bx)) = ax + \ln(\cos(bx))[/tex]
By the chain rule, differentiating both sides with respect to x gives
[tex]\dfrac{f'(x)}{f(x)} = a + \dfrac{(\cos(bx))'}{\cos(bx)} \\\\ \dfrac{f'(x)}{f(x)} = a - \dfrac{\sin(bx)(bx)'}{\cos(bx)} \\\\ \dfrac{f'(x)}{f(x)} = a-b\tan(bx)[/tex]
Solve for f'(x) yields
[tex]f'(x) = e^{ax}\cos(bx) \left(a-b\tan(bx)\right) \\\\ f'(x) = e^{ax}\left(a\cos(bx)-b\sin(bx))[/tex]
just as before.