A vector function of a scalar argument is a function that takes a scalar as input and produces a vector as output. The derivative of a vector function with respect to a scalar is computed element-wise. For a vector function $\mathbf{f}(x) = [f_1(x), f_2(x), …, f_n(x)]^T$, the derivative is given by:
$$\frac{d\mathbf{f}}{dx} = \left[\frac{df_1}{dx}, \frac{df_2}{dx}, …, \frac{df_n}{dx}\right]^T$$
import numpy as np
def vector_function(x):
return np.array([x, x**2, x**3])
x = 2
print(f"f({x}) = {vector_function(x)}")