Question

If ∫02π∣xsin⁡x∣ dx=kπ\int_0^{2\pi} |x \sin x|\,dx = k\pi, then the value of kk is equal to _____.

Official answer and solution
Official answer
4
From
Official GATE 2014 answer key

Solution

Split the absolute value integral over intervals where the integrand has a constant sign.

  1. For x∈[0,2π]x \in [0, 2\pi], x≥0x \ge 0, so ∣xsin⁡x∣=x∣sin⁡x∣|x \sin x| = x |\sin x|.

  2. Determine the sign of sin⁡x\sin x:

    • For x∈[0,π]x \in [0, \pi]: sin⁡x≥0  ⟹  ∣sin⁡x∣=sin⁡x\sin x \ge 0 \implies |\sin x| = \sin x.
    • For x∈[π,2π]x \in [\pi, 2\pi]: sin⁡x≤0  ⟹  ∣sin⁡x∣=−sin⁡x\sin x \le 0 \implies |\sin x| = -\sin x.
  3. Split the integral:

    I=∫0πxsin⁡x dx−∫π2πxsin⁡x dx.I = \int_0^\pi x \sin x\,dx - \int_\pi^{2\pi} x \sin x\,dx.
  4. Indefinite integration by parts: ∫xsin⁡x dx=−xcos⁡x+sin⁡x\int x \sin x\,dx = -x \cos x + \sin x.

  5. Evaluate each definite integral:

    • First interval [0,π][0, \pi]:
      [−xcos⁡x+sin⁡x]0π=(−π(−1)+0)−(0)=π.\left[ -x \cos x + \sin x \right]_0^\pi = (-\pi(-1) + 0) - (0) = \pi.
    • Second interval [π,2π][\pi, 2\pi]:
      [−xcos⁡x+sin⁡x]π2π=(−2π(1)+0)−(−π(−1)+0)=−2π−π=−3π.\left[ -x \cos x + \sin x \right]_\pi^{2\pi} = (-2\pi(1) + 0) - (-\pi(-1) + 0) = -2\pi - \pi = -3\pi.
  6. Combine the results:

    I=π−(−3π)=π+3π=4π.I = \pi - (-3\pi) = \pi + 3\pi = 4\pi.

Since I=kπI = k\pi, we have k=4k = 4.

Final answer

4

Common trap

Integrating x sin x directly without splitting for absolute value, which would give 0.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 3
Question
16 of 65, printed as CS Q.6
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.