1

Background: I am doing Gauss Quadrature, which says that $$\int_{-1}^1 f(x) w(x) dx \approx \sum_{j=0}^3 w_j f(x_i)$$ where $w(x) = \frac {1}{\sqrt{1-x^2}}$. To find the $w_j$, I essentially have to solve

$$\int_{-1}^1 \frac {(x-a)(x-b)}{\sqrt{1-x^2}}dx$$

for a few different values of $a$ and $b$.

I know that once my integrand is a rational function, then I can use partial functions to solve it. However, I haven't found a $u$-substitution which makes the integrand a rational function.

I also looked at this related answer, which seems to use the Beta function. But I would hope that's not neccesary.

Thanks a lot for any help.

Ovi
  • 23,737

2 Answers2

4

Let $ a,b\in\mathbb{R} :$

Making the change of variable $ \left\lbrace\begin{aligned}x&=\sin{y}\\ \mathrm{d}y&=\frac{\mathrm{d}x}{\sqrt{1-x^{2}}}\end{aligned}\right. $, we get : \begin{aligned} \int_{-1}^{1}{\frac{\left(x-a\right)\left(x-b\right)}{\sqrt{1-x^{2}}}\,\mathrm{d}x}&=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}{\left(\sin{y}-a\right)\left(\sin{y}-b\right)\mathrm{d}y}\\ &=\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}{\sin^{2}{y}\,\mathrm{d}y}-\left(a+b\right)\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}{\sin{y}\,\mathrm{d}y}+ab\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}}{\mathrm{d}y}\\ \int_{-1}^{1}{\frac{\left(x-a\right)\left(x-b\right)}{\sqrt{1-x^{2}}}\,\mathrm{d}x}&=\frac{\pi}{2}+\pi ab \end{aligned}

CHAMSI
  • 8,333
1

Whoa, hold on thar, what about that numerical-methods tag? Let's use the $2$-point Gauss-Chebyshev method, exact for polynomials of order $3$ or less: the zeros of $T_2(x)=\cos(2\cos^{-1}x)=0=\cos\left((2k+1)\frac{\pi}2\right)$ are $x=\cos\left((2k+1)\frac{\pi}4\right)$. The weights are all the same so $2w=\int_{-1}^1\frac{dx}{\sqrt{1-x^2}}=\pi$ so the answer is $$\begin{align}\int_{-1}^1\frac{(x-a)(x-b)}{\sqrt{1-x^2}}dx&=\frac{\pi}2\left(\left(-\frac1{\sqrt2}-a\right)\left(-\frac1{\sqrt2}-b\right)+\left(\frac1{\sqrt2}-a\right)\left(\frac1{\sqrt2}-b\right)\right)\\ &=\frac{\pi}2\left(\frac12+\frac{a+b}{\sqrt2}+ab+\frac12-\frac{a+b}{\sqrt2}+ab\right)=\frac{\pi}2(1+2ab)\end{align}$$

user5713492
  • 15,938
  • Oh this is super cool, thanks for sharing! I'll have to read more in detail tomorrow. – Ovi Mar 28 '20 at 05:44