Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I calculated this integral :

$$\int{x \cdot \sin^2(x) dx}$$

By parts, knowing that $\int{\sin^2(x) dx} = \frac{1}{2} \cdot x - \frac{1}{4} \cdot \sin(2x) +c$. So I can consider $\sin^2(x)$ a derivative of $\frac{1}{2} \cdot x - \frac{1}{4} \cdot \sin(2x)$, and I get this result:

$$\frac{1}{4} \cdot x^2 - \frac{x}{4} \cdot \sin(2x) + \frac{1}{4} \cdot \sin^2(x) +c$$

I get the confirm on wolfram if I try to compute the derivative of $\frac{1}{4} \cdot x^2 - \frac{x}{4} \cdot \sin(2x) + \frac{1}{4} \cdot \sin^2(x) +c$, but here if I try to compute the integral of $\int{x \cdot \sin^2(x) dx}$ I get this result:

$$\frac{x^2}{4} -\frac{1}{4} \cdot x \cdot \sin(2x) -\frac{1}{8} \cdot \cos(2x) $$

But $\frac{1}{8} \cdot \cos(2x)$ isn't equal to $\frac{1}{4} \cdot \sin^2(x)$, which is the correct result?

share|cite|improve this question
$\cos (2x) = \cos^2 x - \sin^2 x = 1 - 2\sin^2 x$, so $-\frac18 \cos (2x) - \frac14\sin^2 x$ is constant. – Daniel Fischer Jul 6 '13 at 19:40
up vote 4 down vote accepted

We have that $\sin^2 x = \frac{1-\cos (2x)}{2}$. Therefore, $\frac14 \sin^2 x = \frac{1-\cos (2x)}{8} = \frac18 - \frac18 \cos (2x)$. The extra $\frac18$ is taken care of by the constant of integration. In other words, if two functions differ by a constant, they have the same derivative. This is something that happens often when integrating trigonometric functions because of the various identities.

share|cite|improve this answer

By the double angle identity for cosine, they differ by a constant. Add a constant of integration $d$ to your answer, and the two answers will be equivalent.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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