Answer: For every positive integer \(n\), \(\dfrac{\mathrm d^{2n-1}}{\mathrm d x^{2n-1}}(x\sin x)=(-1)^{n-1}\bigl(x\cos x+(2n-1)\sin x\bigr)\).
We prove the result by mathematical induction.
Base case: Let \(n=1\). Then \(2n-1=1\), and, using the product rule,
\(\dfrac{\mathrm d}{\mathrm dx}(x\sin x)=x\cos x+\sin x\).
The right hand side of the proposed formula is
\((-1)^0\bigl(x\cos x+(2(1)-1)\sin x\bigr)=x\cos x+\sin x\).
So the formula is true for \(n=1\).
Inductive step: Assume that the formula is true for some positive integer \(k\). That is, assume
\(\dfrac{\mathrm d^{2k-1}}{\mathrm d x^{2k-1}}(x\sin x)=(-1)^{k-1}\bigl(x\cos x+(2k-1)\sin x\bigr)\).
Differentiate both sides once:
\(\dfrac{\mathrm d^{2k}}{\mathrm d x^{2k}}(x\sin x)=(-1)^{k-1}\dfrac{\mathrm d}{\mathrm dx}\bigl(x\cos x+(2k-1)\sin x\bigr)\).
Now \(\dfrac{\mathrm d}{\mathrm dx}(x\cos x)=\cos x-x\sin x\), and \(\dfrac{\mathrm d}{\mathrm dx}((2k-1)\sin x)=(2k-1)\cos x\). Hence
\(\dfrac{\mathrm d^{2k}}{\mathrm d x^{2k}}(x\sin x)=(-1)^{k-1}\bigl(-x\sin x+2k\cos x\bigr)\).
Differentiate once more:
\(\dfrac{\mathrm d^{2k+1}}{\mathrm d x^{2k+1}}(x\sin x)=(-1)^{k-1}\dfrac{\mathrm d}{\mathrm dx}\bigl(-x\sin x+2k\cos x\bigr)\).
Since \(\dfrac{\mathrm d}{\mathrm dx}(-x\sin x)=-\sin x-x\cos x\), and \(\dfrac{\mathrm d}{\mathrm dx}(2k\cos x)=-2k\sin x\), we get
\(\dfrac{\mathrm d^{2k+1}}{\mathrm d x^{2k+1}}(x\sin x)=(-1)^{k-1}\bigl(-x\cos x-(2k+1)\sin x\bigr)\).
Therefore
\(\dfrac{\mathrm d^{2k+1}}{\mathrm d x^{2k+1}}(x\sin x)=(-1)^k\bigl(x\cos x+(2k+1)\sin x\bigr)\).
But this is exactly the required formula with \(n=k+1\), since \(2(k+1)-1=2k+1\).
Thus, if the formula is true for \(n=k\), it is true for \(n=k+1\). Since it is true for \(n=1\), it follows by induction that it is true for every positive integer \(n\).