$ I = \int (x^2 + 2x)\cos(x) dx $

Integration by Parts, choose $u$:

$$\begin{align} u &= \cos(x) \\ dv &= (x^2 + 2x)dx \\ du &= -\sin(x) \\ v &= \frac{1}{3}x^3 + x^2 \end{align} $$

Substitute into formula: $$ \begin{align} \int udu &= uv - \int vdu \\ &= \cos(x)\left(\frac{1}{3}x^3 + x^2\right) - \int\left(\frac{1}{3}x^3 + 2x\right)(-\sin(x)) \\ &= \cos(x)\left(\frac{1}{3}x^3 + x^2\right) + \int\left(\frac{1}{3}x^3 + 2x\right)(\sin(x)) \end{align} $$

At this point, it doesn't look like I can use the substitution rule on the the right hand integral, so I decide to use the substitution rule again.

Integration by Parts II, choose $u$:

$$\begin{align} u &= sinx \\ dv &= (\frac{1}{3}x^3 + 2x)dx \\ du &= cosx \\ v &= \frac{1}{12}x^4 + x^2 \end{align} $$

Substitute into formula: $$\begin{align} \int_{}udu &= uv - \int_{}vdu \\ &= (sinx)(\frac{1}{12}x^4 + x^2) - \int_{} (\frac{1}{12}x^4 + x^2)(cosx)dx \end{align} $$

Combining the two integration by parts together and I feel like I am no closer to evaluating the integral than whence I started...The integral is still there and I feel another parts by integration won't work.
$$\int(x^2 + 2x)\cos(x) = (\cos(x))\left(\frac{1}{3}x^3 + x^2\right) + (\sin(x))\left(\frac{1}{12}x^4 + x^2\right) - \int\left(\frac{1}{12}x^4 + x^2\right)(\cos(x))dx$$

Did I do the math wrong and make a mistake somewhere? Or am I supposed to approach this differently?

  • 2
    $\begingroup$ I would suggest that you try to reduce the polynomial rather than trying to increase the order. In short take $$v = x^2+2x, du = \cos x$$ $\endgroup$
    – Chinny84
    Feb 16, 2019 at 0:20
  • 2
    $\begingroup$ You have chosen u' and v so that the degree of the polynomial increases. Choose instead to decrease it. $\endgroup$
    – Jean Marie
    Feb 16, 2019 at 0:22
  • $\begingroup$ Okay that makes sense, I will give it a try thank you $\endgroup$
    – Evan Kim
    Feb 16, 2019 at 0:34
  • 1
    $\begingroup$ Have you ever heard of the LIATE rule for choosing $u$ in integration by parts? It is basically, Logs, Inverse trig functions, Algebraic (ploynomials), Trigonometric functions and then Exponential functions. This will help you for the choice of $u$ $\endgroup$
    – Ditherer
    Feb 16, 2019 at 4:29
  • $\begingroup$ Thank you, looks like I violated it here! $\endgroup$
    – Evan Kim
    Feb 16, 2019 at 12:16

1 Answer 1


I would do this way $$\int(x^2+2x)\cos x\ dx$$

By Integration By Parts: $u=(x^2+2x),v^{\prime}=\cos x$ $$=(x^2+2x)\sin x-\int(2x+2)\sin xdx$$

Again apply Integration By Parts for $\int(2x+2)\sin xdx$ $u=(2x+2), v^{\prime}=\sin x$ and we get

$\int(2x+2)\sin xdx=2\sin x-\cos x(2x+2)$

So, we finally get, $$=(x^2+2x)\sin x-[2\sin x-\cos x(2x+2)]+C$$ $$=(x^2+2x-2)\sin x+2(x+1)+C$$

$$\int(x^2+2x)\cos x\ dx=(x^2+2x-2)\sin x+2(x+1)+C$$

  • 2
    $\begingroup$ Ah, I see how decreasing the polynomial is definitely the way to go here, it makes the 2nd Integration by Parts much "simpler" it seems $\endgroup$
    – Evan Kim
    Feb 16, 2019 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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