Directional Derivative of a piecewise defined function Here is a problem and the solution to it.$\quad$ let $f: \mathbb{R}^{3} \rightarrow \mathbb{R}$ be a continuously differentiable function with:
$$
f(t, 2 t, 0)=e^{3 t}+1, \quad f(t,-t,-t)=2 \cos \left(t^{3}\right)+3 t, \quad f(0, t, 3 t)=\log \left(t^{2}+1\right)+2
$$
a) Compute the directional derivatives $D_{v} f(0,0,0)$ for $v_{1}=(1,2,0), v_{2}=(-1,1,1)$ and $v_{3}=(0,1,3)$.
b) Find $D f(0,0,0)$.
Solution:
a)  $f(0,0,0)=2 .$ We take the directional derivatives
$$
\begin{aligned}
&D_{(1,2,0)} f(0,0,0)=\lim _{t \rightarrow 0} \frac{f(t, 2 t, 0)-f(0,0,0)}{t}=\lim _{t \rightarrow 0} \frac{e^{3 t}+1-2}{t}=\lim _{t \rightarrow 0} 3 e^{3 t}=3 \\
&D_{(-1,1,1)} f(0,0,0)=\lim _{t \rightarrow 0} \frac{f(-t, t, t)-f(0,0,0)}{t}=\lim _{t \rightarrow 0} \frac{2 \cos \left(-t^{3}\right)-3 t-2}{t}=\lim _{t \rightarrow 0} 2 \sin \left(-t^{3}\right) 3 t^{2}-3=-3, \\
&D_{(0,1,3)} f(0,0,0)=\lim _{t \rightarrow 0} \frac{f(0, t, 3 t)-f(0,0,0)}{t}=\lim _{t \rightarrow 0} \frac{\log \left(t^{2}+1\right)+2-2}{t}=\lim _{t \rightarrow 0} \frac{2 t}{t^{2}+1}=0
\end{aligned}
$$
b) We can compute the directional derivatives the following way $D_{v} f(0,0,0)=D f(0,0,0) \cdot v$. By
$$
D f(0,0,0)=\left(\frac{\partial}{\partial x_{1}} f(0,0,0), \frac{\partial}{\partial x_{2}} f(0,0,0), \frac{\partial}{\partial x_{3}} f(0,0,0)\right)=:(a, b, c)
$$
we get the system of equation
$$
a+2 b=3 \quad \wedge \quad-a+b+c=-3 \quad \wedge \quad b+3 c=0
$$
so, $a=3$ und $b=c=0$. We conclude $D f(0,0,0)=(3,0,0)$.
My first question is: How can I (if possible) find an explicit form of the gradient such that I don't have to have a system of equations to find  $D f(x,y,z)$ usually regarding tasks about directional derivatives I just computed the partial derivatives to get the gradient, plugged in the point in question and made a dot product with the direction.
Second question: How do I (if possible at all) compute the directional derivative at a different point in the directions of the $v_{i=1,2,3}$ or even better in other directions?
is the following possible?
$$
\begin{aligned} &D_{(1,2,0)} f(5,4,3)=... \\
&D_{(-1,1,1)} f(5,4,3)=... \\
&D_{(0,1,3)} f(5,4,3)=...
\end{aligned}
$$
or
$$
\begin{aligned} &D_{(3,2,1)} f(5,4,3)=... \\
&D_{(-1,2,4)} f(5,4,3)=... \\
&D_{(0,-1,2)} f(5,4,3)=...
\end{aligned}
$$
My feeling was none of the two suggestions is possible, because the function is not defined at the point $(5,4,3)$ and the new randomly chosen $v_{i=4,5,6}$ in the second example?
I was also playing with the thought that any point could be decomposed into a linear combination of the original $v_{i=1,2,3}$ such that it'd be possible to take the directional derivative at any point? I could not find similar tasks to extrapolate some information from them, maybe someone knows how I could find similar examples - I didn't know what to google for to get similar tasks.
Thanks!
 A: 
My first question is: How can I (if possible) find an explicit form of the gradient

Without an explicit form of the function, it will not be always possible to calculate the gradient, especially not in an explicit form.
For example, the information you have about your function tells you nothing about what $f(t, 0, 2t)$ is equal to for any value $t\neq 0$. So finding the gradient at any point except $(0,0,0)$ is impossible.
This links on to your second question: You can only calculate the directional derivatives of $f$ at point $p_0$ in direction $v$ if you can calculate $f(p_0+t\cdot v)$ for all $t$ in some open interval containing $0$. Note that this implies that you must be able to calculate $f(p_0)$, since $p_0=p_0+0\cdot v$.
For your particular example, you cannot calculate $f(5,4,3)$, so you also cannot calculate the partial derivative at $(5,4,3)$.


I was also playing with the thought that any point could be decomposed into a linear combination of the original $v_{i=1,2,3}$ such that it'd be possible to take the directional derivative at any point?

That won't work, because you do not have any information on how the function reacts to linear combinations. In other words, even if you find $\alpha, \beta, \gamma$ such that $p_0=\alpha v_1 + \beta v_2 + \gamma v_3$, you cannot just say that
$$f(p_0)=f(\alpha v_1 + \beta v_2 + \gamma v_3)=\alpha f(v_1) + \beta f(v_2) + \gamma f(v_3)$$
because that relation only works in general on linear functions, and $f$ is not a linear function.
