Let $f(x)$ be some function. I need to find $x_1$ and $\omega$ such that the formula: $$ \int_0^1 f(x)\sqrt{x}dx \approx \omega f(x_1)$$ will have the best precision degree.
I know some rules like Simpson's rule or the trapezoidal rule, but both these rules require more than one point.
I thought about using the middle rule: $$\int_{x_1 - h}^{x_1+h} = 2hf(x_1) + \frac{h^3}{3}f''(c)$$
and in case $h = 0.5, x_1 = 0.5$ which means $\omega = 1$. I am struggling to find the approximation degree.
Help would be appreciated.
I'll give you the steps to get started, as well as the answer at the end (in the form of a spoiler). You want to do Gaussian quadrature for this problem. Define the weighted $L^2$ inner product $$(f,g)=\int\limits_0^1 f(x)g(x)\sqrt{x}\, dx,$$ then perform Gram-Schmidt with respect to this inner product to get up to the linear term in the basis. The root of this polynomial will be $x_1.$ Then, start by imposing exactness on the standard polynomial basis to get conditions to find $\omega$ (very easy in this case). You can either check exactness by testing on the standard polynomial basis some more, or you can just store in your mind that Gaussian quadrature with $n$ nodes is exact for all polynomials of degree $\leq 2n-1$ (that is, the degree of precision will be $2n-1$).
All of these computations are pretty easy, since there's only one node. You can also just start by taking the desired rule and directly imposing exactness on $1$ and $x$. In the end, you should get that (spoiler below)