Let $f:\Bbb{R}^n\to\Bbb{R}$ be a function defined by
$$f(x) = \langle x, a \rangle e^{-\langle x, x\rangle}$$
$\forall x \in \Bbb{R}^n, \ a \in \Bbb{R}^{n}$.
Questions: I want to
- Prove that $f$ is of class $C^{1}$
- Compute $f'(x)$ for any $x\in\Bbb{R}^n$
I started by using definition:
Let $x, a, h \in\Bbb{R}^{n}$, then
\begin{align} f(x+h)-f(x) &= \langle x + h, a \rangle e^{-\langle x+h, x+h \rangle} - \langle x, a\rangle e^{-\langle x, x \rangle} \\ &= \left[ \langle x, a \rangle + \langle h, a \rangle \right] e^{-\langle x, x \rangle - \langle x, h \rangle - \langle h, x \rangle - \langle h, h \rangle} - \langle x, a \rangle e^{-\langle x, x \rangle} \end{align}
But I don't know how to proceed from here. Please, could anyone help out?
$\newcommand{\<}{\langle}\newcommand{\>}{\rangle}$I think you want to show differentiability using the definition, right? What is the definition of differentiability? $f$ is said to be differentiable in $x$, if there exists $L(x)$ such that as $h\to 0$: \begin{align}\tag{1} f(x+h)=f(x)+\<L(x), h\>+o(h) \end{align} Moreover if such $L$ exists then $\nabla f(x)=L(x)$.
First notice that: \begin{align}e^{-\<x+h,x+h \>}&=e^{-\<x,x\>-2\<x,h\>-\<h,h \>}\\ &=e^{-\<x,x\>}\left( e^{-2\<x,h\>-\<h,h \>}\right)\\ &\stackrel{*}{=}e^{-\<x,x\>}\left(1-2\<x,h\>-\<h,h \>+o(h)\right)\\ &=e^{-\<x,x\>}-2\<x,h\>e^{-\<x,x\>}+o(h) \end{align} where we have used the power series of the exponential function in $(*)$ which will be proven at the end. This means that:
\begin{align} f(x+h)&=\<x+h,a\>e^{-\<x+h,x+h \>}\\&=\<x+h,a\>\left(e^{-\<x,x\>}-2\<x,h\>e^{-\<x,x\>}+o(h)\right)\\ &=\left(\<x,a\>+\<h,a\>\right)\left(e^{-\<x,x\>}-2\<x,h\>e^{-\<x,x\>}+o(h)\right)\\ &=\<x,a\>e^{-\<x,x\>}-2\<x,a\>\<x,h\>e^{-\<x,x\>}+\<h,a\>e^{-\<x,x\>}+o(h)\\ &=f(x)+e^{-\<x,x\>}\left( \< h,a\>-2\<x,a\>\<x,h\>\right)+o(h)\\ &=f(x)+ \< h,\left(a-2\<x,a\>x\right)e^{-\<x,x\>}\>+o(h)\\ \end{align} Comparing what we have now with $(1)$ it is clear that $L(x)$ exists, hence: \begin{align} \nabla f(x)=\left(a-2\<x,a\>x\right)e^{-\<x,x\>} \end{align} Using a similar method, you can show that $\nabla f(x+h)\to\nabla f(x)$ as $h\to 0$ to conclude that $\nabla f$ is continuous... Or you could also check if $\nabla f(x)$ is continuous componentwise (because that implies continuity of $\nabla f$ as well). I leave that up to you.
Proof of ($*$).
\begin{align} e^{-2\<x,h\>-\<h,h\>} = \sum_{k=0}^\infty \frac{(-2\<x,h\>-\<h,h\>)^k}{k!}=1-2\<x,h\>-\<h,h\>+\sum_{k=2}^\infty \frac{(-2\<x,h\>-\<h,h\>)^k}{k!} \end{align} Let $h\in \bar B_1(0)$ i.e. the closed unit ball. Then of course the map $$h\mapsto -2\<x,h\>-\<h,h\>$$ is bounded (why?). That means that \begin{align} \sum_{k=2}^\infty \frac{(-2\<x,h\>-\<h,h\>)^k}{k!} \end{align} converges uniformly for $h\in \bar B_1(0)$. So you can prove that: \begin{align} \lim_{h\to 0 } \frac{\sum_{k=2}^\infty \frac{(-2\<x,h\>-\<h,h\>)^k}{k!}}{\Vert h\Vert} =\sum_{k=2}^\infty \lim_{h\to 0 }\frac{(-2\<x,h\>-\<h,h\>)^k}{\Vert h\Vert k!}= 0 \end{align} to conclude: \begin{align} \sum_{k=2}^\infty \frac{(-2\<x,h\>-\<h,h\>)^k}{k!}= o(h) \end{align}