# Closed form for $\frac{d^n}{dx^n} \frac{d^m}{dy^m} \cos(x-y)$

is here a closed form expression for the derivative $$\frac{d^n}{dx^n} \frac{d^m}{dy^m} \cos(x-y)?$$ I know that the derivative of $\cos$ is $\sin$ but this iterative differentiation confuses me quite a bit.

\begin{align*} \frac{d^m}{dx^m}\frac{d^n}{dy^n} \cos(x-y) &= {\text { Real part of }}\frac{d^m}{dx^m}\frac{d^n}{dy^n} e^{i(x-y)} \\ &= {\text { Real part of }} i^m e^{ix} (-i)^n e^{-iy} \\ &= {\text { Real part of }} i^{m-n}e^{i(x-y)} \end{align*}

Hint: I'll assume that you mean $\frac{d^n}{dx^n} \frac{d^m}{dy^m} cos(x-y)$. Notice that you can differentiate first in $y$, then in $x$, i.e.

$\frac{d^n}{dx^n} \frac{d^m}{dy^m} cos(x-y)$ = $\frac{d^n}{dx^n}[ \frac{d^m}{dy^m} cos(x-y)]$

Edit: To find $\frac{d^m}{dy^m}(cos(x-y))$, notice that it cycles every four derivatives. Namely,

$\frac{d}{dy} cos(x-y) = sin(x-y)$

$\frac{d^2}{dy^2} cos(x-y) = - cos(x-y)$

$\frac{d^3}{dy^3} cos(x-y) = - sin (x-y)$

$\frac{d^4}{dy^4} cos(x-y) = + cos(x-y)$

$\frac{d^5}{dy^5} cos(x-y) = + sin(x-y)$ etc.

• Note that you can compress the derivative formulas into one via $\frac{d^n}{dx^n}\cos(x)=\cos(x+n\frac{\pi}{2})$. – Lutz Lehmann Sep 24 '16 at 6:35