# How can I obtain the matrices of coefficients of quadratic form?

I'm trying to find the matrices of coefficients of a quadratic form:

Clear["Global`*"]

x[1] = CDF[NormalDistribution[\[Mu], \[Sigma]], c];
x[2] = Expectation[x^2 \[Conditioned] x > c,
x \[Distributed] NormalDistribution[\[Mu], \[Sigma]]];
x[3] = 1 - CDF[NormalDistribution[\[Mu], \[Sigma]], c];

m = Table[a[i, j], {i, 1, 3}, {j, 1, 3}]
n = Table[b[i], {i, 1, 3}]

vars = Table[x[i], {i, 1, 3}]
fun[\[Mu]_, \[Sigma]_, c_, o_] =vars.m.vars + n.vars + o

Suppose that all I observe is the expression for $$\text{fun}$$. I want to express it in matrix form in order to easily perform sums with other similar quadratic expressions. That is, I want to find $$\{\tilde{m}, \tilde{n},\tilde{o}\}$$ such that $$\text{fun(μ,σ,c,o)} ≡ \text{vars}^{\prime} \tilde{m} \text{vars} +\text{vars}^{\prime} \tilde{n} + \tilde{o}$$. My attempt using CoefficientArrays has not been successful:

{oo, nn,mm} =
Normal@CoefficientArrays[fun[\[Mu], \[Sigma], c, o], vars];

Any ideas on how to do that?

• Use Coefficient[fun[\[Mu], \[Sigma], c, o], #] & /@ vars Commented Jul 25, 2020 at 22:59
• How do I use the coefficients obtained in this way to find $\{\tilde{m}, \tilde{n},\tilde{o}\}$ such that $\text{fun(μ,σ,c,o)} ≡ \text{vars}^{\prime} \tilde{m} \text{vars} +\text{vars}^{\prime} \tilde{n} + \tilde{o}$? I suppose the question wasn't clear enough, so I edited (my fault) Commented Jul 26, 2020 at 11:45
• Please explain why the above doesn't work ? Just put: {oo, nn,mm} = ... at the front. Commented Jul 26, 2020 at 11:50
• I was expecting one of those 3 terms to be equal to $o$, or that vars.mm.vars + nn.vars + oo == fun[\[Mu], \[Sigma], c, o] // Simplify would output "true". There is something that still escapes me... Commented Jul 26, 2020 at 13:20