I was playing around with some Generalized Trigonometric Functions defined as follows;
w[n_] := E^((2*\[Pi]*I)/n)
Ncos[n_, x_] := Expand[(1/n)*Sum[E^(x*w[2 n]^(2 k + 1)), {k, 0, n - 1}]]
Nsin[n_, j_, x_] := Expand[(1/(n*w[2 n]^j))*Sum[w[n]^(-j*k) E^(x*w[2 n]^(2 k + 1)), {k, 0, n - 1}]]
These functions act like the familiar trigonometric functions and have the property that
$$\frac{d^{2n}}{dx^{2n}}f(x)=f(x)$$ or $$f^{(n)}(x)+f(x)=0$$
As I was testing with paper and pencil I wrote up the above functions when I got home to my computer and observed that these relations hold. However, when I employ the derivative function $D$ in Mathematica, it will give the derivative in terms of the expanded function. For example, if I type in
D[Ncos[3,x],x]
It returns $$-\frac{e^{-x}}{3}+\frac{1}{3}e^{{\frac{-i\pi}{3}-e^{\frac{-i\pi}{3}}}x}+\frac{1}{3}e^{{\frac{i\pi}{3}-e^{\frac{i\pi}{3}}}x}$$
The derivative should equal -Nsin[3,2,x], and when you input
-Nsin[3,2,x]
it returns
$$-\frac{e^{-x}}{3}-\frac{1}{3}e^{{\frac{-4i\pi}{3}-e^{\frac{-i\pi}{3}}}x}-\frac{1}{3}e^{{\frac{-2i\pi}{3}-e^{\frac{i\pi}{3}}}x}$$
While Mathematica doesn't output the same form, subtracting the two yields 0, proving their equality...
My question is this. Is there a way to get mathematica, when I input
D[Ncos[3,x],x]
to output
-Nsin[3,2,x]
Or for other derivative, for example, if I input
D[D[D[Ncos[3,x],x],x],x]
I would like to see
-Ncos[3,x]
Is this possible?
-Nsin[3, 2, x]
(your result seems to be missing a few $x$ here and there) or forD[Ncos[3, x]]
(your result seems to contain a $(-1)^{1/3}$ factor in two terms that I cannot reproduce. Not only that, but if I runD[Ncos[3, x]] - (-Nsin[3, 2, x]) // FullSimplify
I do NOT obtain zero, no matter what I try for simplification. $\endgroup$