---
title: "Half range cosine series: x sin x"
subject: "Mathematics III"
chapter: 4
key: "semester_3/mathematics_iii:half-range-cosine-series-x-sin"
source: https://www.bctengineer.com/q/semester_3/mathematics_iii/half-range-cosine-series-x-sin
site: BCT Engineering
---

# Half range cosine series: x sin x

Mathematics III · Chapter 4: Fourier Series

- Asked in: 2076 Chaitra, 5 marks
- Video: [Fourier half range cosine series : f(x)=x sinx  (x=0 to Π)](https://www.youtube.com/watch?v=XxoAt-yTxPw) — m-easy maths
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_3/mathematics_iii/half-range-cosine-series-x-sin
- Whole chapter: https://www.bctengineer.com/md/semester_3/mathematics_iii/chapter-4

## Question

Obtain the half range cosine series for the function f(x) = x sin x in the interval (0, π).

## Short answer

a0 = 2, a1 = -1/2, and for n≥2, a_n = 2(-1)^(n+1)/(n² - 1). The half-range cosine series: x sin x = 1 - ½ cos x + 2 ∑_{n=2}^∞ (-1)^(n+1) cos(nx)/(n² - 1).

## Answer

The half-range cosine series on (0, π) uses the even extension: f(x) = a₀/2 + Σ aₙ cos nx, aₙ = (2/π)∫₀^π f(x) cos nx dx.

For f(x) = x sin x:

```text
a₀ = (2/π) ∫₀^π x sin x dx = (2/π)[−x cos x + sin x]₀^π = 2
a₁ = (2/π) ∫₀^π x sin x cos x dx = (1/π) ∫₀^π x sin 2x dx = (1/π)(−π/2) = −1/2
```

For n ≥ 2, use 2 sin x cos nx = sin(n+1)x − sin(n−1)x and ∫₀^π x sin mx dx = π(−1)^(m+1)/m:

```text
aₙ = (1/π) ∫₀^π x [ sin(n+1)x − sin(n−1)x ] dx
   = (−1)ⁿ⁺² /(n+1) − (−1)ⁿ /(n−1)
   = (−1)ⁿ [ 1/(n+1) − 1/(n−1) ]
   = 2(−1)ⁿ⁺¹/(n² − 1)
```

**Answer:**

```text
x sin x = 1 − (1/2) cos x + 2 Σ_{n=2}^∞ [ (−1)ⁿ⁺¹/(n² − 1) ] cos nx
        = 1 − (1/2) cos x − (2/3) cos 2x + (1/4) cos 3x − (2/15) cos 4x + ...,   0 ≤ x ≤ π
```

(x sin x is already even, so this is also its Fourier series on (−π, π).)

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. The half-range cosine series corresponds to:
   A. the even extension of f
   B. the odd extension
   C. a periodic extension of period π with no symmetry
   D. the zero extension
   Answer: A. Even extension gives only cosine terms. (Key point: Extension)

2. a1 for x sin x is separate because:
   A. a1 is always 0
   B. the identity gives sin(n−1)x = 0 for n = 1, so the formula for n ≥ 2 doesn't apply
   C. a1 equals a0
   D. x sin x is odd
   Answer: B. For n = 1 the term sin(n−1)x vanishes; direct integration gives a1 = −1/2. (Key point: a1)

3. Which integral is used for n ≥ 2?
   A. ∫0^π x sin mx dx = 0
   B. ∫0^π x sin mx dx = π/m
   C. ∫0^π x sin mx dx = π(−1)^(m+1)/m
   D. ∫0^π x sin mx dx = −π/m^2
   Answer: C. This with 2 sin x cos nx = sin(n+1)x − sin(n−1)x gives an. (Key point: Standard integral)

4. The series for x sin x is:
   A. 1 + (1/2)cos x + 2Σ cos nx/(n^2 − 1)
   B. 2 − (1/2)cos x + ...
   C. 1 − (1/2)sin x + ...
   D. 1 − (1/2)cos x + 2Σ_{n≥2} (−1)^(n+1) cos nx/(n^2 − 1)
   Answer: D. a0/2 = 1, a1 = −1/2, an = 2(−1)^(n+1)/(n^2 − 1). (Key point: Result)

## Close variants set in other exams

- [Half range cosine series](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series) — Mathematics III, chapter 4, asked 3×
- [Half range cosine series: x](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series-x) — Mathematics III, chapter 4, asked 3×

## Related in Mathematics III

- [Half range cosine series: sin(πx/l)](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series-sin-x) — Mathematics III, chapter 4
- [Half range cosine series: πx − x²](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series-x-x2) — Mathematics III, chapter 4, asked 3×
- [Half range cosine series: eˣ](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series-e) — Mathematics III, chapter 4, asked 3×
- [Half range cosine series: x](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-cosine-series-x-two) — Mathematics III, chapter 4, asked 2×
- [Half range sine and cosine series: eˣ](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-sine-and-cosine-series) — Mathematics III, chapter 4, asked 2×
- [Half range sine series: x²](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Ahalf-range-sine-series-x2-two) — Mathematics III, chapter 4, asked 9×

## Related in other subjects

- [Cosine series up to n terms](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acosine-series) — Computer Programming, chapter 5
