# Finding the tenth derivative of $f(x) = e^x\sin x$ at $x=0$ [duplicate]

I came across this Question where I have to find $$f^{(10)}$$ for the following function at $$x = 0$$ $$f(x) = e^x\sin x$$

I tried differentiating a few times to get a pattern but didn’t get one, can someone provide the solution.

## marked as duplicate by Trevor Gunn, Xander Henderson, Lord Shark the Unknown, Arturo Magidin calculus StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Feb 10 at 3:43

Hint:

$$f(x)=e^x\sin x$$ $$f'(x)=e^x(\sin x +\cos x)$$ $$f''(x)=e^x(\sin x+\cos x)+e^x(\cos x -\sin x)=2e^x(\cos x)$$ $$f'''(x)=e^x(2\cos x)-e^x(2\sin x)=2e^x(\cos x-\sin x)$$ $$f^{IV}(x)=2e^x(\cos x-\sin x)-2e^x(\cos x+\sin x)=-4e^x(\sin x)=-4f(x)$$

• First time to see roman numerals to denote derivatives. Nice! – Taladris Jan 18 at 1:47
• Lower case too, awful notation if you ask me. – marshal craft Jan 18 at 7:43
• I have no problem with lowercase roman numerals in general, but here it looks like taking the power to the imaginary unit (times $v$)... – ilkkachu Jan 18 at 11:36
• There will be some confusion when you get to the tenth derivative...... – Spencer Jan 18 at 13:40
• @Shufflepants en.wikipedia.org/wiki/Fractional_calculus – BPP Jan 18 at 16:13

Hint:

As $$\;\mathrm e^x\sin x=\operatorname{Im}\bigl(\mathrm e^{(1+i)x}\bigr)$$, you have to find first the real and imaginary parts of $$(1+i)^{10}$$.

Some details:

There results from the above remark and linearity of differentiation that $$\;(\mathrm e^x\sin x)'=\bigl(\operatorname{Im}(\mathrm e^{(1+i)x})\bigr)'= \operatorname{Im}\bigl((1+i)\mathrm e^{(1+i)x}\bigr)$$, hence $$\;(\mathrm e^x\sin x)''=\bigl(\operatorname{Im}((1+i)\mathrm e^{(1+i)x}))\bigr)'= \operatorname{Im}\bigl((1+i)^2\mathrm e^{(1+i)x}\bigr),$$ and more generally $$(\mathrm e^x\sin x)^{(k)}=\bigl(\operatorname{Im}(\mathrm e^{(1+i)x})\bigr)^{(k)}=\operatorname{Im}\bigl((1+i)^k(\mathrm e^{(1+i)x})\bigr).$$

• This is by far the most efficient solution. – Yves Daoust Jan 17 at 23:38
• Knowing $(1+i)^2=2i$ helps too – Henry Jan 18 at 8:09
• This is an excellent hint, for students with a little knowledge of complex numbers. It also can be followed by a second hint: don’t use binomial expansion to find these! – Peter LeFanu Lumsdaine Jan 18 at 9:01
• @Abcd: you don't have to be sorry. We're here to help as much as we can. Where are you stuck? – Bernard Jan 19 at 13:30
• The tenth drivative of the complex-values function is $(1+i)^{10}\mathrm e^{(1+i)x}$. Calculate it (in exponential form), then extract the imaginary part. Is it clear now? – Bernard Jan 21 at 17:44

Using power series: it is well-known that $$e^x=\sum_{k=0}^\infty \frac{x^k}{k!}$$ and $$\sin(x)=\sum_{k=0}^\infty (-1)^k\frac{x^{2k+1}}{(2k+1)!}$$ for any real number $$x$$, so

$$e^x\sin(x)=(1+x+\frac{x^2}{2!}+\dots+\frac{x^{10}}{10!}+\dots)(x-\frac{x^3}{3!}+\frac{x^5}{5!}-\frac{x^7}{7!}+\frac{x^9}{9!}+\dots)$$

By expanding, the coefficient of $$x^{10}$$ is $$\frac{1}{9!1!}-\frac{1}{7!3!}+\frac{1}{5!5!}-\frac{1}{7!3!}+\frac{1}{9!1!}$$

But this coefficient is also $$\frac{f^{(10)}(0)}{10!}$$, so

$$f^{(10)}(0)=\frac{10!}{9!1!}-\frac{10!}{7!3!}+\frac{10!}{5!5!}-\frac{10!}{7!3!}+\frac{10!}{9!1!} = 10 -120 + 252 - 120 +10 = 32$$

• Take note of this solution, if the derivative at some point is needed, you don't need a symbolic expression for the $n$th derivative evaluated at some arbitrary point $x$. In some cases where a symbolic expression is not available, you can still find the $n$th derivative at some special point for arbitrary $n$. Also, there exists a general method based on Newton-Raphson division to find the $n$th derivative of an arbitrary function at some given point using some power of $\log(n)$ multiplications. Some computer algebra systems use such methods to compute series expansions. – Count Iblis Jan 18 at 3:14

Use Leibniz' Rule for higher derivatives of a product: $$\frac{d^n}{dx^n}(uv) =\frac{d^nu}{dx^n}v+\binom n1\frac{d^{n-1}u}{dx^{n-1}}\frac{dv}{dx} +\binom n2\frac{d^{n-2}u}{dx^{n-2}}\frac{d^2v}{dx^2}+\cdots+u\frac{d^nv}{dx^n}\ .$$ In your case take $$u=e^x$$ and $$v=\sin x$$. Since you are going to substitute $$x=0$$ after differentiating, all the $$e^x$$ terms will be $$1$$, all the $$\sin x$$ terms will be $$0$$ and all the cos $$x$$ terms will be $$1$$ (though some of them will pick up a negative sign when you differentiate). So the answer is \eqalign{0+\binom{10}11&{}+\binom{10}20+\binom{10}3(-1)+\binom{10}40+\binom{10}51\cr &\qquad{}+\binom{10}60+\binom{10}7(-1)+\binom{10}80+\binom{10}91+\binom{10}{10}0\cr &=10-120+252-120+10\cr &=32\ .\cr}

