# Convexity of quadratic form with respect to new set of parameters

I understand that the quadratic form, $$f(x) = x^TAx$$, is convex with respect to $$x$$ so long as the matrix $$A$$ is positive semi-definite.

If we assume that $$A$$ remains positive semi-definite, is the more general expression:

$$f(\theta) = x^T(\theta)Ax(\theta)$$

also convex with respect to the parameters $$\theta$$?

Is the answer an obvious yes or is there more to this that I am missing?

In this sense, the function $$f$$ is actually a composition function, i.e., $$f(\theta) = h(g(\theta))$$, where $$g(\theta) = x(\theta)\colon \mathbb{R}^n \to \mathbb{R}^k$$ and $$h(x) = x^TAx \colon \mathbb{R}^k \to \mathbb{R}$$. If we do not know any more information of function $$g$$, it is difficult to determine the convexity of $$f$$.
Here is a counterexample. Let $$k=n=2$$, $$g(\theta) = (\theta_1^2, -\theta_2^2)$$, and $$A = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}$$. Now the function $$$$f(\theta) = \theta_1^4 - 2\theta_1^2\theta_2^2 + \theta_2^4$$$$ is not convex.
• Great. Thank you for the response. Besides the obvious linear parameterization case, $x(\theta) = \sum_i c_i\theta_i$, would there be a simple way of knowing which cases admit convexity? Or does it simply boil down to a case-by-case basis requiring the calculation of the Hessian every time? – G Flash May 12 '20 at 14:54