# Gauss Integration of $\sqrt{x}$

$$w(x) = x^{1/2}$$ $$\int_{0}^{1}x^{1/2}f(x)dx = a_{1}f(x_{1})+a_{2}f(x_{2})$$

$$\Pi_{2}(x^2 -p_{1}x+p_{2})$$

$$$$\int_{0}^{1}x^{1/2} \cdot \Pi_{2}(x) dx = 0$$$$

$$$$\int_{0}^{1}x^{1/2} \cdot x \Pi_{2}(x) dx = 0$$$$

From (1) we have : \begin{align*} \int_{0}^{1} x^{1/2}(x^2-p_{1} x +p_{2}) dx &=0 \\ \Rightarrow \int_{0}^{1} x^{5/2}-x^{1/2} \cdot p_{1} x+x^{1/2} p_{2}) dx &=0 \\ \Rightarrow \int_{0}^{1} x^{5/2}-x^{3/2} \cdot p_{1}+x^{1/2} p_{2}) dx &=0 \\ \Rightarrow \frac{x^{5/2 +1}}{5/2 +1} -p_{1} \frac{x^{3/2 +1}}{3/2 +1} +p_{2} \frac{x^{1/2+1}}{1/2+1} &=0 \\ \Rightarrow \frac{x^{7/2 }}{7/2 } -p_{1} \frac{x^{5/2}}{5/2 } +p_{2} \frac{x^{3/2}}{3/2} &=0 \\ \Rightarrow \frac{2 x^{7/2 }}{7 } -p_{1} \frac{2 x^{5/2}}{5} +p_{2} \frac{2 x^{3/2}}{3} &=0 \\ \Rightarrow \left[ \frac{2 x^{7/2 }}{7 } -p_{1} \frac{2 x^{5/2}}{5} +p_{2} \frac{2 x^{3/2}}{3}\right]_{0}^{1} &=0\\ \Rightarrow \frac{2 }{7 } -p_{1} \frac{2}{5} +p_{2} \frac{2}{3} &=0 \\ \Rightarrow -p_{1} \frac{2}{5} +p_{2} \frac{2}{3} &=-\frac{2 }{7 } \\ \Rightarrow p_{1} \frac{2}{5} -p_{2} \frac{2}{3} &=\frac{2 }{7 } \\ \end{align*}

$$$$p_{1} \frac{2}{5} -p_{2} \frac{2}{3} =\frac{2 }{7 }$$$$

From (2) we have : \begin{align*} \int_{0}^{1} x^{1/2}x(x^2-p_{1} x +p_{2}) dx &=0 \\ \Rightarrow \int_{0}^{1} x^{1/2} (x^{3} - p_{1} x^{2} +p_{2}\cdot x ) dx &=0 \\ \Rightarrow \int_{0}^{1} x^{1/2 +3} - p_{1} x^{1/2+2} +p_{2}\cdot x^{1/2+1} ) dx &=0 \\ \Rightarrow \int_{0}^{1} x^{7/2}-x^{5/2} \cdot p_{1} +x^{3/2} p_{2}) dx &=0 \\ \Rightarrow \frac{x^{7/2 +1}}{7/2 +1} -p_{1} \frac{x^{5/2 +1}}{5/2 +1} +p_{2} \frac{x^{3/2+1}}{3/2+1} &=0 \\ \Rightarrow \frac{x^{9/2 }}{9/2 } -p_{1} \frac{x^{7/2}}{7/2 } +p_{2} \frac{x^{5/2}}{5/2} &=0 \\ \Rightarrow \frac{2 x^{9/2 }}{9 } -p_{1} \frac{2 x^{7/2}}{7} +p_{2} \frac{2 x^{5/2}}{5} &=0 \\ \Rightarrow \left[ \frac{2 x^{9/2 }}{9 } -p_{1} \frac{2 x^{7/2}}{7} +p_{2} \frac{2 x^{5/2}}{5}\right]_{0}^{1} &=0\\ \Rightarrow \frac{2 }{9 } -p_{1} \frac{2}{7} +p_{2} \frac{2}{5} &=0 \\ \Rightarrow -p_{1} \frac{2}{7} +p_{2} \frac{2}{5} &=-\frac{2 }{9 } \\ \Rightarrow p_{1} \frac{2}{7} -p_{2} \frac{2}{5} &=\frac{2 }{9 } \\ \end{align*}

