I am trying to construct a formula of the form $\int_0^1 xf(x)dx=A_0f(x_0)+A_1f(x_1)$ with degree of precision 3.
A Gaussian Quadrature is the only interpolatory quadrature with degree of precision 2n+1 with $x_0,x_1,...,x_n$ being the nodes chosen that are also the $n+1$ zeros of the $(n+1)$th orthogonal polynomial.
Looking through similar questions, most recommend using the method of undetermined coefficients to find $x_0,x_1,A_0,$ and $A_1$ by using $f(x) = 1,x,x^2,$ and $x^3$. Does using the method of undetermined coefficients inherently give you nodes that are the $n+1$ zeros of the $(n+1)$th orthogonal polynomial?
For $w(x)=1$, we can use the Legendre orthogonal polynomials to get the nodes, but from what I could find online there doesn't exist such a thing for $w(x)=x$.
Given $x_0, x_1,$ with $0 < x_0 < x_1 < 1,$ we can write any linear polynomial as $$ f(x) = \frac{x - x_1}{x_0 - x_1}f(x_0) + \frac{x - x_0}{x_1 - x_0}f(x_1), $$ where $f(x_0)$ and $f(x_1)$ are arbitrary, so we must have \begin{align*} A_0 & = \int_0^1x\frac{x - x_1}{x_0 - x_1}\,dx = \frac{2 - 3x_1}{6(x_0 - x_1)}, \\ A_1 & = \int_0^1x\frac{x - x_0}{x_1 - x_0}\,dx = \frac{2 - 3x_0}{6(x_1 - x_0)}. \end{align*} Lagrange interpolation similarly gives the $A_i$ in terms of the $x_i$ for any weight function $w(x),$ and any number of points. There is also a general construction of the $x_i$ as the zeros of one of a series of polynomials $\phi_0, \phi_1, \phi_2, \ldots$ orthogonal with respect to an inner product and norm determined by $w(x).$ In this case, \begin{gather*} (f, g) = \int_0^1xf(x)g(x)\,dx, \\ \|f\| = \sqrt{(f, f)} = \sqrt{\int_0^1xf(x)^2\,dx}. \end{gather*} The general proof, for weight function $w(x)$ and $k+1$ points $x_0, x_1, \ldots, x_k,$ is short enough to give here. (See Theorem 12.3 in M. J. D. Powell, Approximation theory and methods, where the calculation for the case $w(x) = x,$ $k = 1$ is set as Exercise 12.2.) Any polynomial $f$ of degree $2k+1$ or less may be written as $p(x)\phi_{k+1}(x) + q(x),$ where $p, q$ are of degree $k$ or less. By orthogonality (functions are defined on $[a, b]$), $$ \int_a^bw(x)f(x)\,dx = \int_a^bw(x)q(x)\,dx. $$ If $x_0, x_1, \ldots, x_k$ are [the] zeros of $\phi_{k+1},$ then, for any weights $A_i,$ $$ \sum_{i=0}^kA_if(x_i) = \sum_{i=0}^kA_iq(x_i). $$ But by Lagrange interpolation, $$ \int_a^bw(x)q(x)\,dx = \sum_{i=0}^kA_iq(x_i), $$ where the weights $A_i$ are now given by $$ A_i = \int_a^bw(x)\bigg(\prod_{j\ne i}\frac{x-x_j}{x_i-x_j}\bigg)\,dx. $$ Therefore $$ \int_a^bw(x)f(x)\,dx = \sum_{i=0}^kA_if(x_i), $$ as required. $\square$
The problem now reduces to obtaining $\phi_0, \phi_1, \phi_2, \ldots$ by a Gram-Schmidt process, i.e. iteratively taking a polynomial of degree $j+1$ ($j = 0, 1, 2, \ldots$) and subtracting from it its projection onto the space of polynomials of degree $j$ or less. Instead of doing this with the polynomial $x^{j+1},$ we recursively use $x\phi_j(x).$ The proof is a little too long to give here, but the result is the recurrence relation \begin{gather*} \phi_0(x) = 1, \\ \phi_1(x) = x - \alpha_0, \\ \phi_{j+1}(x) = (x - \alpha_j)\phi_j(x) - \beta_j\phi_{j-1}(x) \quad (j \geqslant 1), \end{gather*} where \begin{gather*} \alpha_j = \frac{(\phi_j, x\phi_j)}{\|\phi_j\|^2} \quad (j \geqslant 0), \\ \beta_j = \frac{\|\phi_j\|^2}{\|\phi_{j-1}\|^2} \quad (j \geqslant 1). \end{gather*}
In the present case, with $w(x) = x,$ and $k = 1,$ we wish to find $\phi_2.$ Here is a summary of the calculation: \begin{gather*} \|\phi_0\|^2 = \int_0^1x\,dx = \frac12, \\ (\phi_0, x\phi_0) = \int_0^1x^2\,dx = \frac13, \\ \therefore \alpha_0 = \frac23, \ \phi_1(x) = x - \frac23; \\ \|\phi_1\|^2 = \int_0^1x\left(x - \frac23\right)^2\,dx = \frac1{36}, \\ (\phi_1, x\phi_1) = \int_0^1x^2\left(x - \frac23\right)^2\,dx = \frac2{135}, \\ \therefore\ \alpha_1 = \frac8{15}, \ \beta_1 = \frac1{18}, \\ \phi_2(x) = \left(x - \frac8{15}\right)\left(x - \frac23\right) - \frac1{18} = \boxed{x^2 - \frac{6x}5 + \frac3{10}}, \end{gather*} giving \begin{align*} x_0 = \frac{6 - \sqrt6}{10}, \\ x_1 = \frac{6 + \sqrt6}{10}, \end{align*} and \begin{align*} A_0 & = \frac{2 - 3x_1}{6(x_0 - x_1)} = \frac{9 - \sqrt6}{36}, \\ A_1 & = \frac{2 - 3x_0}{6(x_1 - x_0)} = \frac{9 + \sqrt6}{36}, \end{align*} in agreement with user5713492's answer.