There's function:
$$f = \frac{r^2}{(\vec{a}\cdot\vec{r})^2} = \frac{x^2+y^2+z^2}{(xa_x)^2+(ya_y)^2+ (za_z)^2}$$
am I right that it is possible to find derivative by direction this way:
$$\frac{df}{dl} = (\vec{\nabla}f,\vec{a})$$ and I have to multiply each component of $\vec{\nabla{f}}$ by $a_x$, $a_y$ and $a_z$ ?
for example I have
$$\frac{\partial{f}}{\partial{x}} = \frac{2x \cdot x^2+y^2+z^2 - x^2+y^2+z^2\cdot2xa_x}{[(xa_x)^2+(ya_y)^2+(za_z)^2]^2}$$
However it does not seem rational