I have a function $f(x)$ which I would like to have the derivative with respect to $x$. How can I get the derivative of the following function with respect to $x$ where $y, w_1, w_2$ is a vector of values.
$$f(x) = \frac{(xe^{y^{T}x} (w1-w2)({e^{w_1-w_2}})^{e^{y^{T}x}})}{1-({e^{w_1-w_2}})^{e^{y^{T}x}}}$$
Because your problem has not been specified fully, any answer will have to make a number of assumptions.
Let us assume that:
Also define $a := y^T x$, $b := \exp(a)$, and $W := \exp(\omega)$ where $a$ is $1\times 1$, $b$ is $1\times 1$, $\omega$ is $n \times n$, and $W$ is $n\times n$. Then the only way for your function to be valid is if you represent it as $$ f(x) = a\, \left(x\,\omega\,W^b\right)\,(1 - W^b)^{-1} \,. $$ Define $ C := (1 - W^b)$. Then, $$ f(x) = a\, x\,\omega\,W^b\,C^{-1} \,. $$ In index notation, with implied summation over repeated indices, $$ \left[f(x)\right]_m = a\,x_j\,\omega_{jk}\,W^b_{kl}\,C^{-1}_{lm} $$ The derivative can then be calculated term by term using standard methods (see here). To start off: $$ \frac{\partial f_m}{\partial x_n} = \frac{\partial a}{\partial x_n}\left(x_j\,\omega_{jk}\,W^b_{kl}\right)\,C^{-1}_{lm} + a\frac{\partial}{\partial x_n}\left[\left(x_j\,\omega_{jk}\,W^b_{kl}\right)\,C^{-1}_{lm}\right] $$ Repeated application of the chain rule will lead you to the solution.