# Calculation of the derivative of $e^{\cos(x)}$ from first principles

The derivative of $e^{\cos(x)}$ is $-\sin(x)e^{\cos(x)}$. However I would like to prove it using first principles, i.e. by using $f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}$. I tried Taylor series but it didn't work out. Thanks for any help.

• calculating the derivate uses the chain rule and the rules for $\cos$ and $\exp$. So you could try to mimic a proof of the chain rule. Jan 18 '14 at 7:18

When we have a question of calculating the derivative via first principles then it means that the idea is to drill down the definition of derivative via actual examples. It also signifies that the student is beginning to learn differential calculus. It is therefore much better to use techniques which rely on standard limits and don't rely on advanced theorems of differential calculus (like Taylor's series on L'Hospital's rule).

We will make use of the following standard limits $$\lim_{h \to 0}\frac{e^{h} - 1}{h} = 1, \,\,\lim_{h \to 0}\frac{\sin h}{h} = 1$$ We have $f(x) = e^{\cos x}$ and by definition of derivative \begin{aligned}f'(x)\, &= \lim_{h \to 0}\frac{f(x + h) - f(x)}{h}\\ &= \lim_{h \to 0}\frac{e^{\cos(x + h)} - e^{\cos x}}{h}\\ &= \lim_{h \to 0}\frac{e^{\cos x}\{e^{\cos(x + h) - \cos x} - 1\}}{h}\\ &= e^{\cos x}\lim_{h \to 0}\frac{e^{\cos(x + h) - \cos x} - 1}{\cos(x + h) - \cos x}\cdot\frac{\cos(x + h) - \cos x}{h}\\ &= e^{\cos x}\lim_{t \to 0}\frac{e^{t} - 1}{t}\cdot\lim_{h \to 0}\frac{\cos(x + h) - \cos x}{h}\\ &= e^{\cos x}\cdot 1\cdot\lim_{h \to 0}\dfrac{-2\sin\left(x + \dfrac{h}{2}\right)\sin\left(\dfrac{h}{2}\right)}{h}\\ &= -e^{\cos x}\cdot\lim_{h \to 0}\sin\left(x + \frac{h}{2}\right)\cdot\lim_{h \to 0}\frac{\sin(h/2)}{h/2}\\ &= -e^{\cos x}\cdot\sin x\cdot 1 = -e^{\cos x}\sin x\end{aligned} In the above derivation we have made the substitution $t = \cos(x + h) - \cos x$ and $t \to 0$ as $h \to 0$.

$$f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}=e^{\cos x}\lim_{h\to 0}\frac{e^{\cos x(\cos h-1)-\sin x\sin h}-1}{h},$$ we use hospital Rule to compute the limit

We have \begin{align} \lim_{h\to 0}\frac{e^{\cos x(\cos h-1)-\sin x\sin h}-1}{h} &=\lim_{h\to 0}\left[(-\sin h(\cos x)-\cos h\sin x)\ e^{\cos x(\cos h-1)-\sin x\sin h}\right]\\ &=\lim_{h\to 0}(-\sin h(\cos x)-\cos h\sin x)\,\cdot\,\lim_{h\to 0}e^{\cos x(\cos h-1)-\sin x\sin h}\\ &=-\sin x. \end{align}

• Isn't using L'Hopital's rule to compute a derivate kind of circular, especially when you have to use the chain rule to compute the derivate for L'Hopital's? Jun 17 '14 at 4:44

Indeed, Taylor series about $h \to 0$ works! Your limit calculation for the derivative can be written as:

$$L = \lim_{h\to 0} \frac{e^{\cos{(x + h)}} - e^{\cos{x}}}{h} = \lim_{h \to 0} \frac{e^{\cos{x}} - e^{\cos{x}} \, h \, \sin{x} - \frac{1}{2} e^{\cos{x}} (\cos{x} - \sin^2{x}) \, h^2 + \mathcal{O}(h^3) - e^{\cos{x}}}{h},$$

simplifying and cancelling out every term in $h$ it yields:

$$L = -e^{\cos{x}} \sin{x} = f'(x).$$

Cheers!

PS: I used Mathematica to perform the Taylor series for speed, but it's only strictly necessary to retain terms of first order in $h$. But, since Taylor expansion requires derivating, this should not be qualified as "first principles".