Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I think that if $f,g$ are polynomial above can be written as finite sum of some integrals. As we have, $$\sum_{n=0}^\infty P_n(t)x^n=(1-2tx+x^2)^{-1/2}.$$