# Formulas for combining ChebyshevT coefficients?

I have two 5th-order (6th-order?) Chebyshev approximations:

f1[x_] = Sum[a[n]*ChebyshevT[n,x],{n,0,5}]
f2[x_] = Sum[b[n]*ChebyshevT[n,x],{n,0,5}]


and f1[1] == f2[-1]. I now "combine" these functions so f1's domain is mapped to [-1,0] and f2's domain is mapped to [0,1]. The Chebyshev approximation of this combination is:

coeff[n_] := coeff[n] = 2/Pi*(
Integrate[f1[x*2+1]/Sqrt[1-x^2]*ChebyshevT[n,x],{x,-1,0}] +
Integrate[f2[x*2-1]/Sqrt[1-x^2]*ChebyshevT[n,x],{x,0,1}]
)


(coeff[0] actually should be divided by 2, but that doesn't affect my question)

Mathematica won't give me a general formula here (getting rid of "coeff[n_] :=" fails), but I believe there is one. What is it?

I tried using "f1[1] == f2[-1]" to simplify, but it doesn't help.

I calculated coeff[0] through coeff[12]. The multiplier for each of the a[i] is below (the b[i] are easily calculated from the a[i]).

I noticed the multiplier is of the form (a+b*Pi)/c (for a,b,c all integers) for the first few entries in each sequence (ie, i < j in some sense), and then become a/Pi for integer a.

The first sequence (for a[0]) has alternating 0's and may be a special case (and is also easy to solve).

I tried using oeis.org on the numerators and denominators to no avail.

Expand[Table[D[coeff[i],a[j]],{j,0,5},{i,0,12}]] // TeXForm


$\left( \begin{array}{ccccccccccccc} 1 & -\frac{2}{\pi } & 0 & \frac{2}{3 \pi } & 0 & -\frac{2}{5 \pi } & 0 & \frac{2}{7 \pi } & 0 & -\frac{2}{9 \pi } & 0 & \frac{2}{11 \pi } & 0 \\ 1-\frac{4}{\pi } & 1-\frac{2}{\pi } & -\frac{4}{3 \pi } & \frac{2}{3 \pi } \ & \frac{4}{15 \pi } & -\frac{2}{5 \pi } & -\frac{4}{35 \pi } & \frac{2}{7 \pi } & \frac{4}{63 \pi } & -\frac{2}{9 \pi } & -\frac{4}{99 \pi } & \frac{2}{11 \pi } & \frac{4}{143 \pi } \\ 5-\frac{16}{\pi } & 4-\frac{38}{3 \pi } & 2-\frac{16}{3 \pi } & -\frac{22}{15 \pi } & \frac{16}{15 \pi } & -\frac{2}{21 \pi } & -\frac{16}{35 \pi } & \frac{58}{315 \pi } & \frac{16}{63 \pi } & -\frac{122}{693 \pi } & -\frac{16}{99 \pi } & \frac{202}{1287 \pi } & \frac{16}{143 \pi } \\ 25-\frac{236}{3 \pi } & 21-\frac{66}{\pi } & 12-\frac{188}{5 \pi } & 4-\frac{182}{15 \pi } & -\frac{44}{35 \pi } & \frac{10}{7 \pi } & -\frac{28}{45 \pi } & -\frac{34}{105 \pi } & \frac{76}{165 \pi } & \frac{38}{693 \pi } & -\frac{964}{3003 \pi } & \frac{14}{429 \pi } & \frac{1492}{6435 \pi } \\ 129-\frac{1216}{3 \pi } & 112-\frac{5278}{15 \pi } & 72-\frac{3392}{15 \pi \ } & 32-\frac{3518}{35 \pi } & 8-\frac{2624}{105 \pi } & -\frac{254}{315 \pi } & \frac{64}{45 \pi } & -\frac{1334}{1155 \pi } & \frac{64}{495 \pi } & \frac{8482}{15015 \pi } & -\frac{2752}{9009 \pi } & -\frac{4054}{15015 \p\ i } & \frac{1856}{6435 \pi } \\ 681-\frac{32092}{15 \pi } & 605-\frac{5702}{3 \pi } & 420-\frac{9236}{7 \pi } & 220-\frac{4838}{7 \pi } & 80-\frac{15836}{63 \pi } & 16-\frac{2258}{4\ 5 \pi } & -\frac{316}{693 \pi } & \frac{86}{77 \pi } & -\frac{1132}{819 \pi } & \frac{310}{429 \pi } & \frac{1228}{4095 \pi } & -\frac{1822}{3003 \pi } & \frac{788}{13923 \pi } \\ \end{array} \right)$

-