-1

I have a problem which surely someone else had on here, but in reading similar questions, I haven't found an answer.

The problem is really trivial:

Integrate[Sin[k*x]^2, {x, -Pi, Pi}, 
 Assumptions -> {k ∈ Integers}]

That shall simply give me

$$\pi$$

Because the whole result would be

$$\pi -\frac{\sin (2 \pi k)}{2 k}$$

But since $k\in\mathbb{Z}$ we have $\sin(2\pi k) = 0$ for every $k$.

Why doesn't mathematica print $\pi$ in the output, simply?

P.s. Of couse "Elements" denotes the $\in$ symbol. Here something went wrong during the copy of the input text!

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
Enrico M.
  • 961
  • 1
  • 6
  • 15

1 Answers1

3

Simplify is not automatically used

Assuming[{k ∈ Integers},
 Integrate[Sin[k*x]^2, {x, -Pi, Pi}] //
  Simplify]

(*  π  *)
Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198