# Chain Rule and Vector valued functions?

Let $f: R^n \to R$ be given by $f(x) = \frac{||x||^4} {1 + ||x||^2}$ . Use the chain rule to show that $f$ is differentiable at each $x \in R^n$ and compute $Df(x)$.

This vector valued stuff just came out of nowhere. It's not in our book and we went through it super fast... so I, and many others, are completely lost. From what I can guess, each $x$ is a vector of length "n", and $||x||$ is supposed to be the norm... Since the question doesn't specify, I'm assuming it's the standard euclidean norm. Also, $D$ must be an n*n matrix of partial derivatives? Assuming all of that is correct, I've been sitting trying to figure out how to make use of the chain rule, but I've got nothing :/

• This is a multivariable function. A vector-valued function is a function whose codomain is some $\mathbb{R}^n$. Commented May 1, 2016 at 1:46
• @Giovanni oops! thanks, I'm still trying to get used to the new terminology. Commented May 1, 2016 at 4:30

Let's recap some things: For general $f=(f_1,\ldots,f_m):U\subseteq\mathbb{R}^n\to\mathbb{R}^m$ (where $U$, the domain of $f$, is open in $\mathbb{R}^n$) and $x\in U$, $Df(x)$ is the Jacobian (or rather the linear transformation associated to it), given by $$Df(x)=\left[\frac{\partial f_i}{\partial x_j}(x)\right]_{\substack{i=1,\ldots,m\\j=1,\ldots,n}}$$ (wherever this makes sense). From this definition, the following are obvious:

• When $m=1$, $Df(x)$ is simply a row, and in fact it is equal to $\nabla f(x)$, the gradient of $f$ at $x$.

• When $n=1$, $Df(x)$ is a column, where each entry is simply the derivative of $f_j$ at $x$.

• When $m=n=1$, $Df(x)$ is a number, equal to $f'(x)$.

Now recall the Chain Rule:

For $f:U\subseteq \mathbb{R}^n\to V\subseteq\mathbb{R}^m$ and $g:V\subseteq\mathbb{R}^m\to\mathbb{R}^p$, $$D(g\circ f)(x)=Dg(f(x))Df(x),$$ where the RHS is simply product of matrices.

Now to your problem: to use the chain rule, you have to see $f$ as a composition of two simpler functions, which are differentiable everywhere. If we put $h:\mathbb{R}^n\to(0,\infty)$ as $h(x)=\Vert x\Vert^2$, and $k:(0,\infty)\to\mathbb{R}$ by $k(t)=\frac{t^2}{1+t}$, we have $f=k\circ h$, and it is easier to calculate $Dh$ and $Dk=k'$.

I'll leave the details to you, but here's what you should get: For $x=(x_1,\ldots,x_n)$, use the definition of $Dh(x)$ to find $Dh(x)=2[x_1\ x_2\cdots x_n]$.

For $k$, one-variable calculus gives $k'(t)=\frac{t^2+2t}{(1+t)^2}$.

By the chain rule, $$Df(x_1,\ldots,x_n)=2\frac{(\Vert x\Vert^4+2\Vert x\Vert^2)}{(1+\Vert x\Vert^2)^2}[x_1\cdots x_n]$$

• Really helpful! It's much more clear to me now :D One thing though, when you defined k(t), shouldn't the "t" in the denominator be raised to the 1st power only so that the composition of h and k returns the original function in the problem? And wouldn't that mean that k(t) would then not be differentiable at t= -1 Commented May 1, 2016 at 4:29
• @amazonprime Oops. You are right. In this case $k(t)$ is not differentiable at $t=-1$. I stated everything for functions defined on all of $\mathbb{R}^n$, but this in fact is true for functions defined on open sets. Since $h$ only takes positive values, we consider $k(t):(0,\infty)\to\mathbb{R}$, and then $k$ is differentiable on all of its domain. I will correct the answer accordingly. Commented May 1, 2016 at 5:27

I assume that you are working with the euclidean norm. You are right that these are length n (1 by n or n by 1 depending on convention) vectors. So we have by definition of the norm

$f(x)=\frac{||x||^4}{1+||x||^2}=\frac{\sqrt{(x_{1}^{2}+x_{2}^{2}+....+x_{n}^{2})}^4}{1+\sqrt{(x_{1}^{2}+x_{2}^{2}+....+x_{n}^{2})}^2}= \frac{(x_{1}^{2}+x_{2}^{2}+....+x_{n}^{2})^2}{1+(x_{1}^{2}+x_{2}^{2}+....+x_{n}^{2})}$

Just reducing exponents. Can you take it from here using the chain rule?

• $n$ by $n$ vectors? Commented May 1, 2016 at 4:26
• oops missed that! thanks Commented May 1, 2016 at 4:43