Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a polynomial expression of order n (say n=20). F(x)=1+x+x^2+x^3++...x^20.

I want to approximate the polynomial for order 3 only. So I need to make the coefficient of power of x greater than 3 to zero. How can I do that in Mathematica?

share|improve this question

closed as off-topic by Louis, Edmund, Kuba, ubpdqn, Öskå May 28 at 10:56

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Louis, Edmund, Kuba, ubpdqn, Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Try Series[1 + x + x^2 + x^3 + x^20, {x, 0, 5}] // Normal. – b.gatessucks Jul 16 '13 at 10:35
1  
You question in not clear. The approximation theory is a vast subject. But if you want only to delete powers greater than 3, I'd do it this F[x] /. x^k_ /; k > 3 :> 0 having defined e.g. F[x_] = Total[x^Range[0, 20]];. – Artes Jul 16 '13 at 10:36
1  
Over what range do you need the approximation to be accurate? Simply truncating the polynomial, $1 + x + x^2 + x^3 + x^20$ leaves you with approx. a $10\%$ error at $x=1$. It quickly falls below machine precision ($10^{-16}$) on my machine at $x \approx 0.16$. However, if you need a more uniform error, you should look at expanding it in terms of Chebyshev polynomials. – rcollyer Jul 16 '13 at 12:58

A simple possibility is this:

 1 + x + x^2 + x^3 + x^4 + x^20 // Function[y, Normal[y + O[x]^4]]

which results in

1 + x + x^2 + x^3
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.