Question:
Differentiate the following w.r.t. x:
$\cos \left(\log x+e^{x}\right), x>0$
Solution:
Let $y=\cos \left(\log x+e^{x}\right)$
By using the chain rule, we obtain
$\frac{d y}{d x}=-\sin \left(\log x+e^{x}\right) \cdot \frac{d}{d x}\left(\log x+e^{x}\right)$
$=-\sin \left(\log x+e^{x}\right) \cdot\left[\frac{d}{d x}(\log x)+\frac{d}{d x}\left(e^{x}\right)\right]$
$=-\sin \left(\log x+e^{x}\right) \cdot\left(\frac{1}{x}+e^{x}\right)$
$=-\left(\frac{1}{x}+e^{x}\right) \sin \left(\log x+e^{x}\right), x>0$