# What have I done incorrectly; integration by parts

We have $f(x) = (2x+4) \cos(2x)$

My method was integration by parts, and this is my calculation:

$$\displaystyle \int \cos(2x) \cdot (2x+4) dx = \sin(2x)\cdot (2x-4) - \displaystyle\int \sin(2x) \cdot 2 dx$$

$$\displaystyle \int \displaystyle \cos(2x) \cdot (2x+4) dx = \sin(2x) \cdot (2x-4) + \cos(2x) +c$$

Apparently, this is incorrect; but I have no idea why. Can anyone point out my mistake?

-
The primitive of $\cos (2x)$ is $\frac12 \sin(2x)$. And you changed $(2x + 4)$ to $(2x - 4)$. – Daniel Fischer Jun 26 '13 at 15:42
@DanielFischer Answer it in the question so I can give you the best answer. I hate to ask these types of questions, but my mind is just weird; once I get a solution I can't seem to figure out what's wrong, if the solution is wrong. – ByeByeYa Jun 26 '13 at 15:46
@DanielFischer You may consider turning your comment into an answer, so that this question is more likely to be removed from the "UNANSWERED" tab. – user1551 Jun 26 '13 at 15:48

Two mistakes. One is probably a typo, you changed the $(2x + 4)$ factor of the integrand to $(2x - 4)$.
The other is that you didn't account for the factor $2$ in applying the inverse of the chain rule, the primitive of $\cos (2x)$ is $\frac12\sin(2x)$, and then the same once more, the primitive of $\sin(2x)$ is $-\frac12\cos(2x)$, so overall we obtain
$$\int \cos (2x)\cdot(2x+4)\,dx = \frac12\sin (2x)\cdot(2x+4) - \int \sin (2x)\,dx = (x+2)\sin (2x) + \frac12\cos (2x) + c.$$