PYQ Vault

NDA Maths · Definite Integration

Absolute Value, Piecewise and Greatest-Integer Integrals

When the integrand changes formula across the interval — an absolute value, a piecewise rule, or a greatest-integer function — split the integral at every break-point and integrate each piece on its own.

Why this matters

17 PYQs built on one habit: never integrate across a break-point. For |f(x)| the break-points are where f changes sign; for greatest-integer functions they are where the integer part jumps. Split, integrate each piece, add. Get the break-points right and these are reliable marks.

Test yourself — a quick 18-question Definite Integration recall quiz, instant score.

Concept 1 of 2: Integrating absolute-value and piecewise functions

An absolute value hides a sign change. To integrate ∣f(x)∣|f(x)|, find where ff is zero, split the interval there, and on each piece replace ∣f∣|f| by +f+f or −f-f according to its sign. The same split-and-integrate idea handles any piecewise rule.

Definition

The method for ∫ab∣f(x)∣ dx\int_a^b |f(x)|\,dx:

  • Find the zeros of ff inside [a,b][a,b] — these are the sign changes.
  • On each subinterval, ∣f∣=f|f| = f where f≥0f\ge 0 and ∣f∣=−f|f| = -f where f<0f< 0.
  • Integrate each piece and add. Because ∣f∣≥0|f|\ge 0, the answer is the total (unsigned) area, so ∫ab∣f∣ dx≥∣∫abf dx∣\int_a^b|f|\,dx \ge \big|\int_a^b f\,dx\big|.
split here (f = 0)|f(x)|f < 0 here →folded up

Worked example

Evaluate ∫28∣x−5∣ dx\displaystyle\int_2^8 |x-5|\,dx.
Practice this conceptself-check · 3 quick reps

The same idea in a real exam question:

NDA · Apr 2019 · Q82Moderate

Example 1 · Definite Integration · Integration of Absolute Value, Piecewise, and Greatest Integer Functions

∫0π/2∣sin⁡x−cos⁡x∣ dx\displaystyle\int_0^{\pi/2}|\sin x-\cos x|\,dx is equal to

Find the zeros first — don't drop the absolute value

∫−11(1−x2) dx\int_{-1}^{1}(1-x^2)\,dx (no bars) gives a SIGNED area, but ∫−11∣x2−1∣ dx\int_{-1}^{1}|x^2-1|\,dx needs the sign of x2−1x^2-1 on each piece. Forgetting the bars (or the split) gives the wrong, signed value.

Split |x| at 0, even when 0 is interior to the interval

For ∫−23∣x∣ dx\int_{-2}^{3}|x|\,dx you cannot just use x22\tfrac{x^2}{2} across the whole range: ∣x∣=−x|x|=-x on [−2,0][-2,0] and ∣x∣=x|x|=x on [0,3][0,3]. Split at the break-point inside the interval and add 2+92=1322 + \tfrac{9}{2} = \tfrac{13}{2}; skipping the split gives the wrong 52\tfrac{5}{2}.

Concept 2 of 2: Integrating greatest-integer (floor) functions

The greatest-integer function ⌊x⌋ is constant between consecutive integers and jumps by 1 at each integer. To integrate it (or anything built from it), split the interval at every point where the integer part changes, replace ⌊·⌋ by its constant value on each piece, and add.

Definition

Working with ⌊·⌋ under an integral:

  • ⌊x⌋ is constant on [n,n+1)[n, n+1) with value nn; split at each integer.
  • For ⌊x²⌋ or ⌊√x⌋, split where the INSIDE crosses an integer (e.g. ⌊x²⌋ jumps at x=1,2,3,…x=1,\sqrt2,\sqrt3,\dots).
  • Useful identity: ⌊x⌋+⌊−x⌋=−1\lfloor x\rfloor + \lfloor -x\rfloor = -1 for non-integer xx, so ∫ab(⌊x⌋+⌊−x⌋) dx=a−b\int_a^b(\lfloor x\rfloor+\lfloor -x\rfloor)\,dx = a-b.
  • The fractional part x−⌊x⌋x-\lfloor x\rfloor has ∫nn+1(x−⌊x⌋) dx=12\int_n^{n+1}(x-\lfloor x\rfloor)\,dx = \tfrac12.

Greatest-integer (floor) results

∫nn+1(x−⌊x⌋) dx=12⌊x⌋+⌊−x⌋=−1    (x∉Z)∫0n⌊x⌋ dx=n(n−1)2\int_n^{n+1}\big(x-\lfloor x\rfloor\big)\,dx = \frac12 \qquad \lfloor x\rfloor + \lfloor -x\rfloor = -1 \;\;(x\notin\mathbb{Z}) \qquad \int_0^{n}\lfloor x\rfloor\,dx = \frac{n(n-1)}{2}
01122334y = ⌊x⌋ — split the integral at each integer

Worked example

Evaluate ∫01.5⌊x⌋ dx\displaystyle\int_0^{1.5} \lfloor x\rfloor\,dx.
Practice this conceptself-check · 3 quick reps

The same idea in a real exam question:

NDA · Apr 2018 · Q82Moderate

Example 2 · Definite Integration · Integration of Absolute Value, Piecewise, and Greatest Integer Functions

What is ∫02[x2] dx\int_{0}^{\sqrt{2}}[x^2]\,dx equal to (where [.] is greatest integer function)?

⌊x⌋ on [−1, 0) is −1, not 0

The floor of a negative non-integer rounds DOWN: ⌊−0.3⌋=−1\lfloor -0.3\rfloor = -1. A common slip is using ⌊x⌋=0\lfloor x\rfloor=0 on [−1,0)[-1,0) — it is −1-1 there, which flips the sign of the contribution.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (1)

  • Integrating greatest-integer (floor) functions

    Greatest-integer (floor) results

    ∫nn+1(x−⌊x⌋) dx=12⌊x⌋+⌊−x⌋=−1    (x∉Z)∫0n⌊x⌋ dx=n(n−1)2\int_n^{n+1}\big(x-\lfloor x\rfloor\big)\,dx = \frac12 \qquad \lfloor x\rfloor + \lfloor -x\rfloor = -1 \;\;(x\notin\mathbb{Z}) \qquad \int_0^{n}\lfloor x\rfloor\,dx = \frac{n(n-1)}{2}

Watch out for (3)

Test yourself on Definite Integration

15 past NDA questions from this chapter, timed at 19 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.