# Evaluate the indefinite integral

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

• 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$$ Feb 16, 2019 at 0:20
• You have chosen u' and v so that the degree of the polynomial increases. Choose instead to decrease it. Feb 16, 2019 at 0:22
• Okay that makes sense, I will give it a try thank you Feb 16, 2019 at 0:34
• 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$ Feb 16, 2019 at 4:29
• Thank you, looks like I violated it here! Feb 16, 2019 at 12:16

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

• 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 Feb 16, 2019 at 0:36