Consider the function \(f\left( x \right) = {e^x}\sin x + \cos x\). Differentiate the function w.r.t \(x\) by using the derivatives of trigonometric functions, exponential function and the product rule.
\(\begin{aligned}\frac{{d\left( {f\left( x \right)} \right)}}{{dx}} &= \frac{{d\left( {{e^x}\sin x + \cos x} \right)}}{{dx}}\\ &= \frac{d}{{dx}}\left( {{e^x}\sin x} \right) + \frac{d}{{dx}}\left( {\cos x} \right)\\ &= {e^x}\frac{d}{{dx}}\left( {\sin x} \right) + \sin x\frac{d}{{dx}}\left( {{e^x}} \right) + \frac{d}{{dx}}\left( {\cos x} \right)\\ &= {e^x}\cos x + \sin x\left( {{e^x}} \right) - \sin x\\ &= {e^x}\left( {\cos x + \sin x} \right) - \sin x\end{aligned}\)
Thus, the derivative of the function \(f\left( x \right) = {e^x}\sin x + \cos x\) is \(f'\left( x \right) = {e^x}\left( {\cos x + \sin x} \right) - \sin x\).