Partial derivative of a special function

50 Views Asked by At

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}}}$$

1

There are 1 best solutions below

0
On BEST ANSWER

Because your problem has not been specified fully, any answer will have to make a number of assumptions.

Let us assume that:

  1. $f(x)$ is a real-valued function that takes $\mathbb{R}^n$ to $\mathbb{R}^n$.
  2. $x$ and $y$ are $1\times n$ matrices such that $y^T x$ is $1\times 1$.
  3. Define $\omega := w_1 - w_2$. There is no general definition of the exponential of a vector unless you mean a term-by-term exponential. However, of $\omega$ is a square matrix you can define exponentiation using the concept of a power series which means that your matrix should be such that you are able to add powers. Let us assume that $\omega$ is $n\times n$ matrix which implies that $1$ is also a $n \times n$ matrix.

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.