<s>[INST] if $ A \in R^{n \times n}$ , $A > 0$ and $ b \in R^n$ then the function $\frac{1}{2}\langle Ax,x\rangle - \langle b,x\rangle$ is convex in $R^n$ Show by direct estimates that if $ A \in R^{n \times n}$ , $A > 0$ and $ b \in R^n$ then the function
$$\frac{1}{2}\langle Ax,x\rangle - \langle b,x\rangle$$  with $x$  is convex on $R^n$.
My approach: A function $g : i \rightarrow R$ is said to be convex if $g(tx + (1-t)y) \le tg(x) + (1-t)g(y)$, $\forall x,y$ in $i$, and $0 \le t \le 1$
Hence, $g(x) = \frac{1}{2}\langle Ax,x\rangle - \langle b,x\rangle$ with $x$, $\Rightarrow g(tx + (1-t)y) = \frac{1}{2}\langle A[(tx+(1-t)y)], tx + (1-t)y\rangle - \langle b, tx + (1-t)y\rangle$.
From here I got stuck expanding the term, any help is highly appreciated.
 [/INST] Since you're not comfortable showing $f(x) = x^2$ is convex, let's begin with that. Naturally, you can prove this by showing that $f''(x) \ge 0$ for all $x$, but we want to prove it by definition.
Suppose $x, y \in \Bbb{R}$ and $\lambda \in [0, 1]$. Then
\begin{align*}
&\lambda f(x) + (1 - \lambda) f(y) - f(\lambda x + (1 - \lambda)y) \\
= \; &\lambda x^2 + (1 - \lambda)y^2 - (\lambda x + (1 - \lambda)y)^2 \\
= \; &\lambda x^2 + (1 - \lambda)y^2 - \lambda^2 x^2 - 2\lambda x(1 - \lambda) y - (1 - \lambda)^2 y^2 \\
= \; &\lambda(1 - \lambda)x^2 + \lambda(1 - \lambda)y^2 - 2\lambda(1 - \lambda)xy \\
= \; &\lambda(1 - \lambda)(x^2 - 2xy + y^2) \\
= \; &\lambda(1 - \lambda)(x - y)^2 \ge 0.
\end{align*}
Thus,
$$\lambda f(x) + (1 - \lambda) f(y) \ge f(\lambda x + (1 - \lambda)y),$$
and $f$ is convex.
Now, suppose $x, y \in \Bbb{R}^n$ and $\lambda \in [0, 1]$. By linearity of $\sqrt{A}$, triangle inequality, and positive scalar homogeneity of the norm respectively,
\begin{align*}
\|\sqrt{A}(\lambda x + (1 - \lambda)y)\| &= \|\lambda \sqrt{A} x + (1 - \lambda) \sqrt{A} y\| \\
&\le \|\lambda \sqrt{A} x\| + \|(1 - \lambda) \sqrt{A} y\| \\
&= \lambda\|\sqrt{A} x\| + (1 - \lambda) \|\sqrt{A} y\|.
\end{align*}
Thus the map $x \mapsto \| \sqrt{A} x\|$ is also convex. Using this and the previous inequality,
\begin{align*}
&\lambda\|\sqrt{A} x\|^2 + (1 - \lambda)\|\sqrt{A} y\|^2 - \|\sqrt{A}(\lambda x + (1 - \lambda)y)\|^2 \\
\ge \; &\lambda\|\sqrt{A} x\|^2 + (1 - \lambda)\|\sqrt{A} y\|^2 - (\lambda\|\sqrt{A} x\| + (1 - \lambda)\|\sqrt{A} y\|)^2 \\
= \; &\lambda(1 - \lambda)(\|\sqrt{A} x\| - \|\sqrt{A} y\|)^2 \ge 0.
\end{align*}
Therefore, the map $x \mapsto \|\sqrt{A} x\|^2$ is convex, as required. Use the fact that
$$\|\sqrt{A} x\|^2 = \langle \sqrt{A} x, \sqrt{A} x\rangle = \langle\sqrt{A} \sqrt{A} x, x\rangle = \langle A x, x\rangle,$$
as $\sqrt{A}$ is positive and hence Hermitian.
</s>