Final answer:
To compute the gradient and Hessian matrix of the Rosenbrock function f(x), we first need to find the first and second partial derivatives. The gradient is ∇f(x) = [ -400x₁(x₂-x₁²) - 2(1-x₁), 200(x₂ - x₁²) ], and the Hessian matrix is D²f(x) = [ [1200x₁² - 400x₂ + 2, -400x₁], [-400x₁, 200] ].
Step-by-step explanation:
To compute the gradient ∇f(x) and the Hessian matrix D²f(x) of the Rosenbrock function f(x)=100(x₂ − x₁²)² + (1 − x₁)², we follow these steps:
- First, we calculate the partial derivatives of f with respect to x₁ and x₂ to get the components of the gradient.
- Then, we find the second partial derivatives to construct the Hessian matrix.
The gradient of f is given by:
∇f(x) = [df/dx₁, df/dx₂]
The Hessian matrix is:
D²f(x) = [
[d²f/dx₁², d²f/(dx₁dx₂)],
[d²f/(dx₂dx₁), d²f/dx₂²]
]
After computing the partial derivatives, we get the gradient and Hessian matrix as follows:
∇f(x) = [ -400x₁(x₂-x₁²) - 2(1-x₁), 200(x₂ - x₁²) ]
And the Hessian matrix gets the form:
D²f(x) = [
[1200x₁² - 400x₂ + 2, -400x₁],
[-400x₁, 200]
]