I am trying to differentiate the function:
$$g(x) = f(3\vec k + x(\vec l + \vec k))$$
where $\vec k$ and $\vec l$ are in $\mathbb R^n$ and $x$ is in $\mathbb R$.
I think I need to use the chain rule but I am unsure if that is right; my answer at the moment is:
$$g\prime(x) = (\vec l + \vec k)f(3\vec k + x(\vec l + \vec k))$$
However because $\vec l$ and $\vec k$ are vectors in $\mathbb R^n$ I am not sure how this would affect it.
If you have a function $f:\Bbb R^n\to \Bbb R$, then you need to study the gradient $$\nabla f(x) = \begin{pmatrix}\partial_{x_1}f(x)\\\partial_{x_2}f(x)\\\vdots\\\partial_{x_n}f(x)\end{pmatrix}$$
Therefore, for exmaple
$$\frac{d}{dt}f(\vec a+t\vec x) = \nabla f(\vec a+t\vec x)\cdot \frac{d}{dt}(\vec a+t\vec x) = \nabla f(\vec a+t\vec x)\cdot \vec x.$$
Do you see how to apply it to your problem?