# $100$-th derivative of the function $f(x)=e^{x}\cos(x)$

I've got this task I'm not able to solve. So i need to find the 100-th derivative of $$f(x)=e^{x}\cos(x)$$ where $x=\pi$.

I've tried using Leibniz's formula but it got me nowhere, induction doesn't seem to help either, so if you could just give me a hint, I'd be very grateful.

Many thanks!

Find fewer order derivatives:

\begin{align} f'(x)&=&e^x (\cos x -\sin x)&\longleftarrow&\\ f''(x)&=&e^x(\cos x -\sin x -\sin x -\cos x) \\ &=& -2e^x\sin x&\longleftarrow&\\ f'''(x)&=&-2e^x(\sin x + \cos x)&\longleftarrow&\\ f''''(x)&=& -2e^x(\sin x + \cos x + \cos x -\sin x)\\ &=& -4e^x \cos x \\ &=& -4f(x)&\longleftarrow&\\ &...&\\ \therefore f^{(100)}(\pi)&=&-4^{25} f(\pi) \end{align}

• I think I got it. I actually calculated another four (up to 8-th) derivatives using WA. This is basically inductive approach. When I tried it first time, I stopped at the third derivative, and it turns out the 4-th is the important one, heh. Thanks for the effort. Apr 21 '16 at 12:02
• Keep in mind that the basic circular trig-function derivatives are cyclic with period four: sin -> cos -> -sin -> -cos -> sin. Any time you're looking for derivatives to combine, you're using the 4th derivative. If you need them to cancel, you're using the 2nd derivative. This is the basis of the canonical solutions to second-order differential equations. Apr 21 '16 at 21:30

HINT:

$e^x\cos x$ is the real part of $y=e^{(1+i)x}$

As $1+i=\sqrt2e^{i\pi/4}$

$y_n=(1+i)^ne^{(1+i)x}=2^{n/2}e^x\cdot e^{i(n\pi/4+x)}$

Can you take it from here?

• Thanks for your comment. I get the idea and it is, I must say, a really original approach, haven't seen anyone doing derivatives this way. Apr 21 '16 at 11:58
• @windircursed This was the trick behind your question. Whenever you are asked to find the derivative of a very high order, always look for a way to manipulate the function in such a way, that the derivatives become either periodic or trivially easy. In this case, the insight is in writing the trigonometric function as a function of the exponential function, who's derivative is easy. Apr 21 '16 at 12:08
• @Stephan. The real part of $e^{i(n\pi/4+x)}$ is $\cos(n\pi/4+x)$ So, the real part of $2^{n/2}e^x\cdot e^{i(n\pi/4+x)}$ is $2^{n/2}e^x\cos(n\pi/4+x)$ which is the required answer Apr 21 '16 at 15:00
• This method is also useful if you want to integrate things like $e^x \cos(2x)$ without integration by parts.
– Joel
Apr 22 '16 at 8:15
• @Joel, Same as $$n=-1$$ right? Apr 23 '16 at 5:42

There is this more systematic approach (requires linear algebra) which we can extend for more complicated cases. The key fact is that you have a set of functions (vectors) whose linear span is closed under the derivative operator. (You will never get something that is not a linear combination of $e^x \cos(x)$ and $e^x \sin(x)$ by taking derivatives).

Consider the vector space $V$ generated by $e^x \cos(x), e^x \sin(x)$. The derivative $D:V\to V$ is a linear map in that space. In those basis vectors

$$D = \left( \begin{array}{cc} 1 & -1 \\ 1 & 1 \\ \end{array} \right)$$

The problem is now to calculate $D^{100}$. For that, we could diagonalise $D$. However, in this case, $D^4 = -4 I$ so $D^{100} = -4^{25} D$. Therefore

$$D(e_1) = 4 e_1 = e^x \cos(x)$$

• Very nice approach, thanks. Apr 23 '16 at 20:25
• Ahhh, Really nice approach. Linear algebra pops up everywhere! Apr 25 '16 at 6:45

Alternatively, one may use the General Leibniz rule/Cauchy formula $$(fg)^{(n)}(x)=\sum_{k=0}^n\binom{n}{k}f^{(n-k)}(x)g^{(k)}(x)$$ with $$f(x)=e^x,\quad f^{(n-k)}(x)=e^x,\quad g(x)=\cos x,\quad g^{(k)}(x)=\cos(x+k\pi/2).$$

• According to Wikipedia: en.wikipedia.org/wiki/General_Leibniz_rule this is called General Leibniz rule. You say it's called Cauchy formula, but i haven't seen that name referring to this formula anywhere.. Feb 14 '17 at 17:42
• @RestlessC0bra I've taken your comment into account. Feb 14 '17 at 18:18
• Cauchy's formula for differentiation usually involves integrals. Aug 6 '17 at 20:49

$\cos(x) = \frac {\exp(\mathrm{i}x) + \exp (-\mathrm{i}x)}2$

And the rest is basically grunt work.

There is a pattern, which is easy to see in this problem, (e^x = @)

@cosx

1st derivative - @cosx -@sinx

2nd derivative - -2@sinx

3rd .. - -2(@sinx + @cosx)

4th .. - -4@cosx

100 = 0mod4

So, 100th derivative of @cosx should be of the form a@cosx and a is (-4)^25.

So, at x = π, 100th derivative is 4²⁵e^π.

• There are already answers to this post that say what you have said.
– R_D
Apr 23 '16 at 6:29
• My apologies, I didn't go through the answers. Apr 23 '16 at 6:35

I'm a little late to the game, but you can check your work in Wolfram Alpha with this query:

D[E^x Cos[x], {x, 100}]  at x = pi


which matches the answer posted by @choco_addicted. The syntax comes from the Wolfram Language page for the D function.