cos(x)
d/dx(cos(x))=-sin(x)
d^2/dx^2(cos(x))=-cos(x)
d^3/dx^3(cos(x))=sin(x)
d^4/dx^4(cos(x))=cos(x)
So it seems that the derivatives of cos(x) repeat every four times.
So, the nth derivative of cos(x) should be
- cos(x) if n is divisible by 4
- -sin(x) if the remainder of n divided by 4 is 1
- -cos(x) if the remainder of n divided by 4 is 2
- sin(x) if the remainder of n divided by 4 is 3
In other words,
d^n/dx^n(cos(x))={(cos(x)\ \ \ \ \ \ \ "if"\ n\equiv0\ ("mod"\ 4)),(-sin(x)\ \ \ \ "if"\ n\equiv1\ ("mod"\ 4)),(-cos(x)\ \ \ \ "if"\ n\equiv2\ ("mod"\ 4)),(sin(x)\ \ \ \ \ \ \ \ "if"\ n\equiv3\ ("mod"\ 4)):}
It's possible to make the expression more compact, as
d^n/dx^n(cos(x))=1/2(i^n(1+(-1)^n)+i^(n+1)(1+(-1)^(n+1)))cos(x-(pi(1-(-1)^n))/4)
or
d^n/dx^n(cos(x))="Re"((1+i)i^n)cos(x-(pi(1-(-1)^n))/4)
or
d^n/dx^n(cos(x))=cos((pin)/2)cos(x)-sin((pin)/2)sin(x)
or
d^n/dx^n(cos(x))=cos(x+(pin)/2)
Then, the 125th derivative of cos(x), or d^125/dx^125(cos(x)), is -sin(x) since 125\equiv1\ ("mod"\ 4).