$$$$p_{1} \frac{2}{7} -p_{2} \frac{2}{5} =\frac{2 }{9 }$$$$

Now we have the system of equations : \begin{align*} p_{1} \frac{2}{5} -p_{2} \frac{2}{3} &=\frac{2 }{7 } \\ p_{1} \frac{2}{7} -p_{2} \frac{2}{5} &=\frac{2 }{9 } \end{align*}

Solving for $$p_{1},p_{2}$$ we obtain : $$p_{1}=\frac{10}{9},p_{2}=\frac{5}{21}$$

$$\Pi_{2}(x) = x^2 - \frac{10}{9} x+\frac{5}{21}$$

which has roots :

$$x_{1,2} = \frac{5}{9} \pm \frac{2 \sqrt{\frac{10}{7} } }{9}$$

For the calculations of weights \begin{align*} a_{1}+a_{2} =& \int_{0}^{1}x^{1/2} dx = \frac{2}{3} \\ a_{1}x_{1}+a_{2}x_{2}=&\int_{0}^{1}x^{1/2}x dx =\frac{2}{5} \end{align*}

Solving the homogeneous system of 2 linear equations:

$$a_{1}+a_{2}=2/3$$ $$a_{1}x_{1}+a_{2}x_{2}=2/5$$

$$a_{1} =2/3 -a_{2}$$ or $$a_{2}=2/3-a_{1}$$ \begin{align*} a_{1}x_{1}+(2/3 -a_{1})x_{2} &=2/5 \\ a_{1}x_{1}+2/3x_{2}-a_{1}x_{2}&=2/5\\ a_{1}x_{1}-a_{1}x_{2} &=2/5 -2/3 x_{2}\\ a_{1}(x_{1}-x_{2})&=2/5-2/3x_{2}\\ a_{1} &= \frac{2/5 -2/3 x_{2}}{x_{1}-x_{2}} \end{align*}

\begin{align*} (2/3-a_{2})x_{1}+a_{2}x_{2}&=2/5 \\ 2/3 x_{1}-a_{2}x_{1}+a_{2}x_{2} &=2/5\\ -a_{2}x_{1}+a_{2}x_{2}&=2/5-2/3 x_{1}\\ a_{2}(-x_{1}+x_{2}) &=2/5 -2/3 x_{1}\\ a_{2}(x_{1}-x_{2}) &=-2/5 +2/3 x_{1}\\ a_{2} &=\frac{-2/5 +2/3 x_{1} }{x_{1}-x_{2}} \end{align*} $$w_{1} \approx 0.27755$$ and $$w_{2} = 0.389110$$

Therefore we get the Gauss Weight type :

$$\int_{0}^{1}x^{1/2} f(x)dx = 0.27755 \cdot f(\frac{5}{9} - \frac{2 \sqrt{\frac{10}{7} } }{9} ) + (0.389110) \cdot f(\frac{5}{9} + \frac{2 \sqrt{\frac{10}{7} } }{9}) + E_{1}(f) \approx 0.5020$$

Now based on the above i want to calculate the $$\int_{0}^{1}x^{1/2}\cos(\frac{\pi x}{2}) dx$$

How can I proceed?

I am thinking of :

$$I = \int_{0}^{1}x^{1/2} \cos{ \frac{\pi x}{2} } \approx 0.3576$$

Using the Gauss rule as constructed above we have : $$\int_{0}^{1}x^{1/2} \cos{ \frac{\pi x}{2} } dx = (0.27755) \cdot f \left(\frac{5}{9} - \frac{2 \sqrt{\frac{10}{7} } }{9} \right) + (0.389110) \cdot f \left(\frac{5}{9} + \frac{2 \sqrt{\frac{10}{7} } }{9}\right) + E_{1}(f) \approx 0.2319756$$

But is it right or wrong?

• What is $f$? What are $a_1,a_2,x_1,x_2$? What are $\Pi_2,p_1,p_2$? Can you put some words at the beginning to say what is going on here? – runway44 Jan 16 at 7:37
• There must be some mistake in your calculations: the weight in Gaussian quadrature are always positive. – user436658 Jan 16 at 8:28
• @ProfessorVector I edited yes you are right – Mr.Podilatis Jan 16 at 8:46