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.

Concept 1 of 2

Integrating absolute-value and piecewise functions

Intuition

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 abf(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 f0f\ge 0 and f=f|f| = -f where f<0f< 0.
  • Integrate each piece and add. Because f0|f|\ge 0, the answer is the total (unsigned) area, so abfdxabfdx\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 28x5dx\displaystyle\int_2^8 |x-5|\,dx.
Practice this conceptself-check · 3 quick reps

From the bank · past-year question

Example 1Definite IntegrationMODERATE
0π/2sinxcosxdx\displaystyle\int_0^{\pi/2}|\sin x-\cos x|\,dx is equal to

[Q82 · Apr · 2019]

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

11(1x2)dx\int_{-1}^{1}(1-x^2)\,dx (no bars) gives a SIGNED area, but 11x21dx\int_{-1}^{1}|x^2-1|\,dx needs the sign of x21x^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 23xdx\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

Intuition

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=ab\int_a^b(\lfloor x\rfloor+\lfloor -x\rfloor)\,dx = a-b.
  • The fractional part xxx-\lfloor x\rfloor has nn+1(xx)dx=12\int_n^{n+1}(x-\lfloor x\rfloor)\,dx = \tfrac12.

Greatest-integer (floor) results

nn+1(xx)dx=12x+x=1    (xZ)0nxdx=n(n1)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.5xdx\displaystyle\int_0^{1.5} \lfloor x\rfloor\,dx.
Practice this conceptself-check · 3 quick reps

From the bank · past-year question

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

[Q82 · Apr · 2018]

⌊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(xx)dx=12x+x=1    (xZ)0nxdx=n(n1)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)

Drill every past-year question on this subtopic

17 questions from the bank — paginated, with cart and Word-export support.