Answer: Let \(H_n\) be the statement that \(\dfrac{\mathrm d^n}{\mathrm d x^n}(e^x\sin x)=2^{n/2}e^x\sin\left(x+\dfrac{n\pi}{4}\right)\).
For \(n=1\),
\(\dfrac{\mathrm d}{\mathrm d x}(e^x\sin x)=e^x\sin x+e^x\cos x\),
and since \(\sin x+\cos x=\sqrt2\sin\left(x+\dfrac{\pi}{4}\right)\), this gives
\(\dfrac{\mathrm d}{\mathrm d x}(e^x\sin x)=2^{1/2}e^x\sin\left(x+\dfrac{\pi}{4}\right)\).
So \(H_1\) is true.
Now assume \(H_k\) is true for some positive integer \(k\), so that
\(\dfrac{\mathrm d^k}{\mathrm d x^k}(e^x\sin x)=2^{k/2}e^x\sin\left(x+\dfrac{k\pi}{4}\right)\).
Differentiate both sides:
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}(e^x\sin x)=2^{k/2}\left(e^x\sin\left(x+\dfrac{k\pi}{4}\right)+e^x\cos\left(x+\dfrac{k\pi}{4}\right)\right)\).
Factor out \(2^{(k+1)/2}e^x\):
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}(e^x\sin x)=2^{(k+1)/2}e^x\left(\dfrac{1}{\sqrt2}\sin\left(x+\dfrac{k\pi}{4}\right)+\dfrac{1}{\sqrt2}\cos\left(x+\dfrac{k\pi}{4}\right)\right)\).
Using \(\sin A\cos\dfrac{\pi}{4}+\cos A\sin\dfrac{\pi}{4}=\sin\left(A+\dfrac{\pi}{4}\right)\), this becomes
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}(e^x\sin x)=2^{(k+1)/2}e^x\sin\left(x+\dfrac{(k+1)\pi}{4}\right)\).
This is exactly \(H_{k+1}\). Therefore \(H_k\Rightarrow H_{k+1}\).
Hence, by mathematical induction,
\(\dfrac{\mathrm d^{n}}{\mathrm d x^{n}}\left(e^x\sin x\right)=2^{n/2}e^x\sin\left(x+\dfrac{n\pi}{4}\right)\)
for all positive integers \(n\).
Let \(H_n\) denote the statement
\(\dfrac{\mathrm d^{n}}{\mathrm d x^{n}}\left(e^x\sin x\right)=2^{n/2}e^x\sin\left(x+\dfrac{n\pi}{4}\right).\)
Base case. For \(n=1\),
\(\dfrac{\mathrm d}{\mathrm d x}(e^x\sin x)=e^x\sin x+e^x\cos x.\)
Now \(\sin x+\cos x=\sqrt2\sin\left(x+\dfrac{\pi}{4}\right)\), so
\(\dfrac{\mathrm d}{\mathrm d x}(e^x\sin x)=\sqrt2\,e^x\sin\left(x+\dfrac{\pi}{4}\right)=2^{1/2}e^x\sin\left(x+\dfrac{\pi}{4}\right).\)
Thus \(H_1\) is true.
Inductive step. Assume \(H_k\) is true for some positive integer \(k\), so
\(\dfrac{\mathrm d^{k}}{\mathrm d x^{k}}\left(e^x\sin x\right)=2^{k/2}e^x\sin\left(x+\dfrac{k\pi}{4}\right).\)
Differentiate both sides with respect to \(x\):
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}\left(e^x\sin x\right)=2^{k/2}e^x\sin\left(x+\dfrac{k\pi}{4}\right)+2^{k/2}e^x\cos\left(x+\dfrac{k\pi}{4}\right).\)
Factor out \(2^{(k+1)/2}e^x\):
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}\left(e^x\sin x\right)=2^{(k+1)/2}e^x\left(\dfrac{1}{\sqrt2}\sin\left(x+\dfrac{k\pi}{4}\right)+\dfrac{1}{\sqrt2}\cos\left(x+\dfrac{k\pi}{4}\right)\right).\)
Use the identity \(\sin A\cos\dfrac{\pi}{4}+\cos A\sin\dfrac{\pi}{4}=\sin\left(A+\dfrac{\pi}{4}\right)\), with \(A=x+\dfrac{k\pi}{4}\). Since \(\cos\dfrac{\pi}{4}=\sin\dfrac{\pi}{4}=\dfrac{1}{\sqrt2}\), the bracket becomes
\(\sin\left(x+\dfrac{k\pi}{4}+\dfrac{\pi}{4}\right)=\sin\left(x+\dfrac{(k+1)\pi}{4}\right).\)
Therefore
\(\dfrac{\mathrm d^{k+1}}{\mathrm d x^{k+1}}\left(e^x\sin x\right)=2^{(k+1)/2}e^x\sin\left(x+\dfrac{(k+1)\pi}{4}\right),\)
which is \(H_{k+1}\).
Since \(H_1\) is true and \(H_k\Rightarrow H_{k+1}\), the result follows by mathematical induction for all positive integers \(n\).