MatheramaMatherama
← Definite Integration
Definite Integration·Section 4·26 min read

Dealing with Points of Discontinuity and Non-Differentiability

In the previous section, we proved the First Fundamental Theorem of Calculus under a clean, friendly condition: the function f(x)f(x) is continuous on [a,b][a, b], and its antiderivative F(x)F(x) satisfies F′(x)=f(x)F'(x) = f(x) at every point of [a,b][a, b].

In practice, however, many important functions in mathematics have sharp corners (points of non-differentiability, like ∣x−1∣|x - 1|) or finite jumps (points of discontinuity, like the greatest integer function ⌊x⌋\lfloor x \rfloor or piecewise-defined functions). Even more surprisingly, sometimes f(x)f(x) itself is completely smooth, yet the antiderivative formula F(x)F(x) we find has a hidden jump inside [a,b][a, b].

How do we evaluate definite integrals safely when a "trouble spot" x=cx = c lies inside our interval [a,b][a, b]?


1. Stepping Around a Trouble Spot: Leaving a Small Gap Around the Point§

Suppose a bounded function f(x)f(x) is continuous everywhere on [a,b][a, b] except at an interior point x=cx = c (where a<c<ba < c < b). Because f(x)f(x) is not continuous at x=cx = c, we cannot directly apply the Fundamental Theorem across the whole interval [a,b][a, b] in one step.

Instead, we step around the point x=cx = c by leaving a tiny gap of width 2h2h around it, from c−hc - h to c+hc + h (where h>0h > 0 is a small positive number):

  1. Left Piece [a,c−h][a, c - h]: On this closed interval, we stop just before x=cx = c. Here, f(x)f(x) has no breaks at all—it is completely continuous!
  2. Right Piece [c+h,b][c + h, b]: On this closed interval, we start just after x=cx = c. Again, f(x)f(x) is completely continuous here!
  3. Middle Strip [c−h,c+h][c - h, c + h]: What happens to the tiny vertical strip between c−hc - h and c+hc + h? Because f(x)f(x) is bounded (say ∣f(x)∣≤M|f(x)| \le M), the area of this thin strip is at most width×height=2h⋅M\text{width} \times \text{height} = 2h \cdot M. As we shrink h→0+h \to 0^+, the width 2h2h shrinks to 00, so the area of this middle strip vanishes completely:
lim⁡h→0+(2h⋅M)=0\lim_{h \to 0^+} (2h \cdot M) = 0

Stepping around a point of discontinuity c using intervals a to c-h and c+h to b

[!TIP] Why a Single Point Has Zero Area: A single point x=cx = c on the xx-axis has a width of 00. Changing the value of f(c)f(c) at a single point—or even having a finite jump there—only changes a single vertical line segment of width 00, which adds zero area to the integral.

Therefore, the total definite integral from aa to bb is simply the limit of the sum of the two safe pieces as h→0+h \to 0^+:

∫abf(x) dx=lim⁡h→0+∫ac−hf(x) dx+lim⁡h→0+∫c+hbf(x) dx\int_a^b f(x) \, dx = \lim_{h \to 0^+} \int_a^{c-h} f(x) \, dx + \lim_{h \to 0^+} \int_{c+h}^b f(x) \, dx

Now, because f(x)f(x) is continuous on [a,c−h][a, c - h] and on [c+h,b][c + h, b], we can apply the First Fundamental Theorem of Calculus separately on each piece! If F(x)F(x) is an antiderivative on each piece, then:

∫ac−hf(x) dx=F(c−h)−F(a)and∫c+hbf(x) dx=F(b)−F(c+h)\int_a^{c-h} f(x) \, dx = F(c - h) - F(a) \quad \text{and} \quad \int_{c+h}^b f(x) \, dx = F(b) - F(c + h)

Taking the limit as h→0+h \to 0^+, recall from our chapter on Limits and Continuity that lim⁡h→0+F(c−h)\lim_{h \to 0^+} F(c - h) is the left-hand limit F(c−)F(c^-), and lim⁡h→0+F(c+h)\lim_{h \to 0^+} F(c + h) is the right-hand limit F(c+)F(c^+). This gives our master formula:

[!IMPORTANT] Fundamental Theorem Across a Trouble Spot x=cx = c: If x=c∈(a,b)x = c \in (a, b) is a point where f(x)f(x) or its antiderivative F(x)F(x) is discontinuous or changes its formula, then:

∫abf(x) dx=lim⁡h→0+[F(c−h)−F(a)]+lim⁡h→0+[F(b)−F(c+h)]\int_a^b f(x) \, dx = \lim_{h \to 0^+} \Big[ F(c - h) - F(a) \Big] + \lim_{h \to 0^+} \Big[ F(b) - F(c + h) \Big]

In one-sided limit notation:

∫abf(x) dx=[F(c−)−F(a)]+[F(b)−F(c+)]\int_a^b f(x) \, dx = \Big[ F(c^-) - F(a) \Big] + \Big[ F(b) - F(c^+) \Big]

If there are several trouble spots c1<c2<⋯<ckc_1 < c_2 < \dots < c_k inside (a,b)(a, b), we simply split the interval at every one of them: [a,c1][a, c_1], [c1,c2][c_1, c_2], …\dots, [ck,b][c_k, b], and evaluate each sub-interval using the formula valid on its interior.


2. Three Situations Where We Must Split the Interval§

Let us see what our master formula [F(c−)−F(a)]+[F(b)−F(c+)]\big[F(c^-) - F(a)\big] + \big[F(b) - F(c^+)\big] tells us in the three main situations we encounter when evaluating definite integrals.


Situation 1: Functions with Sharp Corners or Piecewise Formulas (Modulus Functions)§

What if our antiderivative F(x)F(x) is continuous at x=cx = c, so that F(c−)=F(c+)=F(c)F(c^-) = F(c^+) = F(c), even though F′(c)F'(c) does not exist (a sharp corner)?

Look at what happens in our master formula when F(c−)=F(c+)=F(c)F(c^-) = F(c^+) = F(c):

∫abf(x) dx=[F(c)−F(a)]+[F(b)−F(c)]=F(b)−F(a)\int_a^b f(x) \, dx = \Big[ F(c) - F(a) \Big] + \Big[ F(b) - F(c) \Big] = F(b) - F(a)

The intermediate values F(c)F(c) and −F(c)-F(c) cancel out!

When F'(x) = f(x) fails at an isolated point, a continuous antiderivative F(x) still satisfies FTC

In practice, when the integrand f(x)f(x) itself has a sharp corner (like ∣x−c∣|x - c|) or is defined by different formulas on the left and right of x=cx = c:

