Problem:

$\displaystyle \int cos^2(x)dx$

Attempt:

$\displaystyle cos(x)sin(x) - \int -sin(x)sin(x)$u = cos(x)

du = -sin(x)dx

dv = cos(x) dx

v = sin(x)

$\displaystyle cos(x)sin(x) + \int sin(x)sin(x)$

Focusing on $\displaystyle \int sin(x)sin(x)$

$\displaystyleu = sin(x)

du = cos(x)dx

dv = sin(x)

v = -cos(x)

-sin(x)cos(x) - \int cos(x)-cos(x)

$

$\displaystyle -sin(x)cos(x) + \int cos(x)cos(x)$

Am I doing this wrong?

Correct Answer:

$\displaystyle \frac{sin(2x)}{4} + x/2 + C$