0

I have a certain multivariate polynomial (in 4 variables) written in terms of monomials, and I would like to change the basis into Chebyshev orthogonal basis. Is there any function to do that?

user22247
  • 55
  • 3
  • Can be done with PolynomialReduce. – Daniel Lichtblau Nov 23 '14 at 22:33
  • @DanielLichtblau: I'm having trouble, I tried f = Sum[RandomInteger[{-5, 5}] x^k, {k, 0, 5}]; b = Table[ChebyshevT[k, x], {k, 0, 5}]; PolynomialReduce[f, b, x] and it's just giving $a_1$ as the original polynomial. Am I doing something dumb? – DumpsterDoofus Nov 24 '14 at 02:37
  • @DumpsterDoofus Try defining each Chebyshev polynomial as a new variable, using b = Table[y[k] - ChebyshevT[k, x], {k, 0, 5}];. Then see what PolynomialReduce produces. – Daniel Lichtblau Nov 24 '14 at 03:52
  • @DanielLichtblau: Hm, still having trouble understanding. With randomly generated polynomial 5 - 3 x + 3 x^2 + 2 x^3, the output by PolynomialReduce is {{0, 3 - 2 x^2 + x (-3 - 2 y[1]) - 3 y[1] - 2 y[1]^2, 0, 0, 0, 0}, 5 - 3 y[1] + 3 y[1]^2 + 2 y[1]^3}, but I don't see how that gives the correct answer of Chebyshev polynomial coefficients, which is supposed to be {13/2, -(3/2), 3/2, 1/2, 0}. – DumpsterDoofus Nov 24 '14 at 20:33
  • @DumpsterDoofus Ah. Yes, you are getting a "correct" result in terms of the polynomial rewrite, it's just not a useful result (it involves powers of y[1], which is x, which is useless). If I get something worked out I'll post. – Daniel Lichtblau Nov 24 '14 at 21:21
  • @DumpsterDoofus Here it is. `In[210]:= SeedRandom[1111]; poly = Sum[RandomInteger[{-5, 5}]*x^k, {k, 0, 5}] b = Table[y[k] - ChebyshevT[k, x], {k, 0, 5}];

    Out[211]= -4 - 2 x + 5 x^2 + 2 x^3 - 4 x^4 + 2 x^5

    In[213]:= newpoly = Fold[Last[PolynomialReduce[#1, #2, x]] &, poly, Reverse[b]]

    Out[213]= 1/8 (-24 + 6 y[1] + 4 y[2] + 9 y[3] - 4 y[4] + y[5])

    In[214]:= Expand[newpoly - poly /. y[j_] :> ChebyshevT[j, x]]

    Out[214]= 0`

    – Daniel Lichtblau Nov 24 '14 at 21:42

0 Answers0