I have some function that I am trying to study $ F(x) : [-1,1]\rightarrow \mathbb{R} $. I want write it in terms of a sum over Jacobi Polynomials $$ F(x) = \sum_n f^{\alpha,\beta}_n P^{\alpha, \beta}_n(x) $$ So far so good, but now I want to find the coefficients $f^{\alpha,\beta}_n$. No problem right? Well, the orthogonality conditions of the Jacobi polynomials is $$ \int_{-1}^{1}w^{\alpha,\beta}(x)P^{\alpha,\beta}_n(x)P^{\alpha,\beta}_m(x) = N_{n}(\alpha,\beta)\delta_{nm} $$ where $w^{\alpha,\beta}(x)$ is some non-trivial weight function, $N_n(\alpha,\beta)$ is a normalization coefficient, and $\delta_{nm}$ is the Kronecker Delta function (only 1 if $n=m$).
So how would I go about computing the coefficients $f^{\alpha,\beta}_n$? My guess would be to redefine the Jacobi Polynomials such that $$ P^{\alpha,\beta}_n(x) \rightarrow \tilde{P}^{\alpha,\beta}_n(x) = \sqrt{\frac{w^{\alpha,\beta}(x)}{N_n(\alpha,\beta)}}P^{\alpha,\beta}_n(x) $$ As far as I know this is all right, but I really do not want to deal with square-roots of polynomials. The weight function is defined as $$ w^{\alpha,\beta}(x) = (1-x)^{\alpha}(1+x)^{\beta}. $$ This puts a restriction on what $\alpha$ can be since $F(x)$ maps $[-1,1]$ to the real number line.
Is there a better way?
You should not tamper with the weight function. Use the scalar product $\langle f, g\rangle=\int_{-1}^1 f(x)\overline{g(x)}w(x) dx$, instead. The Jacobi polynomials are orthogonal (not orthonormal) with respect to this scalar product. So, by general theory, the coefficients are given by $$ f_n^{\alpha, \beta}=\frac{\langle F, P^{\alpha, \beta}_n\rangle}{\langle P^{\alpha,\beta}_n, P^{\alpha,\beta}_n\rangle}.$$