Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
    
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
    
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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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