Let's tackle your second quadratic form. Start by choosing one of the variables which appears as a square (if there isn't such a variable, you can always make a change of variables to get one). Let's start with $y$. This variable appears only with $x,y$ so we should try and complete the square to get all the terms that occur. In our case,
$$ 3x^2 + 2xy - 3xz + y^2 = (y + x)^2 + 2x^2 - 3xz. $$
This way, we have eliminated $y$ from the problem and now we handle only $2x^2 - 3xz$ in which $y$ doesn't appear and repeat the process. Then
$$ 2x^2 - 3xz = \left( \sqrt{2}x - \frac{3}{2\sqrt{2}}z \right)^2 - \frac{9}{8}z^2$$
so the final answer can be
$$ q(x,y,z) = (y + x)^2 + \left( \sqrt{2}x - \frac{3}{2\sqrt{2}}z \right)^2 - \frac{9}{8}z^2.$$
If we would have started with $x$, the process would look like this:
$$ q(x,y,z) = 3x^2 + 2xy - 3xz + y^2 = \left( \sqrt{3}x + \frac{1}{\sqrt{3}}y - \frac{\sqrt{3}}{2}z \right)^2 + \frac{2}{3}y^2 - \frac{3}{4}z^2.$$
Best Answer
$x A x'$ does not make sense unless $A$ is a $1 \times 1$ matrix, in which case the problem reduces to computing $E[xx'] = (E[x_i x_j])_{i,j=1}^n = C + E[x] E[x']$ where $C = (\text{Cov}(x_i, x_j))_{i,j=1}^n$ is the covariance matrix of $x$.