Calculus II · Problem type

By parts with a sine: x sin(kx)

Use this for “Evaluate the integral of x sin(2x) from 0 to π/2.”

Chart

f(x) = x·sin(x)00.511.522.5300.511.522.533.544.5xy+∫ = 3.142
Shaded: ∫ from 0 to π of f(x) dx = π
All of it is above the axis, so the integral is the shaded area
This is an example. Type your own values to start a new problem.
∫
0
x
sin(
k
x)
dx
=
I
kb
Angle at the upper limit
worked out (not typed)
P
Product term uv at b
worked out (not typed)
Q
Leftover integral of v du
worked out (not typed)

Formulas

kb
=
k
×
b
π = 1 × π
P
=
−
b
×
cos(
kb
)
k
3.1416
=
−π
×
cos(π)
1
Q
=
−
sin(
kb
)
k
2
0
=
−
sin(π)
1
2
I
=
P
−
Q
3.1416 = 3.1416 − 0

Assumptions

•
x is in radians, so the slope of sin(kx) is k cos(kx) and an antiderivative of sin(kx) is −(1 ÷ k)cos(kx).
•
Integration by parts: ∫u dv = uv − ∫v du, with u = x (du = dx) and dv = sin(kx) dx, so v = −(1 ÷ k)cos(kx).
•
The integral runs from 0 to b. At x = 0 both uv and the second integral are 0, so only the upper limit counts.
•
The number k cannot be 0, and area below the x-axis counts as negative.

Step-by-step

WE KNOW
k = 1, b = π
FIND
angle at the upper limit (kb), product term uv at b (P), leftover integral of v du (Q), value of the integral (I)
Step 1 · Find angle at the upper limit (kb)
Use kb = k × b
Work out the angle inside at the upper limit, in radians.
kb
=
1
×
π
kb
=
π
(≈
3.14)
Step 2 · Find product term uv at b (P)
Use P = −b × cos(kb) ÷ k
Take
u
=
x
and
dv
=
sin(kx)
dx:
du
=
dx
and
v
=
−(
1
k
)cos(kx).
The
product
uv
=
−x
cos(kx)
k
is
0
at
x
=
0,
so
put
in
x
=
b
.
P
=
−π
×
cos(π)
1
∫ sin(x) dx = −cos(x)
P
=
−π
×
−1
1
P
=
3.1416
Step 3 · Find leftover integral of v du (Q)
Use Q = −sin(kb) ÷ k²
The
leftover
integral
of
v
du
is
the
integral
of
−(
1
k
)cos(kx)
from
0
to
b
,
which
is
−
sin(
kb
)
k
2
,
since
sin
0
=
0.
Q
=
−
sin(π)
1
2
Q
=
0
Step 4 · Find value of the integral (I)
Use I = P − Q
Subtract the leftover integral from the product term: uv − ∫v du.
I
=
3.1416
−
0
π
∫
0
(
x
·sin(
x
)) dx
=
[−x
cos(x)
+
sin(x)]
from
0
to
π
=
3.1416
I
=
3.1416
Check
Put the numbers back in. Both sides should match.
π = 1 × π ✓
3.1416
=
−π
×
cos(π)
1
✓
0
=
−
sin(π)
1
2
✓
3.1416 = 3.1416 − 0 ✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.

Related lessons

© 2026 SME. All rights reserved.