# Calculate Hessian of a "weird" function

let be $$L$$ an invertible matrix, $$b in mathbb{R}^{n}$$ and $$mu in mathbb{R}$$

and $$J: mathbb{R}^{n} rightarrow mathbb{R}$$ defined as $$J(x)=|L x|_{2}^{2}+mu x^{t} x-b^{t} x$$

How do I calculate its hessian matrix?
I cant operate as a usual function and calculate its gradient and also i dont know what to do with that norm

Progress:

$$|L x|_{2}^{2} =sum_{i=1}^{n}sum_{j=1}^{n} (l_{i,j}cdot x_{j})^2$$

$$mu x^{t}cdot x =sum_{i=1}^{n} mu cdot x_{i}^2$$

$$-b^{t} x = – sum_{i=1}^{n} b_{i} cdot x_{i}$$

so $$J(x)=\sum_{i=1}^{n}sum_{j=1}^{n} (l_{i,j}cdot x_{j})^2+sum_{i=1}^{n} mu cdot x_{i}^2 – sum_{i=1}^{n} b_{i} cdot x_{i}$$

$$nabla J(x)=(sum_{i=1}^{n} l_{i,1} + 2 cdot mu cdot x_{1} – b_{1}, …, sum_{i=1}^{n} l_{i,n} + 2 cdot mu cdot x_{n} – b_{n} )$$

and the Hessian is the diagonal matrix of $$2 cdot mu$$

Dunno if it is right and I also think there has to be an easier way of doing it, like operating with the vectors and matrix instead of deriving each variable on their own.

FINAL EDIT:

As some comments sugested(thank you all) i can write the function as :
$$J(x)=x^tL^tLx + mu x^tx -b^tx$$

So:

$$nabla J(x)= 2(L^tL+Imu)x-b$$

and

$$HJ(x)=2LL^t+2 I mu$$

Mathematics Asked by Ben Schneider on November 12, 2021

Since the Hessian is the matrix of second partial derivatives $$frac{partial^2}{partial x_i partial x_j}$$, the linear term will vanish. You can rearrange the second order term to:

$$(Lx)^t(Lx) + mu x^tx = x^t(L^tL + mu I)x.$$

Each second derivative will then select one of the coefficients of this second-degree homogeneous polynomial. Can you see your way to the end of the computation from here?

As for thinking of this in terms of matrices, think first of the derivative. Every linear function can be written as $$p_1(x) = v^Tx$$ for some vector $$v$$. The gradient of a smooth function $$f$$ at a point is defined as this vector for the best linear approximation to $$f$$ at that point.

Every homogeneous second-degree polynomial $$p$$ can be written as $$p(x) = x^THx$$ for some symmetric matrix $$H$$. The Hessian of a smooth function $$f$$ at a point is defined as this matrix for the best second-order approximation to $$f$$ at that point.

So now you see the root of the strategy to isolate the second order term.

Answered by Neal on November 12, 2021

Hint When $$h to 0$$, we have $$begin{equation} J(x + h) = J(x) + text{linear terms} + |L h|_2^2 + mu h^t h end{equation}$$

Answered by Gribouillis on November 12, 2021

## Related Questions

### A question on linear maps itself

3  Asked on March 16, 2021 by popping900

### $f$ is convex and $f(10)$, $f(20)$ given. Find the smallest value of $f(7)$.

2  Asked on March 15, 2021 by jixubi

### Linearize product of Two Special Ordered Sets and minimize number of variables

1  Asked on March 13, 2021 by kamer73

### Given 6 distinct points in $3$-$D$ space, can the distances between $3$ of the points be determined if all other distances between points are known?

1  Asked on March 10, 2021 by apoapsis

### How to find the generators of a principal Ideal?

1  Asked on March 10, 2021 by ayoub-rossi

### How can I show the quotient of the $k$th partial sums of $sumlimits_{n=1}^{k} n$ and $sumlimits_{n=1}^{k} n^2$ is $frac{3}{2k+1}$?

2  Asked on March 8, 2021 by danoram

### Equation related to the curve $x^4+3kx^3+6x^2+5$

2  Asked on March 8, 2021

### $f$ is integrable & $int ^a _b f= beta iff forall epsilon >0 exists mathbb{P}$ partition such as $U(f,P)-epsilon < beta < L(f,P)+ epsilon$

1  Asked on March 7, 2021 by juju9708

### Let $S = {1,2,3,4}. X, Y in mathcal{P}(S)$ and R be a relation $R(X,Y): |X cap Y| = 1$. Is the relation R transitive?

1  Asked on March 6, 2021 by edohedo

### A presheaf can be seen as a contravariant functor

0  Asked on March 6, 2021 by rising_sea

### Prove that $int_0^b x^3 dx = frac{b^4}{4}$

0  Asked on March 6, 2021 by dansidorkin

### Doubts on the proof regarding uniform convergence on complex plane

0  Asked on March 5, 2021 by able20

### Connection between vector space isomorphisms and dimensions

1  Asked on March 5, 2021 by pedro-mariz

### Determine if $n$ could be represented by a quadratic form of discriminant $d$

1  Asked on March 4, 2021 by jibber032394

### Convergence of Bernoulli distribution using Central Limit Theorem

1  Asked on March 4, 2021 by big_golfuniformindia

### Example where an inverse function does not equal the elements

2  Asked on March 4, 2021 by mc5555

### $int frac{(e^z)}{z-pi i} dz$, if C is the ellipse |z – 2| + |z+2| = 6

2  Asked on March 4, 2021 by dip

### Finding the volume of a region using spherical coordinates

0  Asked on March 3, 2021 by rmdnusr

### Derive Greens function 1D heat equation with space dependent material parameters

0  Asked on March 2, 2021

### Sketch the solid described by the given inequalities.

1  Asked on March 2, 2021 by 2316354654