Numerical partial derivative of an inverse function

222 Views Asked by At

We have a function whose inverse cannot be written in analytical form, such as:

$$f(x)=kx^3+x$$

How to find $\frac{\partial}{\partial k}f^{-1}$ ?

$f^{-1}(y)$ for a given $y$ can be easily found numerically using e.g. Newton iteration.

Is there a more precise way than using numerical derivative with values of $f^{-1}$ that are already computed numerically?

3

There are 3 best solutions below

0
On BEST ANSWER

We have three variables $x,y,k$ that are allowed to vary subject to the constraint

$$\begin{equation}\tag{1}y=kx^3+x.\end{equation}$$

Since $y=f(x)$, the quantity $\frac{\partial f}{\partial k}$ tells you how $y$ responds to small changes in $k$ when $x$ is held constant. Similarly, since $x=f^{-1}(y)$, we can think of $\frac{\partial}{\partial k}f^{-1}$ as "how $x$ responds to small changes in $k$ when $y$ is held constant". So you want to treat $y$ as a constant and find $\frac{dx}{dk}$.

Differentiating (1) with respect to $k$ gives

$$\frac{dy}{dk} = x^3+3kx^2 \frac{dx}{dk} + \frac{dx}{dk}.$$

Use $\frac{dy}{dk}=0$ (because we're holding $y$ constant) and rearrange to obtain

$$\frac{dx}{dk}=\frac{-x^3}{1+3kx^2}.$$

That is,

$$\frac{\partial}{\partial k}f^{-1}(y)=\frac{-f^{-1}(y)^3}{1+3kf^{-1}(y)^2}.$$

0
On

We are in a lucky case in which $f^{-1}$ can be computed through the Lagrange inversion formula:

$$\begin{eqnarray*} f^{-1}(x) &=& \sum_{n\geq 1}\frac{x^n}{n!}\cdot\left.\frac{d^{n-1}}{dw^{n-1}}\left(\frac{1}{1+kw^2}\right)^n\right|_{w=0}\\&=&\sum_{h\geq 0}\frac{x^{2h+1}}{(2h+1)!}\cdot\left.\frac{d^{2h}}{dw^{2h}}\left(\frac{1}{1+kw^2}\right)^{2h+1}\right|_{w=0}\\&=&\sum_{h\geq 0}\frac{x^{2h+1}}{2h+1}\cdot\binom{3h}{h}k^h(-1)^h\end{eqnarray*} $$ hence:

$$ \frac{\partial}{\partial k}\; f^{-1}(x) = \sum_{h\geq 1}\binom{3h}{h-1} k^{h-1}(-1)^h x^{2h+1}.$$

Also consider that, if we set $g=f^{-1}$, we have $f(g(x))=x$, so differentiation wrt $x$ leads to: $$ g'(kx^3+x) = \frac{1}{3kx^2+1},\qquad g'(x)=\frac{1}{3k g(x)^2+1}. $$

0
On

It's very simple: You have an equation of the form $$\Phi(x,y,k)=0\ ,\tag{1}$$ such as $$\Phi(x,y,k):=kx^3+x-y=0\ ,\tag{2}$$ and are given a "working point" ${\bf p}=(x_0,y_0,k_0)$ satisfying this equation. Under "suitable technical assumptions" the implicit function theorem guarantees you a function $$g:\quad(y,k)\mapsto x:=g(y,k)\ ,$$ defined in a neighborhood of $(y_0,k_0)$, such that $g(y_0,k_0)=x_0$, and in a neighborhood of ${\bf p}$ the equation $(1)$ is equivalent with $x=g(y,k)$. This $g$ is the $f^{-1}$ in your question. In particular one has $$\Phi\bigl(g(y,k),y,k\bigr)\equiv0\ .\tag{3}$$ In order to compute ${\partial g\over\partial k}\biggr|_{(y_0,k_0)}$ differentiate $(3)$ partially with respect to $k$ and obtain $$\Phi_x\bigl(g(y,k),y,k\bigr)\cdot g_k(y,k)+\Phi_k\bigl(g(y,k),y,k)\cdot 1\equiv0\ .$$ If you now put $(y,k):=(y_0,k_0)$ here you get $${\partial g\over\partial k}\biggr|_{(y_0,k_0)}=-{\Phi_k(x_0,y_0,k_0)\over\Phi_x(x_0,y_0,k_0)}\ .$$ For the special $\Phi$ in $(2)$ you then obtain $${\partial g\over\partial k}\biggr|_{(y_0,k_0)}=-{x_0^3\over 1+3k_0x_0^2}\ .$$