$$(e^x(a\cos x+b\sin x))'=e^x(a\cos x+b\sin x)+e^x(b\cos x-a\sin x)=e^x((a+b)\cos x+(b-a)\sin x).$$

So

$$(0,1)\to(1,1)\to(2,0)\to(2,-2)\to(0,-4)\to(-4,-4)\to(-8,0)\to(-8,8)\to(0,16)\to(16,16)\to(32,0).$$

If you divide by increasing powers of $$2$$, in pairs, the pattern emerges, with period $$8$$:

$$(0,1)\to(1,1)\to(1,0)\to(1,-1)\to(0,-1)\to(-1,-1)\to(-1,0)\to(-1,1)\to(0,1)\to(1,1)\to(1,0).$$

One trick here is to use $$e^{ix}=\cos x+i\sin x$$ and define $$g(x)=e^x\cos x$$ then $$f(x)$$ and $$g(x)$$ are both real functions.

Let $$h(x)=g(x)+if(x)=e^{(1+i)x}$$ then the tenth derivative of $$h(x)$$ is $$(1+i)^{10}h(x)$$ and the tenth derivative of $$f(x)$$ is the imaginary part of this.

Because you only want the value at $$x=0$$ you can evaluate there, with $$h(0)=g(0)+if(0)$$

I get $$f^{10}(x)=32e^x\cos x$$.

Here's what I did:

\begin{align}f'(x)&=e^x(\sin x+\cos x)\\ \implies f''(x)&=2e^x\cos x\\ \implies f^3(x)&=2e^x(\cos x-\sin x)\\ \implies f^4(x)&=2e^x(-2\sin x)=-4f(x)\\ \implies f^5(x)&=-4f'(x)\\ \implies f^8(x)&=-4f^4(x)=16f(x)\\ \implies f^{10}(x)&=16f''(x)\end{align}

• Your calculation for $f^{(4)}$ is wrong. Looks like you missed a product rule. – AlexanderJ93 Jan 17 at 23:45
• Be careful: $$(e^x(g(x))'=e^xg(x)+e^xg'(x)$$ You missed the first bit in your calculation for $f^4$ – Rhys Hughes Jan 17 at 23:48
• @RhysHughes &Alexander J93 thanks – Chris Custer Jan 17 at 23:53

Use the formula $$(fg)^{(n)}= \sum\limits_{k=0}^{n} \binom {n} {k} (f)^{(k)}(g)^{(n-k)}$$.

Regarding the question about looking for a pattern:

Repeated application of the product rule gives

$$f(x) = e^x \sin x$$ $$f'(x) = e^x \sin x + e^x \cos x$$ $$f''(x) = e^x \sin x + e^x \cos x + e^x \cos x - e^x \sin x = 2\ e^x \cos x$$ Is a pattern emerging? $$f^{(3)}(x) = 2\ e^x \cos x -2\ e^x \sin x$$ $$f^{(4)}(x) = 2\ e^x \cos x -2\ e^x \sin x - 2\ e^x \sin x - 2\ e^x \cos x = -4\ e^x \sin x$$ Yes. We can then conclude that

$$f^{(6)}(x) = -8\ e^x \cos x$$, $$f^{(8)}(x) = 16\ e^x \sin x$$, and $$f^{(10)}(x) = 32\ e^x \cos x$$

such that $$f^{(10)}(0) = 32$$

Using recurrence relation: \begin{align}f^{(0)}=&e^x\sin x\\ f^{(1)}=&e^x\sin x+e^x\cos x=f^{(0)}+e^x\cos x\\ f^{(2)}=&f^{(1)}+\color{red}{e^x\cos x}-e^x\sin x=f^{(1)}+\color{red}{f^{(1)}-f^{(0)}}-f^{(0)}\\ \color{blue}{f^{(n)}=}&\color{blue}{2f^{(n-1)}-2f^{(n-2)}, f^{(0)}(0)=0, f^{(1)}(0)=1} \Rightarrow \\ f^{(n)}=&\frac12i\left[(1-i)^n-(1+i)^n\right] \Rightarrow \\ f^{(10)}(0)=&\frac12i[(1-i)^{10}-(1+i)^{10}]=\\ =&-\frac12i\left[{10\choose 1}i+{10\choose 3}i^3+{10\choose 5}i^5+{10\choose 7}i^7+{10\choose 9}i^9\right]=\\ =&{10\choose 1}-{10\choose 3}+{10\choose 5}-{10\choose 7}+{10\choose 9}=\\ =&10-120+252-120+10=\\ =&32.\end{align}

Addendum: Direct calculation from the recurrence relation above: $$\color{blue}{f^{(n)}=2\left[f^{(n-1)}-f^{(n-2)}\right], f^{(0)}(0)=0, f^{(1)}(0)=1}\\ \begin{array}{c|c|c|c|c|c|c|c|c} f^{(0)}&f^{(1)}&f^{(2)}&f^{(3)}&f^{(4)}&f^{(5)}&f^{(6)}&f^{(7)}&f^{(8)}&f^{(9)}&f^{(10)}\\ \hline 0&1&2&2&0&-4&-8&-8&0&16&32\end{array}$$