How do I find an orthogonal polynomial for the Gaussian quadrature when the weight function is $x$?
In particular, I need to find $w_0,w_1,x_0, x_1$ such that $$\int_0^1xf(x)dx \approx w_0f(x_0)+w_1f(x_1) $$ is exact when $f \in \mathcal{P}_3$.
Which polynomials can I use to find the abscissae $x_0$ and $x_1$?
You can construct monic orthogonal polynomials using Gram-Schmidt. We can take the first one $p_0(x)$ equal to $1$. We then subtract from the function $g_1(x) = x$ the component in the direction of $p_0(x)$ leaving us with a function that is orthogonal to $p_0(x)$. If we call this function $q_1(x)$, then we have:
$$p_1(x) = g_1(x) - \frac{\left<g_1,p_0\right>}{\left<p_0,p_0\right>} p_0(x) = x - 2\int_0^{1}x^2 dx = x - \frac{2}{3}$$
Then the next polynomial is of second degree, we can find it by starting with $g_2(x) = x^2$ and subtracting the projection on the subspace spanned by $p_0(x)$ and $p_1(x)$:
$$ \begin{split} p_2(x) &= g_2(x) - \frac{\left<g_2,p_0\right>}{\left<p_0,p_0\right>} p_0(x)-\frac{\left<g_2,p_1\right>}{\left<p_1,p_1\right>} p_1(x)\\ & = x^2 - 2\int_0^{1}x^3 dx - 36 \left(x-\frac{2}{3}\right)\int_0^1 x^3 \left(x-\frac{2}{3}\right)dx\\ & = x^2 - \frac{6}{5} x +\frac{3}{10} \end{split} $$
The abscissae are the zeros of $p_2(x)$, the weights are given by this formula.