# Is there a formula for calculating the integral of a polynomial times a trig function?

I'm wondering if there is a formula for calculating the integral of a polynomial times a single trig function. For example, integrating $$\int_a^b (t^2 - t) \cos (t) dt$$

I realize that to integrate, I just need to split it up into one integral for each polynomial term and then integrate by parts multiple times, so I am wondering if there is a closed formula (I suspect there is)

• You don't need to split it up, just set $u$ to be the entire polynomial. It still works because it's still a product. – Dylan Mar 5 '15 at 22:16
• @Dylan yeah I realize that now; but we still need to integrate by parts multiple times perhaps. – MCT Mar 5 '15 at 22:17
• Generally the number of times you IBP is equal to the degree of the polynomial – Dylan Mar 5 '15 at 22:19

Hint:

Try using integration by parts. Namely with u = t^2 - t. Remember, you may have to do integration by parts multiple times.

• I mean that doesn't get rid of the problem of having to integrate by parts multiple times (which is what I was trying to avoid by "Cheating" and getting a nice formula) – MCT Mar 5 '15 at 22:16
• try this website. The part you're concerned with is example 9. – Forest Dewberry Mar 5 '15 at 22:18
• Did that answer your question? – Forest Dewberry Mar 5 '15 at 22:40

You can do something like this

$$u = t^2 - t$$ $$dv = \cos t \, dt$$

The number of times you integrate by parts should not be more than the power of the highest0degree term

• Yea I realize. The point of my post is that I wanted a formula so I could be lazy and not have to integrate by parts $n$ times. I guess I'll just bite the bullet and do it. – MCT Mar 5 '15 at 22:46