# Best way to solve for the unknowns, gaussian numerical integration

I'm a computer science grad student, so forgive me for being a little rusty on my math here. I'm working with Gaussian numerical Integration.I know how to find everything, I just wanted to know the best way to solve for the unknowns of the form:

a = w1+w2

b = w1X1+w2

c = w1X1^2+w2

I've already found the solution using elimination and substitution, but it seems intuitive that this could be solved more easily. What would be the best way to solve for the unknowns when a, b, and c are given?

-
Are the $w$'s your unknowns or the $X$'s? – Mitch May 11 '11 at 16:47
Odd, I'd have thought the second equation would be something like $b=w_1 X_1+w_2 X_2$ for generating a Gaussian quadrature. Anyway, see this. – J. M. May 11 '11 at 17:30

Since all equations have $w_2$ in them, it makes sense to transform to the differences:
$$\begin{eqnarray} b-a&=&w_1(X_1-1)\;,\\ c-a&=&w_1(X_1^2-1)\;. \end{eqnarray}$$
Now you can use the fact that $X_1^2-1$ contains $X_1-1$ as a factor by dividing the two equations:
$$\frac{c-a}{b-a}=X_1+1\;.$$
That gives you $X_1$, and the others follow by subtitution into $b-a=w_1(X_1-1)$ and then into $a=w_1+w_2$.