f(x)={f1(x),a≤x<cf2(x),c≤x≤bf(x) = \begin{cases} f_1(x), & a \le x < c \\ f_2(x), & c \le x \le b \end{cases}

we have two different antiderivative formulas: F1(x)F_1(x) on [a,c)[a, c) and F2(x)F_2(x) on (c,b](c, b]. Splitting at x=cx = c gives:

∫abf(x) dx=∫acf1(x) dx+∫cbf2(x) dx=[F1(c)−F1(a)]+[F2(b)−F2(c)]\int_a^b f(x) \, dx = \int_a^c f_1(x) \, dx + \int_c^b f_2(x) \, dx = \Big[ F_1(c) - F_1(a) \Big] + \Big[ F_2(b) - F_2(c) \Big]

Example 1

Evaluate:

∫03∣x−1∣ dx\int_0^3 |x - 1| \, dx

Solution:

The modulus function ∣x−1∣|x - 1| is continuous everywhere on [0,3][0, 3], but it has a sharp corner (point of non-differentiability) at x=1x = 1, where x−1x - 1 changes sign:

∣x−1∣={−(x−1)=1−x,if 0≤x<1x−1,if 1≤x≤3|x - 1| = \begin{cases} -(x - 1) = 1 - x, & \text{if } 0 \le x < 1 \\ x - 1, & \text{if } 1 \le x \le 3 \end{cases}

We split the interval [0,3][0, 3] at the corner point x=1x = 1:

∫03∣x−1∣ dx=∫01(1−x) dx+∫13(x−1) dx\int_0^3 |x - 1| \, dx = \int_0^1 (1 - x) \, dx + \int_1^3 (x - 1) \, dx

Now each piece is a simple polynomial that is smooth on its sub-interval:

∫01(1−x) dx=[x−x22]01=(1−12)−0=12\int_0^1 (1 - x) \, dx = \left[ x - \frac{x^2}{2} \right]_0^1 = \left(1 - \frac{1}{2}\right) - 0 = \frac{1}{2} ∫13(x−1) dx=[x22−x]13=(92−3)−(12−1)=32−(−12)=2\int_1^3 (x - 1) \, dx = \left[ \frac{x^2}{2} - x \right]_1^3 = \left(\frac{9}{2} - 3\right) - \left(\frac{1}{2} - 1\right) = \frac{3}{2} - \left(-\frac{1}{2}\right) = 2

Adding the two areas gives:

∫03∣x−1∣ dx=12+2=52\int_0^3 |x - 1| \, dx = \frac{1}{2} + 2 = \frac{5}{2}

Example 2

Evaluate:

∫02f(x) dxwheref(x)={1,0≤x<12x,1≤x≤2\int_0^2 f(x) \, dx \quad \text{where} \quad f(x) = \begin{cases} 1, & 0 \le x < 1 \\ 2x, & 1 \le x \le 2 \end{cases}

Solution:

Here f(x)f(x) has a jump discontinuity at x=1x = 1, jumping from f(1−)=1f(1^-) = 1 to f(1+)=2f(1^+) = 2. Using the [0,1−h][0, 1-h] and [1+h,2][1+h, 2] splitting at c=1c = 1:

∫02f(x) dx=lim⁡h→0+∫01−h1 dx+lim⁡h→0+∫1+h22x dx\int_0^2 f(x) \, dx = \lim_{h \to 0^+} \int_0^{1-h} 1 \, dx + \lim_{h \to 0^+} \int_{1+h}^2 2x \, dx

Evaluating each piece using its own antiderivative (F1(x)=xF_1(x) = x on the left, and F2(x)=x2F_2(x) = x^2 on the right):

∫02f(x) dx=lim⁡h→0+[x]01−h+lim⁡h→0+[x2]1+h2=(1−0)+(22−12)=1+3=4\int_0^2 f(x) \, dx = \lim_{h \to 0^+} \Big[ x \Big]_0^{1-h} + \lim_{h \to 0^+} \Big[ x^2 \Big]_{1+h}^2 = (1 - 0) + (2^2 - 1^2) = 1 + 3 = 4

Notice that because F1(x)=xF_1(x) = x is continuous up to x=1x = 1 and F2(x)=x2F_2(x) = x^2 is continuous down to x=1x = 1, we can simply write:

∫02f(x) dx=∫011 dx+∫122x dx=[x]01+[x2]12=1+3=4\int_0^2 f(x) \, dx = \int_0^1 1 \, dx + \int_1^2 2x \, dx = \Big[ x \Big]_0^1 + \Big[ x^2 \Big]_1^2 = 1 + 3 = 4

Situation 2: Step Functions — Greatest Integer, Fractional Part, and Signum Functions§

Step functions such as the Greatest Integer Function ⌊x⌋\lfloor x \rfloor (often written [x][x]) jump at every integer point.

The Graphical Rectangle Method for Greatest Integer Integrals

Whenever the entire integrand is a greatest integer function ⌊g(x)⌋\lfloor g(x) \rfloor, the graph of y=⌊g(x)⌋y = \lfloor g(x) \rfloor is simply a collection of horizontal steps! You do not even need to find antiderivatives—you can write down the value of the definite integral immediately by drawing the graph and summing the areas of the rectangles:

  1. Sketch the inner curve y=g(x)y = g(x) over the interval [a,b][a, b] to see its range (its minimum and maximum values) and where it increases or decreases.
  2. Draw horizontal lines at every integer height y=ky = k that lies within the range of g(x)g(x).
  3. Project the intersection points down to the xx-axis. If g(x)g(x) hits an integer kk at x=crx = c_r, that point is a jump point of ⌊g(x)⌋\lfloor g(x) \rfloor. (If g(x)g(x) merely touches an integer kk at a peak and turns back down without crossing below kk, that single point has width 00 and adds zero area!)
  4. Sum the rectangles: On each sub-interval [xr−1,xr][x_{r-1}, x_r] where k≤g(x)<k+1k \le g(x) < k + 1, the graph of y=⌊g(x)⌋y = \lfloor g(x) \rfloor is a flat horizontal line at height kk. It forms a rectangle of base (xr−xr−1)(x_r - x_{r-1}) and signed height kk:
∫ab⌊g(x)⌋ dx=∑(height k)×(width of sub-interval)\int_a^b \lfloor g(x) \rfloor \, dx = \sum \big( \text{height } k \big) \times \big( \text{width of sub-interval} \big)

What if ⌊g(x)⌋\lfloor g(x) \rfloor is only a part of the integrand—for example, ∫abx⌊x2⌋ dx\int_a^b x \lfloor x^2 \rfloor \, dx or ∫abe⌊x⌋ dx\int_a^b e^{\lfloor x \rfloor} \, dx? We still find the exact same jump points where g(x)g(x) reaches an integer, split the integral at those points, replace ⌊g(x)⌋\lfloor g(x) \rfloor by its constant integer value kk on each sub-interval, and integrate the remaining smooth function of xx!

Staircase area under the greatest integer function floor(x) from 0 to 3


Example 3

Evaluate:

∫03⌊x⌋ dx\int_0^3 \lfloor x \rfloor \, dx

Solution:

Look at the staircase graph of y=⌊x⌋y = \lfloor x \rfloor on [0,3][0, 3] above. Instead of computing antiderivatives, we simply read off the areas of the three rectangles on [0,1][0, 1], [1,2][1, 2], and [2,3][2, 3]:

  • On [0,1)[0, 1), height =0= 0 and width =1−0=1  ⟹  Area1=0×1=0= 1 - 0 = 1 \implies \text{Area}_1 = 0 \times 1 = 0.
  • On [1,2)[1, 2), height =1= 1 and width =2−1=1  ⟹  Area2=1×1=1= 2 - 1 = 1 \implies \text{Area}_2 = 1 \times 1 = 1.
  • On [2,3)[2, 3), height =2= 2 and width =3−2=1  ⟹  Area3=2×1=2= 3 - 2 = 1 \implies \text{Area}_3 = 2 \times 1 = 2.
  • At x=3x = 3, the isolated point (3,3)(3, 3) has width 0  ⟹  Area=00 \implies \text{Area} = 0.

Adding the rectangle areas directly gives:

∫03⌊x⌋ dx=0+1+2=3\int_0^3 \lfloor x \rfloor \, dx = 0 + 1 + 2 = 3

Example 4

Evaluate:

∫01⌊x2+x+1⌋ dx\int_0^1 \lfloor x^2 + x + 1 \rfloor \, dx

Solution:

Let us sketch the inner function g(x)=x2+x+1g(x) = x^2 + x + 1 on [0,1][0, 1] to see how it behaves:

  • At x=0x = 0, g(0)=02+0+1=1g(0) = 0^2 + 0 + 1 = 1.
  • For x∈[0,1]x \in [0, 1], g′(x)=2x+1>0g'(x) = 2x + 1 > 0, so g(x)g(x) is strictly increasing.
  • At x=1x = 1, g(1)=12+1+1=3g(1) = 1^2 + 1 + 1 = 3.

As xx moves from 00 to 11, g(x)g(x) rises continuously from y=1y = 1 to y=3y = 3. Drawing horizontal lines at the integer levels y=1,2,3y = 1, 2, 3, we see that the curve crosses the horizontal line y=2y = 2 at a single interior point:

x2+x+1=2  ⟹  x2+x−1=0x^2 + x + 1 = 2 \implies x^2 + x - 1 = 0

Using the quadratic formula (and keeping the positive root inside [0,1][0, 1]):

x=−1+1−4(1)(−1)2=5−12x = \frac{-1 + \sqrt{1 - 4(1)(-1)}}{2} = \frac{\sqrt{5} - 1}{2}

Sketching y = x^2 + x + 1 and reading off the two rectangles for floor(x^2 + x + 1)

Looking at the right panel of the figure above, the region under y=⌊x2+x+1⌋y = \lfloor x^2 + x + 1 \rfloor consists of just two rectangles:

  1. Rectangle R1R_1 on [0,5−12)\left[0, \frac{\sqrt{5}-1}{2}\right): Here 1≤x2+x+1<21 \le x^2 + x + 1 < 2, so the height is 11 and the base is 5−12−0=5−12\frac{\sqrt{5}-1}{2} - 0 = \frac{\sqrt{5}-1}{2}.
  2. Rectangle R2R_2 on [5−12,1)\left[\frac{\sqrt{5}-1}{2}, 1\right): Here 2≤x2+x+1<32 \le x^2 + x + 1 < 3, so the height is 22 and the base is 1−5−121 - \frac{\sqrt{5}-1}{2}.
  3. At the single point x=1x = 1, the height jumps to 33, which has width 00 and area 00.

Writing the integral directly as the sum of the two rectangle areas:

∫01⌊x2+x+1⌋ dx=1⋅(5−12−0)+2⋅(1−5−12)\int_0^1 \lfloor x^2 + x + 1 \rfloor \, dx = 1 \cdot \left( \frac{\sqrt{5} - 1}{2} - 0 \right) + 2 \cdot \left( 1 - \frac{\sqrt{5} - 1}{2} \right)

Simplifying the expression:

∫01⌊x2+x+1⌋ dx=2−5−12=5−52\int_0^1 \lfloor x^2 + x + 1 \rfloor \, dx = 2 - \frac{\sqrt{5} - 1}{2} = \frac{5 - \sqrt{5}}{2}

Example 5

Evaluate:

∫0π⌊2sin⁡x⌋ dx\int_0^\pi \lfloor 2\sin x \rfloor \, dx

Solution:

Here the inner function g(x)=2sin⁡xg(x) = 2\sin x is not monotonic on [0,π][0, \pi]—it rises from 00 to a peak and then falls back to 00. Sketching y=2sin⁡xy = 2\sin x on [0,π][0, \pi] makes the behavior crystal clear:

  • As xx goes from 00 to π2\frac{\pi}{2}, 2sin⁡x2\sin x rises from 00 to 22, crossing the line y=1y = 1 at sin⁡x=12  ⟹  x=π6\sin x = \frac{1}{2} \implies x = \frac{\pi}{6}.
  • At the peak x=π2x = \frac{\pi}{2}, 2sin⁡(π2)=22\sin\left(\frac{\pi}{2}\right) = 2 at a single isolated point!
  • As xx goes from π2\frac{\pi}{2} to π\pi, 2sin⁡x2\sin x falls from 22 back to 00, crossing the line y=1y = 1 again at x=5π6x = \frac{5\pi}{6}.

Graph of y = 2 sin x and the single rectangle formed by y = floor(2 sin x) on 0 to pi

Look at the graph of y=⌊2sin⁡x⌋y = \lfloor 2\sin x \rfloor in the figure above:

  • On [0,π6)\left[0, \frac{\pi}{6}\right) and (5π6,π]\left(\frac{5\pi}{6}, \pi\right], 0≤2sin⁡x<10 \le 2\sin x < 1, so the step height is 00 (zero area).
  • At x=π2x = \frac{\pi}{2}, ⌊2sin⁡x⌋=2\lfloor 2\sin x \rfloor = 2, which is a single point of width 00 (zero area).
  • Everywhere else between x=π6x = \frac{\pi}{6} and x=5π6x = \frac{5\pi}{6}, the step height is 11!

Thus, the entire area under y=⌊2sin⁡x⌋y = \lfloor 2\sin x \rfloor is a single rectangle of height 11 extending from x=π6x = \frac{\pi}{6} to x=5π6x = \frac{5\pi}{6}:

∫0π⌊2sin⁡x⌋ dx=1×(5π6−π6)=4π6=2π3\int_0^\pi \lfloor 2\sin x \rfloor \, dx = 1 \times \left( \frac{5\pi}{6} - \frac{\pi}{6} \right) = \frac{4\pi}{6} = \frac{2\pi}{3}

Situation 3: Hidden Jumps in the Antiderivative Formula (The Classic Trap!)§

This is one of the most important—and most frequently misunderstood—situations in definite integration.

Sometimes, the integrand f(x)f(x) you are asked to integrate is completely continuous and smooth across the entire interval [a,b][a, b]. Yet when you use standard integration tricks—such as dividing numerator and denominator by cos⁡2x\cos^2 x (to write the integral in terms of tan⁡x\tan x) or dividing by x2x^2 (to write it in terms of x−1xx - \frac{1}{x})—the antiderivative formula F(x)F(x) you obtain has a jump discontinuity at some interior point x=cx = c!

If F(x)F(x) jumps at x=cx = c so that F(c−)≠F(c+)F(c^-) \neq F(c^+), then plugging in only the outer endpoints F(b)−F(a)F(b) - F(a) misses the jump F(c−)−F(c+)F(c^-) - F(c^+) and gives a completely wrong answer!

Let us see how our [a,c−h][a, c-h] and [c+h,b][c+h, b] method exposes and fixes this trap immediately.

Smooth integrand f(x) = 1/(1 + sin^2 x) versus its discontinuous antiderivative formula F(x) jumping at x = pi/2


Example 6

Evaluate:

∫0π11+sin⁡2x dx\int_0^\pi \frac{1}{1 + \sin^2 x} \, dx

Solution:

First, look at the integrand f(x)=11+sin⁡2xf(x) = \frac{1}{1 + \sin^2 x}. Since 1≤1+sin⁡2x≤21 \le 1 + \sin^2 x \le 2, the function f(x)f(x) is smooth and strictly positive everywhere on [0,π][0, \pi]. Therefore, the area under the curve must be a strictly positive number!

Now let us find the indefinite integral using the standard method: divide both the numerator and the denominator by cos⁡2x\cos^2 x:

∫11+sin⁡2x dx=∫sec⁡2xsec⁡2x+tan⁡2x dx=∫sec⁡2x1+2tan⁡2x dx\int \frac{1}{1 + \sin^2 x} \, dx = \int \frac{\sec^2 x}{\sec^2 x + \tan^2 x} \, dx = \int \frac{\sec^2 x}{1 + 2\tan^2 x} \, dx

Using ∫du1+u2=tan⁡−1u\int \frac{du}{1 + u^2} = \tan^{-1} u with u=2tan⁡xu = \sqrt{2}\tan x and du=2sec⁡2x dxdu = \sqrt{2}\sec^2 x \, dx, we obtain the antiderivative formula:

F(x)=12tan⁡−1(2tan⁡x)F(x) = \frac{1}{\sqrt{2}} \tan^{-1}\big(\sqrt{2}\tan x\big)

[!CAUTION] The Trap of Blind Endpoint Substitution: Suppose we blindly write F(π)−F(0)F(\pi) - F(0) without checking whether F(x)F(x) is continuous on [0,π][0, \pi]:

F(π)−F(0)=12tan⁡−1(2tan⁡π)−12tan⁡−1(2tan⁡0)=0−0=0(WRONG!)F(\pi) - F(0) = \frac{1}{\sqrt{2}}\tan^{-1}\big(\sqrt{2}\tan \pi\big) - \frac{1}{\sqrt{2}}\tan^{-1}\big(\sqrt{2}\tan 0\big) = 0 - 0 = 0 \quad \text{(WRONG!)}

Why did F(π)−F(0)F(\pi) - F(0) fail? Because when we divided by cos⁡2x\cos^2 x, we divided by 00 at x=π2x = \frac{\pi}{2}! At x=π2x = \frac{\pi}{2}, tan⁡x\tan x is undefined and jumps from +∞+\infty (on the left of π2\frac{\pi}{2}) to −∞-\infty (on the right of π2\frac{\pi}{2}). Consequently, F(x)F(x) has a jump discontinuity at c=π2c = \frac{\pi}{2}!

The Correct Evaluation Using [0,π2−h][0, \frac{\pi}{2}-h] and [π2+h,π][\frac{\pi}{2}+h, \pi]:

Because c=π2c = \frac{\pi}{2} is a point of discontinuity of F(x)F(x), we split [0,π][0, \pi] around c=π2c = \frac{\pi}{2}:

∫0π11+sin⁡2x dx=lim⁡h→0+∫0π2−h11+sin⁡2x dx+lim⁡h→0+∫π2+hπ11+sin⁡2x dx\int_0^\pi \frac{1}{1 + \sin^2 x} \, dx = \lim_{h \to 0^+} \int_0^{\frac{\pi}{2}-h} \frac{1}{1 + \sin^2 x} \, dx + \lim_{h \to 0^+} \int_{\frac{\pi}{2}+h}^\pi \frac{1}{1 + \sin^2 x} \, dx

On [0,π2−h]\left[0, \frac{\pi}{2}-h\right] and on [π2+h,π]\left[\frac{\pi}{2}+h, \pi\right], our antiderivative F(x)=12tan⁡−1(2tan⁡x)F(x) = \frac{1}{\sqrt{2}} \tan^{-1}\big(\sqrt{2}\tan x\big) is completely continuous:

∫0π11+sin⁡2x dx=[F(π2−)−F(0)]+[F(π)−F(π2+)]\int_0^\pi \frac{1}{1 + \sin^2 x} \, dx = \Big[ F\left(\tfrac{\pi}{2}^-\right) - F(0) \Big] + \Big[ F(\pi) - F\left(\tfrac{\pi}{2}^+\right) \Big]

Let us compute the two one-sided limits at x=π2x = \frac{\pi}{2}:

Left-Hand Limit at π2\frac{\pi}{2}: As x→π2−x \to \frac{\pi}{2}^- (approaching π2\frac{\pi}{2} from the first quadrant), tan⁡x→+∞\tan x \to +\infty, so tan⁡−1(2tan⁡x)→+π2\tan^{-1}(\sqrt{2}\tan x) \to +\frac{\pi}{2}:

F(π2−)=lim⁡h→0+12tan⁡−1(2tan⁡(π2−h))=12(+π2)=π22F\left(\frac{\pi}{2}^-\right) = \lim_{h \to 0^+} \frac{1}{\sqrt{2}} \tan^{-1}\left(\sqrt{2}\tan\left(\frac{\pi}{2} - h\right)\right) = \frac{1}{\sqrt{2}} \left( +\frac{\pi}{2} \right) = \frac{\pi}{2\sqrt{2}}

Right-Hand Limit at π2\frac{\pi}{2}: As x→π2+x \to \frac{\pi}{2}^+ (approaching π2\frac{\pi}{2} from the second quadrant), tan⁡x→−∞\tan x \to -\infty, so tan⁡−1(2tan⁡x)→−π2\tan^{-1}(\sqrt{2}\tan x) \to -\frac{\pi}{2}:

F(π2+)=lim⁡h→0+12tan⁡−1(2tan⁡(π2+h))=12(−π2)=−π22F\left(\frac{\pi}{2}^+\right) = \lim_{h \to 0^+} \frac{1}{\sqrt{2}} \tan^{-1}\left(\sqrt{2}\tan\left(\frac{\pi}{2} + h\right)\right) = \frac{1}{\sqrt{2}} \left( -\frac{\pi}{2} \right) = -\frac{\pi}{2\sqrt{2}}

Substituting F(0)=0F(0) = 0, F(π)=0F(\pi) = 0, F(π2−)=π22F\left(\frac{\pi}{2}^-\right) = \frac{\pi}{2\sqrt{2}}, and F(π2+)=−π22F\left(\frac{\pi}{2}^+\right) = -\frac{\pi}{2\sqrt{2}} into our formula gives:

∫0π11+sin⁡2x dx=(π22−0)+(0−(−π22))=π22+π22=π2\int_0^\pi \frac{1}{1 + \sin^2 x} \, dx = \left( \frac{\pi}{2\sqrt{2}} - 0 \right) + \left( 0 - \left(-\frac{\pi}{2\sqrt{2}}\right) \right) = \frac{\pi}{2\sqrt{2}} + \frac{\pi}{2\sqrt{2}} = \frac{\pi}{\sqrt{2}}

Miscellaneous Examples§


Example 1§

Evaluate:

∫−12(∣x∣+∣x−1∣) dx\int_{-1}^2 \big( |x| + |x - 1| \big) \, dx

Solution:

The integrand has two modulus terms: ∣x∣|x| (which has a sharp corner at x=0x = 0) and ∣x−1∣|x - 1| (which has a sharp corner at x=1x = 1). Both x=0x = 0 and x=1x = 1 lie inside the interval [−1,2][-1, 2].

We therefore split [−1,2][-1, 2] at x=0x = 0 and x=1x = 1 into three sub-intervals: [−1,0][-1, 0], [0,1][0, 1], and [1,2][1, 2]. Let us write the simplified formula for f(x)=∣x∣+∣x−1∣f(x) = |x| + |x - 1| on each sub-interval:

  • On [−1,0][-1, 0]: Both x≤0x \le 0 and x−1<0x - 1 < 0, so ∣x∣=−x|x| = -x and ∣x−1∣=−(x−1)=1−x|x - 1| = -(x - 1) = 1 - x. Thus:
f(x)=−x+(1−x)=1−2xf(x) = -x + (1 - x) = 1 - 2x
  • On [0,1][0, 1]: Here x≥0x \ge 0 while x−1≤0x - 1 \le 0, so ∣x∣=x|x| = x and ∣x−1∣=1−x|x - 1| = 1 - x. Thus:
f(x)=x+(1−x)=1f(x) = x + (1 - x) = 1
  • On [1,2][1, 2]: Both x>0x > 0 and x−1≥0x - 1 \ge 0, so ∣x∣=x|x| = x and ∣x−1∣=x−1|x - 1| = x - 1. Thus:
f(x)=x+(x−1)=2x−1f(x) = x + (x - 1) = 2x - 1

Summing the definite integrals over the three pieces:

∫−12(∣x∣+∣x−1∣) dx=∫−10(1−2x) dx+∫011 dx+∫12(2x−1) dx\int_{-1}^2 \big( |x| + |x - 1| \big) \, dx = \int_{-1}^0 (1 - 2x) \, dx + \int_0^1 1 \, dx + \int_1^2 (2x - 1) \, dx

Evaluating each piece by the First Fundamental Theorem of Calculus:

∫−10(1−2x) dx=[x−x2]−10=0−(−1−(−1)2)=0−(−2)=2\int_{-1}^0 (1 - 2x) \, dx = \Big[ x - x^2 \Big]_{-1}^0 = 0 - \big( -1 - (-1)^2 \big) = 0 - (-2) = 2 ∫011 dx=[x]01=1−0=1\int_0^1 1 \, dx = \Big[ x \Big]_0^1 = 1 - 0 = 1 ∫12(2x−1) dx=[x2−x]12=(4−2)−(1−1)=2−0=2\int_1^2 (2x - 1) \, dx = \Big[ x^2 - x \Big]_1^2 = (4 - 2) - (1 - 1) = 2 - 0 = 2

Adding the three pieces together:

∫−12(∣x∣+∣x−1∣) dx=2+1+2=5\int_{-1}^2 \big( |x| + |x - 1| \big) \, dx = 2 + 1 + 2 = 5

Example 2§

Evaluate:

∫0π∣cos⁡x∣ dx\int_0^\pi |\cos x| \, dx

Solution:

On the interval [0,π][0, \pi], cos⁡x\cos x changes sign at x=π2x = \frac{\pi}{2}:

  • For 0≤x≤π20 \le x \le \frac{\pi}{2} (First Quadrant), cos⁡x≥0\cos x \ge 0, so ∣cos⁡x∣=cos⁡x|\cos x| = \cos x.
  • For π2≤x≤π\frac{\pi}{2} \le x \le \pi (Second Quadrant), cos⁡x≤0\cos x \le 0, so ∣cos⁡x∣=−cos⁡x|\cos x| = -\cos x.

Splitting the integral at the corner point x=π2x = \frac{\pi}{2}:

∫0π∣cos⁡x∣ dx=∫0π/2cos⁡x dx+∫π/2π(−cos⁡x) dx\int_0^\pi |\cos x| \, dx = \int_0^{\pi/2} \cos x \, dx + \int_{\pi/2}^\pi (-\cos x) \, dx

Applying the First Fundamental Theorem of Calculus on each piece:

∫0π∣cos⁡x∣ dx=[sin⁡x]0π/2+[−sin⁡x]π/2π\int_0^\pi |\cos x| \, dx = \Big[ \sin x \Big]_0^{\pi/2} + \Big[ -\sin x \Big]_{\pi/2}^\pi =(sin⁡π2−sin⁡0)+(−sin⁡π−(−sin⁡π2))=(1−0)+(0+1)=2= \left( \sin \frac{\pi}{2} - \sin 0 \right) + \left( -\sin \pi - \left( -\sin \frac{\pi}{2} \right) \right) = (1 - 0) + (0 + 1) = 2

Example 3§

Evaluate:

∫03/2⌊2x⌋ dx\int_0^{3/2} \lfloor 2x \rfloor \, dx

Solution:

As xx varies from 00 to 32\frac{3}{2}, the inner expression 2x2x varies from 00 to 33. Therefore, ⌊2x⌋\lfloor 2x \rfloor jumps whenever 2x2x reaches an integer (2x=1,2,32x = 1, 2, 3):

  • 2x=1  ⟹  x=122x = 1 \implies x = \frac{1}{2}
  • 2x=2  ⟹  x=12x = 2 \implies x = 1
  • 2x=3  ⟹  x=322x = 3 \implies x = \frac{3}{2}

This partitions [0,32]\left[0, \frac{3}{2}\right] into three sub-intervals of length 12\frac{1}{2} each:

  • On [0,12)\left[0, \frac{1}{2}\right), 0≤2x<1  ⟹  ⌊2x⌋=00 \le 2x < 1 \implies \lfloor 2x \rfloor = 0.
  • On [12,1)\left[\frac{1}{2}, 1\right), 1≤2x<2  ⟹  ⌊2x⌋=11 \le 2x < 2 \implies \lfloor 2x \rfloor = 1.
  • On [1,32)\left[1, \frac{3}{2}\right), 2≤2x<3  ⟹  ⌊2x⌋=22 \le 2x < 3 \implies \lfloor 2x \rfloor = 2.

Splitting the integral at x=12x = \frac{1}{2} and x=1x = 1:

∫03/2⌊2x⌋ dx=∫01/20 dx+∫1/211 dx+∫13/22 dx\int_0^{3/2} \lfloor 2x \rfloor \, dx = \int_0^{1/2} 0 \, dx + \int_{1/2}^1 1 \, dx + \int_1^{3/2} 2 \, dx =0+1(1−12)+2(32−1)=0+12+1=32= 0 + 1\left(1 - \frac{1}{2}\right) + 2\left(\frac{3}{2} - 1\right) = 0 + \frac{1}{2} + 1 = \frac{3}{2}

Example 4§

Evaluate:

∫03{x} dx\int_0^3 \{x\} \, dx

where {x}=x−⌊x⌋\{x\} = x - \lfloor x \rfloor denotes the fractional part of xx.

Solution:

The fractional part function {x}=x−⌊x⌋\{x\} = x - \lfloor x \rfloor is continuous on every open unit interval (n,n+1)(n, n+1) and has a jump discontinuity at each integer x=1,2,3x = 1, 2, 3:

  • On [0,1)[0, 1), ⌊x⌋=0  ⟹  {x}=x\lfloor x \rfloor = 0 \implies \{x\} = x.
  • On [1,2)[1, 2), ⌊x⌋=1  ⟹  {x}=x−1\lfloor x \rfloor = 1 \implies \{x\} = x - 1.
  • On [2,3)[2, 3), ⌊x⌋=2  ⟹  {x}=x−2\lfloor x \rfloor = 2 \implies \{x\} = x - 2.

Splitting the interval [0,3][0, 3] at the points of discontinuity x=1x = 1 and x=2x = 2:

∫03{x} dx=∫01x dx+∫12(x−1) dx+∫23(x−2) dx\int_0^3 \{x\} \, dx = \int_0^1 x \, dx + \int_1^2 (x - 1) \, dx + \int_2^3 (x - 2) \, dx

Evaluating each piece using its antiderivative:

∫01x dx=[x22]01=12−0=12\int_0^1 x \, dx = \left[ \frac{x^2}{2} \right]_0^1 = \frac{1}{2} - 0 = \frac{1}{2} ∫12(x−1) dx=[(x−1)22]12=12−0=12\int_1^2 (x - 1) \, dx = \left[ \frac{(x - 1)^2}{2} \right]_1^2 = \frac{1}{2} - 0 = \frac{1}{2} ∫23(x−2) dx=[(x−2)22]23=12−0=12\int_2^3 (x - 2) \, dx = \left[ \frac{(x - 2)^2}{2} \right]_2^3 = \frac{1}{2} - 0 = \frac{1}{2}

Summing the three pieces gives:

∫03{x} dx=12+12+12=32\int_0^3 \{x\} \, dx = \frac{1}{2} + \frac{1}{2} + \frac{1}{2} = \frac{3}{2}

(Geometrically, the graph of y={x}y = \{x\} on [0,3][0, 3] consists of three identical right-angled triangles, each of base 11 and height 11, so each triangle has area 12×1×1=12\frac{1}{2} \times 1 \times 1 = \frac{1}{2}, giving a total area of 3×12=323 \times \frac{1}{2} = \frac{3}{2}.)


Example 5§

Evaluate:

∫13x⌊x⌋ dx\int_1^3 x \lfloor x \rfloor \, dx

Solution:

Inside the interval [1,3][1, 3], the greatest integer function ⌊x⌋\lfloor x \rfloor jumps at x=2x = 2 (and at the endpoint x=3x = 3):

  • On [1,2)[1, 2), ⌊x⌋=1\lfloor x \rfloor = 1, so the integrand is x⋅1=xx \cdot 1 = x.
  • On [2,3)[2, 3), ⌊x⌋=2\lfloor x \rfloor = 2, so the integrand is x⋅2=2xx \cdot 2 = 2x.

Splitting the integral at x=2x = 2:

∫13x⌊x⌋ dx=∫12x dx+∫232x dx\int_1^3 x \lfloor x \rfloor \, dx = \int_1^2 x \, dx + \int_2^3 2x \, dx

Applying the First Fundamental Theorem of Calculus on each piece:

∫13x⌊x⌋ dx=[x22]12+[x2]23=(42−12)+(9−4)=32+5=132\int_1^3 x \lfloor x \rfloor \, dx = \left[ \frac{x^2}{2} \right]_1^2 + \Big[ x^2 \Big]_2^3 = \left( \frac{4}{2} - \frac{1}{2} \right) + (9 - 4) = \frac{3}{2} + 5 = \frac{13}{2}

Example 6§

Evaluate:

∫−11x2+1x4+1 dx\int_{-1}^1 \frac{x^2 + 1}{x^4 + 1} \, dx

Solution:

Recall from Section 03 that to integrate x2+1x4+1\frac{x^2 + 1}{x^4 + 1}, we divide the numerator and denominator by x2x^2:

∫1+1x2(x−1x)2+(2)2 dx=12tan⁡−1(x2−1x2)+C\int \frac{1 + \frac{1}{x^2}}{\left(x - \frac{1}{x}\right)^2 + (\sqrt{2})^2} \, dx = \frac{1}{\sqrt{2}} \tan^{-1} \left( \frac{x^2 - 1}{x\sqrt{2}} \right) + C

Let F(x)=12tan⁡−1(x2−1x2)F(x) = \frac{1}{\sqrt{2}} \tan^{-1} \left( \frac{x^2 - 1}{x\sqrt{2}} \right).

Look carefully at the denominator inside tan⁡−1\tan^{-1}: it contains x2x\sqrt{2}, which becomes 00 at x=0x = 0! Since x=0x = 0 lies right in the middle of our interval [−1,1][-1, 1], F(x)F(x) has a jump discontinuity at c=0c = 0.

(Notice that if you blindly plugged in x=1x = 1 and x=−1x = -1, you would get F(1)−F(−1)=0−0=0F(1) - F(-1) = 0 - 0 = 0, which is impossible since x2+1x4+1>0\frac{x^2+1}{x^4+1} > 0 everywhere!)

Using our [−1,0−h][ -1, 0 - h ] and [0+h,1][ 0 + h, 1 ] formula around the trouble spot c=0c = 0:

∫−11x2+1x4+1 dx=[F(0−)−F(−1)]+[F(1)−F(0+)]\int_{-1}^1 \frac{x^2 + 1}{x^4 + 1} \, dx = \Big[ F(0^-) - F(-1) \Big] + \Big[ F(1) - F(0^+) \Big]

Let us evaluate each term:

At the outer endpoints: At x=−1x = -1 and x=1x = 1, we have x2−1=0x^2 - 1 = 0, so:

F(−1)=12tan⁡−1(0)=0andF(1)=12tan⁡−1(0)=0F(-1) = \frac{1}{\sqrt{2}} \tan^{-1}(0) = 0 \quad \text{and} \quad F(1) = \frac{1}{\sqrt{2}} \tan^{-1}(0) = 0

Left-Hand Limit at 00: As x→0−x \to 0^- (approaching 00 through negative numbers), the numerator x2−1→−1x^2 - 1 \to -1 (negative) and the denominator x2→0−x\sqrt{2} \to 0^- (negative). A negative number divided by a tiny negative number goes to +∞+\infty:

F(0−)=lim⁡h→0+12tan⁡−1((−h)2−1−h2)=12tan⁡−1(+∞)=π22F(0^-) = \lim_{h \to 0^+} \frac{1}{\sqrt{2}} \tan^{-1} \left( \frac{(-h)^2 - 1}{-h\sqrt{2}} \right) = \frac{1}{\sqrt{2}} \tan^{-1}(+\infty) = \frac{\pi}{2\sqrt{2}}

Right-Hand Limit at 00: As x→0+x \to 0^+ (approaching 00 through positive numbers), the numerator x2−1→−1x^2 - 1 \to -1 (negative) and the denominator x2→0+x\sqrt{2} \to 0^+ (positive), so the fraction goes to −∞-\infty:

F(0+)=lim⁡h→0+12tan⁡−1(h2−1h2)=12tan⁡−1(−∞)=−π22F(0^+) = \lim_{h \to 0^+} \frac{1}{\sqrt{2}} \tan^{-1} \left( \frac{h^2 - 1}{h\sqrt{2}} \right) = \frac{1}{\sqrt{2}} \tan^{-1}(-\infty) = -\frac{\pi}{2\sqrt{2}}

Combining the two pieces gives the exact value of the integral:

∫−11x2+1x4+1 dx=(π22−0)+(0−(−π22))=π2\int_{-1}^1 \frac{x^2 + 1}{x^4 + 1} \, dx = \left( \frac{\pi}{2\sqrt{2}} - 0 \right) + \left( 0 - \left(-\frac{\pi}{2\sqrt{2}}\right) \right) = \frac{\pi}{\sqrt{2}}

Example 7§

Evaluate:

∫0π1−sin⁡2x dx\int_0^\pi \sqrt{1 - \sin 2x} \, dx

Solution:

Using the trigonometric identities 1=sin⁡2x+cos⁡2x1 = \sin^2 x + \cos^2 x and sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x \cos x, the expression inside the square root is a perfect square:

1−sin⁡2x=sin⁡2x+cos⁡2x−2sin⁡xcos⁡x=(sin⁡x−cos⁡x)21 - \sin 2x = \sin^2 x + \cos^2 x - 2\sin x \cos x = (\sin x - \cos x)^2

Now be very careful when taking the square root! For any real number uu, u2=∣u∣\sqrt{u^2} = |u| (never simply uu):

1−sin⁡2x=(sin⁡x−cos⁡x)2=∣sin⁡x−cos⁡x∣\sqrt{1 - \sin 2x} = \sqrt{(\sin x - \cos x)^2} = |\sin x - \cos x|

Where does sin⁡x−cos⁡x\sin x - \cos x change sign inside [0,π][0, \pi]? Setting sin⁡x=cos⁡x\sin x = \cos x gives tan⁡x=1\tan x = 1, so x=π4x = \frac{\pi}{4} is a corner point (point of non-differentiability):

  • On [0,π4]\left[0, \frac{\pi}{4}\right]: We have cos⁡x≥sin⁡x\cos x \ge \sin x, so sin⁡x−cos⁡x≤0\sin x - \cos x \le 0, which means:
∣sin⁡x−cos⁡x∣=cos⁡x−sin⁡x|\sin x - \cos x| = \cos x - \sin x
  • On [π4,π]\left[\frac{\pi}{4}, \pi\right]: We have sin⁡x≥cos⁡x\sin x \ge \cos x, so sin⁡x−cos⁡x≥0\sin x - \cos x \ge 0, which means:
∣sin⁡x−cos⁡x∣=sin⁡x−cos⁡x|\sin x - \cos x| = \sin x - \cos x

Splitting the integral at x=π4x = \frac{\pi}{4}:

∫0π1−sin⁡2x dx=∫0π/4(cos⁡x−sin⁡x) dx+∫π/4π(sin⁡x−cos⁡x) dx\int_0^\pi \sqrt{1 - \sin 2x} \, dx = \int_0^{\pi/4} (\cos x - \sin x) \, dx + \int_{\pi/4}^\pi (\sin x - \cos x) \, dx

Evaluating each piece using the First Fundamental Theorem of Calculus:

∫0π/4(cos⁡x−sin⁡x) dx=[sin⁡x+cos⁡x]0π/4=(12+12)−(0+1)=2−1\int_0^{\pi/4} (\cos x - \sin x) \, dx = \Big[ \sin x + \cos x \Big]_0^{\pi/4} = \left( \frac{1}{\sqrt{2}} + \frac{1}{\sqrt{2}} \right) - (0 + 1) = \sqrt{2} - 1 ∫π/4π(sin⁡x−cos⁡x) dx=[−cos⁡x−sin⁡x]π/4π=(−(−1)−0)−(−12−12)=1+2\int_{\pi/4}^\pi (\sin x - \cos x) \, dx = \Big[ -\cos x - \sin x \Big]_{\pi/4}^\pi = \big( -(-1) - 0 \big) - \left( -\frac{1}{\sqrt{2}} - \frac{1}{\sqrt{2}} \right) = 1 + \sqrt{2}

Adding both pieces together:

∫0π1−sin⁡2x dx=(2−1)+(1+2)=22\int_0^\pi \sqrt{1 - \sin 2x} \, dx = (\sqrt{2} - 1) + (1 + \sqrt{2}) = 2\sqrt{2}

Example 8§

Evaluate:

∫02⌊x2−2x+2⌋ dx\int_0^2 \lfloor x^2 - 2x + 2 \rfloor \, dx

Solution:

Here the inner function is g(x)=x2−2x+2g(x) = x^2 - 2x + 2. To see its behavior on [0,2][0, 2], we complete the square:

g(x)=(x−1)2+1g(x) = (x - 1)^2 + 1

Let us sketch the parabola y=(x−1)2+1y = (x - 1)^2 + 1 over [0,2][0, 2]:

  • At x=0x = 0, g(0)=(−1)2+1=2g(0) = (-1)^2 + 1 = 2.
  • As xx goes from 00 to 11, g(x)g(x) decreases from 22 down to its vertex minimum g(1)=1g(1) = 1.
  • As xx goes from 11 to 22, g(x)g(x) increases from 11 back up to g(2)=2g(2) = 2.

Thus, for every interior point x∈(0,2)x \in (0, 2), the parabola lies strictly between y=1y = 1 and y=2y = 2:

1≤(x−1)2+1<2for all x∈(0,2)1 \le (x - 1)^2 + 1 < 2 \quad \text{for all } x \in (0, 2)

The value g(x)=2g(x) = 2 is reached only at the two single endpoints x=0x = 0 and x=2x = 2, which have width 00 and contribute zero area! Everywhere on the open interval (0,2)(0, 2), the step height is ⌊(x−1)2+1⌋=1\lfloor (x - 1)^2 + 1 \rfloor = 1.

Drawing the rectangle of height 11 and base 2−0=22 - 0 = 2 immediately gives:

∫02⌊x2−2x+2⌋ dx=1×(2−0)=2\int_0^2 \lfloor x^2 - 2x + 2 \rfloor \, dx = 1 \times (2 - 0) = 2

Example 9§

Evaluate:

∫02x⌊x2⌋ dx\int_0^2 x \lfloor x^2 \rfloor \, dx

Solution:

Here the greatest integer function ⌊x2⌋\lfloor x^2 \rfloor is multiplied by xx. As xx increases from 00 to 22, x2x^2 increases from 00 to 44, hitting the integers 1,2,31, 2, 3 at:

x=1,x=2,x=3x = 1, \quad x = \sqrt{2}, \quad x = \sqrt{3}

We split the interval [0,2][0, 2] at these three points and replace ⌊x2⌋\lfloor x^2 \rfloor by its constant integer value on each sub-interval:

  • On [0,1)[0, 1), ⌊x2⌋=0  ⟹  x⌊x2⌋=0\lfloor x^2 \rfloor = 0 \implies x \lfloor x^2 \rfloor = 0.
  • On [1,2)[1, \sqrt{2}), ⌊x2⌋=1  ⟹  x⌊x2⌋=x\lfloor x^2 \rfloor = 1 \implies x \lfloor x^2 \rfloor = x.
  • On [2,3)[\sqrt{2}, \sqrt{3}), ⌊x2⌋=2  ⟹  x⌊x2⌋=2x\lfloor x^2 \rfloor = 2 \implies x \lfloor x^2 \rfloor = 2x.
  • On [3,2)[\sqrt{3}, 2), ⌊x2⌋=3  ⟹  x⌊x2⌋=3x\lfloor x^2 \rfloor = 3 \implies x \lfloor x^2 \rfloor = 3x.

Therefore:

∫02x⌊x2⌋ dx=∫010 dx+∫12x dx+∫232x dx+∫323x dx\int_0^2 x \lfloor x^2 \rfloor \, dx = \int_0^1 0 \, dx + \int_1^{\sqrt{2}} x \, dx + \int_{\sqrt{2}}^{\sqrt{3}} 2x \, dx + \int_{\sqrt{3}}^2 3x \, dx

Integrating each piece using ∫x dx=x22\int x \, dx = \frac{x^2}{2}:

∫02x⌊x2⌋ dx=0+[x22]12+2[x22]23+3[x22]32\int_0^2 x \lfloor x^2 \rfloor \, dx = 0 + \left[ \frac{x^2}{2} \right]_1^{\sqrt{2}} + 2\left[ \frac{x^2}{2} \right]_{\sqrt{2}}^{\sqrt{3}} + 3\left[ \frac{x^2}{2} \right]_{\sqrt{3}}^2 =2−12+2(3−22)+3(4−32)=12+22+32=62=3= \frac{2 - 1}{2} + 2\left( \frac{3 - 2}{2} \right) + 3\left( \frac{4 - 3}{2} \right) = \frac{1}{2} + \frac{2}{2} + \frac{3}{2} = \frac{6}{2} = 3

Example 10§

Evaluate:

∫03⌊x⌋ ∣x−2∣ dx\int_0^3 \lfloor x \rfloor \, |x - 2| \, dx

Solution:

This integrand combines both the greatest integer function ⌊x⌋\lfloor x \rfloor (which jumps at x=1x = 1 and x=2x = 2) and the modulus function ∣x−2∣|x - 2| (which has a sharp corner at x=2x = 2).

Splitting the interval [0,3][0, 3] at x=1x = 1 and x=2x = 2 takes care of both the jumps and the corner point simultaneously:

  • On [0,1)[0, 1): Here ⌊x⌋=0\lfloor x \rfloor = 0, so the entire product is:
⌊x⌋ ∣x−2∣=0⋅∣x−2∣=0\lfloor x \rfloor \, |x - 2| = 0 \cdot |x - 2| = 0
  • On [1,2)[1, 2): Here ⌊x⌋=1\lfloor x \rfloor = 1, and since x<2x < 2, we have ∣x−2∣=2−x|x - 2| = 2 - x. Thus:
⌊x⌋ ∣x−2∣=1⋅(2−x)=2−x\lfloor x \rfloor \, |x - 2| = 1 \cdot (2 - x) = 2 - x
  • On [2,3)[2, 3): Here ⌊x⌋=2\lfloor x \rfloor = 2, and since x≥2x \ge 2, we have ∣x−2∣=x−2|x - 2| = x - 2. Thus:
⌊x⌋ ∣x−2∣=2(x−2)=2x−4\lfloor x \rfloor \, |x - 2| = 2(x - 2) = 2x - 4

Summing the integrals over the three sub-intervals:

∫03⌊x⌋ ∣x−2∣ dx=∫010 dx+∫12(2−x) dx+∫23(2x−4) dx\int_0^3 \lfloor x \rfloor \, |x - 2| \, dx = \int_0^1 0 \, dx + \int_1^2 (2 - x) \, dx + \int_2^3 (2x - 4) \, dx

Applying the First Fundamental Theorem of Calculus to each piece:

∫12(2−x) dx=[2x−x22]12=(4−2)−(2−12)=2−32=12\int_1^2 (2 - x) \, dx = \left[ 2x - \frac{x^2}{2} \right]_1^2 = (4 - 2) - \left(2 - \frac{1}{2}\right) = 2 - \frac{3}{2} = \frac{1}{2} ∫23(2x−4) dx=[x2−4x]23=(9−12)−(4−8)=−3−(−4)=1\int_2^3 (2x - 4) \, dx = \Big[ x^2 - 4x \Big]_2^3 = (9 - 12) - (4 - 8) = -3 - (-4) = 1

Adding the pieces together gives:

∫03⌊x⌋ ∣x−2∣ dx=0+12+1=32\int_0^3 \lfloor x \rfloor \, |x - 2| \, dx = 0 + \frac{1}{2} + 1 = \frac{3}{2}

Example 11§

Evaluate:

∫−12∣⌊x⌋−x∣ dx\int_{-1}^2 \Big| \lfloor x \rfloor - x \Big| \, dx

Solution:

Recall that by definition of the greatest integer function, ⌊x⌋≤x\lfloor x \rfloor \le x for every real number xx, and x−⌊x⌋={x}≥0x - \lfloor x \rfloor = \{x\} \ge 0 is the fractional part of xx.

Therefore, ⌊x⌋−x=−{x}≤0\lfloor x \rfloor - x = -\{x\} \le 0, so taking its absolute value simply gives:

∣⌊x⌋−x∣=x−⌊x⌋={x}\Big| \lfloor x \rfloor - x \Big| = x - \lfloor x \rfloor = \{x\}

The interval [−1,2][-1, 2] contains three unit sub-intervals separated by the integer jump points x=0x = 0 and x=1x = 1:

  • On [−1,0)[-1, 0): ⌊x⌋=−1  ⟹  x−⌊x⌋=x−(−1)=x+1\lfloor x \rfloor = -1 \implies x - \lfloor x \rfloor = x - (-1) = x + 1.
  • On [0,1)[0, 1): ⌊x⌋=0  ⟹  x−⌊x⌋=x\lfloor x \rfloor = 0 \implies x - \lfloor x \rfloor = x.
  • On [1,2)[1, 2): ⌊x⌋=1  ⟹  x−⌊x⌋=x−1\lfloor x \rfloor = 1 \implies x - \lfloor x \rfloor = x - 1.

Splitting the integral at x=0x = 0 and x=1x = 1:

∫−12∣⌊x⌋−x∣ dx=∫−10(x+1) dx+∫01x dx+∫12(x−1) dx\int_{-1}^2 \Big| \lfloor x \rfloor - x \Big| \, dx = \int_{-1}^0 (x + 1) \, dx + \int_0^1 x \, dx + \int_1^2 (x - 1) \, dx

Evaluating each piece:

∫−10(x+1) dx=[(x+1)22]−10=12−0=12\int_{-1}^0 (x + 1) \, dx = \left[ \frac{(x + 1)^2}{2} \right]_{-1}^0 = \frac{1}{2} - 0 = \frac{1}{2} ∫01x dx=[x22]01=12−0=12\int_0^1 x \, dx = \left[ \frac{x^2}{2} \right]_0^1 = \frac{1}{2} - 0 = \frac{1}{2} ∫12(x−1) dx=[(x−1)22]12=12−0=12\int_1^2 (x - 1) \, dx = \left[ \frac{(x - 1)^2}{2} \right]_1^2 = \frac{1}{2} - 0 = \frac{1}{2}

Adding the three pieces gives:

∫−12∣⌊x⌋−x∣ dx=12+12+12=32\int_{-1}^2 \Big| \lfloor x \rfloor - x \Big| \, dx = \frac{1}{2} + \frac{1}{2} + \frac{1}{2} = \frac{3}{2}

Example 12§

Evaluate:

∫02e⌊x⌋+∣x−1∣ dx\int_0^2 e^{\lfloor x \rfloor + |x - 1|} \, dx

Solution:

The exponent ⌊x⌋+∣x−1∣\lfloor x \rfloor + |x - 1| has a jump discontinuity from ⌊x⌋\lfloor x \rfloor at x=1x = 1 (and at the endpoint x=2x = 2), as well as a corner point from ∣x−1∣|x - 1| at x=1x = 1.

Thus, x=1x = 1 is the only interior trouble spot inside (0,2)(0, 2). Let us simplify the integrand on [0,1)[0, 1) and on [1,2)[1, 2):

  • On [0,1)[0, 1): Here ⌊x⌋=0\lfloor x \rfloor = 0 and x−1<0  ⟹  ∣x−1∣=1−xx - 1 < 0 \implies |x - 1| = 1 - x. Therefore:
e⌊x⌋+∣x−1∣=e0+(1−x)=e1−xe^{\lfloor x \rfloor + |x - 1|} = e^{0 + (1 - x)} = e^{1 - x}
  • On [1,2)[1, 2): Here ⌊x⌋=1\lfloor x \rfloor = 1 and x−1≥0  ⟹  ∣x−1∣=x−1x - 1 \ge 0 \implies |x - 1| = x - 1. Therefore:
e⌊x⌋+∣x−1∣=e1+(x−1)=exe^{\lfloor x \rfloor + |x - 1|} = e^{1 + (x - 1)} = e^x

Splitting the integral at x=1x = 1:

∫02e⌊x⌋+∣x−1∣ dx=∫01e1−x dx+∫12ex dx\int_0^2 e^{\lfloor x \rfloor + |x - 1|} \, dx = \int_0^1 e^{1 - x} \, dx + \int_1^2 e^x \, dx

Applying the First Fundamental Theorem of Calculus on each piece:

∫01e1−x dx=[−e1−x]01=(−e0)−(−e1)=−1+e=e−1\int_0^1 e^{1 - x} \, dx = \Big[ -e^{1 - x} \Big]_0^1 = (-e^0) - (-e^1) = -1 + e = e - 1 ∫12ex dx=[ex]12=e2−e\int_1^2 e^x \, dx = \Big[ e^x \Big]_1^2 = e^2 - e

Adding the two pieces together, −e-e and +e+e cancel:

∫02e⌊x⌋+∣x−1∣ dx=(e−1)+(e2−e)=e2−1\int_0^2 e^{\lfloor x \rfloor + |x - 1|} \, dx = (e - 1) + (e^2 - e) = e^2 - 1

Example 13§

Evaluate:

∫0π(⌊sin⁡x⌋+⌊cos⁡x⌋) dx\int_0^\pi \big( \lfloor \sin x \rfloor + \lfloor \cos x \rfloor \big) \, dx

Solution:

Using the sum property of definite integrals, we can examine ⌊sin⁡x⌋\lfloor \sin x \rfloor and ⌊cos⁡x⌋\lfloor \cos x \rfloor on [0,π][0, \pi] using the graphical rectangle method:

Part 1 (Behavior of ⌊sin⁡x⌋\lfloor \sin x \rfloor on [0,π][0, \pi]): For every x∈[0,π]x \in [0, \pi] except the single point x=π2x = \frac{\pi}{2}, we have 0≤sin⁡x<10 \le \sin x < 1, so ⌊sin⁡x⌋=0\lfloor \sin x \rfloor = 0. At the single point x=π2x = \frac{\pi}{2}, ⌊sin⁡(π/2)⌋=1\lfloor \sin(\pi/2) \rfloor = 1, which has width 00 and contributes zero area! Thus:

∫0π⌊sin⁡x⌋ dx=0\int_0^\pi \lfloor \sin x \rfloor \, dx = 0

Part 2 (Behavior of ⌊cos⁡x⌋\lfloor \cos x \rfloor on [0,π][0, \pi]): As xx increases from 00 to π\pi, cos⁡x\cos x decreases from 11 to −1-1, crossing 00 at x=π2x = \frac{\pi}{2}:

  • At x=0x = 0, ⌊cos⁡0⌋=1\lfloor \cos 0 \rfloor = 1 (single point, zero area).
  • On (0,π2]\left(0, \frac{\pi}{2}\right], 0≤cos⁡x<1  ⟹  ⌊cos⁡x⌋=00 \le \cos x < 1 \implies \lfloor \cos x \rfloor = 0 (height 00, area 00).
  • On (π2,π]\left(\frac{\pi}{2}, \pi\right], −1≤cos⁡x<0  ⟹  ⌊cos⁡x⌋=−1-1 \le \cos x < 0 \implies \lfloor \cos x \rfloor = -1.

On (π2,π]\left(\frac{\pi}{2}, \pi\right], the graph forms a single rectangle below the xx-axis of signed height −1-1 and width π−π2=π2\pi - \frac{\pi}{2} = \frac{\pi}{2}:

∫0π⌊cos⁡x⌋ dx=0+(−1)×(π−π2)=−π2\int_0^\pi \lfloor \cos x \rfloor \, dx = 0 + (-1) \times \left( \pi - \frac{\pi}{2} \right) = -\frac{\pi}{2}

Combining both parts gives:

∫0π(⌊sin⁡x⌋+⌊cos⁡x⌋) dx=0+(−π2)=−π2\int_0^\pi \big( \lfloor \sin x \rfloor + \lfloor \cos x \rfloor \big) \, dx = 0 + \left( -\frac{\pi}{2} \right) = -\frac{\pi}{2}

Summary§

Trouble Spot Inside [a,b][a, b] Why It Happens How to Evaluate Safely
General Discontinuity at x=cx = c f(x)f(x) or F(x)F(x) has a break at x=c∈(a,b)x = c \in (a, b). Split into [a,c−h][a, c-h] and [c+h,b][c+h, b] as h→0+h \to 0^+: [F(c−)−F(a)]+[F(b)−F(c+)]\big[F(c^-) - F(a)\big] + \big[F(b) - F(c^+)\big].
Modulus / Corner Points Expressions like $ g(x)
Greatest Integer ⌊g(x)⌋\lfloor g(x) \rfloor Jumps whenever the inner function g(x)g(x) reaches an integer. Find all x∈(a,b)x \in (a, b) where g(x)∈Zg(x) \in \mathbb{Z}, split the interval there, and integrate the constant integer value on each piece.
Hidden Jump in Antiderivative F(x)F(x) Dividing by cos⁡2x\cos^2 x (using tan⁡x\tan x) or by x2x^2 (using x−1xx - \frac{1}{x}) makes F(x)F(x) jump at cos⁡x=0\cos x = 0 or x=0x = 0. Split at the point cc where the substitution is undefined and evaluate one-sided limits F(c−)F(c^-) and F(c+)F(c^+).
Section 4 of 15 · Definite Integration

Mark this section complete when you have worked through its proofs.