I have a function defined as a set of weighted Legendre polynomials: $f(x)=\alpha_0 P_0(x) + \alpha_1 P_1(x) + \alpha_2 P_2(x) +\ldots$.
I have another function similarly defined with Legendre basis weights, but it's over a different range. I want to compare the two functions over the range where they overlap. This means I need to transform one function by stretching and shifting it to match the other sequence's range.
This is not too hard. I basically want to express my function with an affine transform applied to the input, and simplify the resulting polynomial down to basic Legendre basis weights. That is, finding the $\beta_i$ coefficients below.
$\begin{align*} f(Ax+B) &= \alpha_0 P_0(Ax+B) + \alpha_1 P_1(Ax+B) +\alpha_2 P_2(Ax+B) +\ldots\\ &= \beta_0 P_0(x) + \beta_1 P_1(x) + \beta_2 P_2(x) + \ldots \end{align*}$
This is quite well defined. I could in theory do it by expanding the sum into a simple giant polynomial, then collect terms and find the Legendre weights again.
So for example, for the second order term only,
$\begin{align*} P_2(Ax+B)&= {1\over2}(3(Ax+B)^2-1)\\ P_2(Ax+B)&= A^2(\frac12(3x^2-1)+ABx+{1\over2}(A^2+B^2)-\frac12\\ P_2(Ax+B)&= A^2 P_2(x) + ABP_1(x)+ {1\over 2}(A^2+B^2-1)P_0(x) \end{align*}$
This gets more and more ugly with higher orders.
My question: is there a nice recurrence relation or simple way to generate these transformed basis weights given A, B, and the set of weights $\alpha_i$, producing the resultant set of weights $\beta_i$? It feels like there should be a method that does not drop down to expanding the polynomial in full.