-
Notifications
You must be signed in to change notification settings - Fork 26
/
ch-multivar-int.tex
3781 lines (3454 loc) · 120 KB
/
ch-multivar-int.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\chapter{Multivariable Integral} \label{mi:chapter}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Riemann integral over rectangles}
\label{sec:rirect}
%mbxINTROSUBSECTION
\sectionnotes{2--3 lectures}
As in \chapterref{int:chapter}, we define the Riemann integral using the Darboux
upper and lower integrals. The ideas in this section are very similar to
integration in one dimension. The complication is mostly notational.
The differences between one and several dimensions will grow more pronounced
in the sections following.
\subsection{Rectangles and partitions}
\begin{defn}
Let $(a_1,a_2,\ldots,a_n)$ and
$(b_1,b_2,\ldots,b_n)$ be such that $a_k \leq b_k$ for all $k$.
The set
$[a_1,b_1] \times
[a_2,b_2] \times \cdots \times
[a_n,b_n]$ is called a \emph{\myindex{closed rectangle}}\index{rectangle}.
In this setting it is sometimes useful to allow $a_k = b_k$, in which case we
think of $[a_k,b_k] = \{ a_k \}$ as usual.
If $a_k < b_k$ for all $k$, then the set
$(a_1,b_1) \times
(a_2,b_2) \times \cdots \times
(a_n,b_n)$ is called an \emph{\myindex{open rectangle}}.
For an open or closed rectangle
$R \coloneqq [a_1,b_1] \times
[a_2,b_2] \times \cdots \times
[a_n,b_n] \subset \R^n$
or
$R \coloneqq (a_1,b_1) \times
(a_2,b_2) \times \cdots \times
(a_n,b_n) \subset \R^n$,
we define the
\emph{$n$-dimensional volume}%
\index{n-dimensional volume@$n$-dimensional volume!rectangles}%
\index{volume of rectangles} by
\glsadd{not:ndimvolume}
\begin{equation*}
V(R) \coloneqq
(b_1-a_1)
(b_2-a_2)
\cdots
(b_n-a_n) .
\end{equation*}
A \emph{\myindex{partition}} $P$ of the closed rectangle
$R = [a_1,b_1] \times
[a_2,b_2] \times \cdots \times
[a_n,b_n]$
is given by
partitions $P_1,P_2,\ldots,P_n$ of the intervals
$[a_1,b_1], [a_2,b_2],\ldots, [a_n,b_n]$.
We write $P=(P_1,P_2,\ldots,P_n)$.
That is, for every $k=1,2,\ldots,n$ there is an integer $\ell_k$ and
a finite set of numbers
$P_k = \{ x_{k,0},x_{k,1},x_{k,2},\ldots,x_{k,\ell_k} \}$ such that
\begin{equation*}
a_k = x_{k,0} < x_{k,1} < x_{k,2} < \cdots < x_{k,{\ell_k}-1} < x_{k,\ell_k} = b_k .
\end{equation*}
Picking a set of $n$ integers $j_1,j_2,\ldots,j_n$ where
$j_k \in \{ 1,2,\ldots,\ell_k \}$ we get
the
\emph{\myindex{subrectangle}}
\begin{equation*}
[x_{1,j_1-1}~,~ x_{1,j_1}]
\times
[x_{2,j_2-1}~,~ x_{2,j_2}]
\times
\cdots
\times
[x_{n,j_n-1}~,~ x_{n,j_n}] .
\end{equation*}
We order the subrectangles somehow and
we say $\{R_1,R_2,\ldots,R_N\}$ are the subrectangles corresponding
to the partition $P$ of $R$, or more simply, subrectangles of
$P$.
In other words, we subdivided the original rectangle into many smaller
subrectangles. See \figureref{mv:figrect}.
\begin{myfigureht}
\subimport*{figures/}{figrect.pdf_t}
\caption{Example partition of a rectangle in $\R^2$. The order of the
subrectangles is not important.\label{mv:figrect}}
\end{myfigureht}
Let $R \subset \R^n$ be a closed rectangle and
let $f \colon R \to \R$ be a bounded function. Let $P$ be a partition of
$R$ with $N$ subrectangles $R_1,R_2,\ldots,R_N$.
Define
\glsadd{not:lowerdarbouxsum}
\glsadd{not:upperdarbouxsum}
\begin{align*}
& m_i \coloneqq \inf \bigl\{ f(x) : x \in R_i \bigr\} , &
& M_i \coloneqq \sup \bigl\{ f(x) : x \in R_i \bigr\} , \\
& L(P,f) \coloneqq
\sum_{i=1}^N m_i V(R_i) , &
& U(P,f) \coloneqq
\sum_{i=1}^N M_i V(R_i) .
\end{align*}
We call $L(P,f)$ the \emph{\myindex{lower Darboux sum}} and
$U(P,f)$ the \emph{\myindex{upper Darboux sum}}\index{Darboux sum}.
\end{defn}
To see the relationship to the $\Delta$ notation from the one-variable
definition, note that when
\begin{equation*}
R_i = [x_{1,j_1-1}~,~ x_{1,j_1}]
\times
[x_{2,j_2-1}~,~ x_{2,j_2}]
\times
\cdots
\times
[x_{n,j_n-1}~,~ x_{n,j_n}] ,
\end{equation*}
then
\begin{equation*}
V(R_i)
=
(x_{1,j_1}-x_{1,j_1-1})
(x_{2,j_2}-x_{2,j_2-1})
\cdots
(x_{n,j_n}-x_{n,j_n-1})
=
\Delta x_{1,j_1}
\Delta x_{2,j_2}
\cdots
\Delta x_{n,j_n} .
\end{equation*}
It is not difficult to see (left to reader) that
the subrectangles of $P$ cover our original $R$, and their
volumes sum to that of $R$. That is,
\begin{equation*}
R= \bigcup_{k=1}^N R_k , \qquad \text{and} \qquad
V(R) = \sum_{k=1}^N V(R_k).
\end{equation*}
The indexing in the definition may be complicated, but fortunately we
do not need to go back directly to the definition often.
\begin{prop} \label{mv:sumulbound:prop}
Suppose $R \subset \R^n$ is a closed rectangle
and $f \colon R \to \R$ is a bounded function. Let $m, M \in \R$ be
such that for all $x \in R$, we have $m \leq f(x) \leq M$. Then for every partition
$P$ of~$R$,
\begin{equation*}
m \, V(R) \leq
L(P,f) \leq U(P,f)
\leq M\, V(R) .
\end{equation*}
\end{prop}
\begin{proof}
Let $P$ be a partition of $R$. For all $i$, we have
$m \leq m_i \leq M_i \leq M$. Also $\sum_{i=1}^N V(R_i) = V(R)$. Therefore,
\begin{multline*}
m \, V(R) =
m \left( \sum_{i=1}^N V(R_i) \right)
=
\sum_{i=1}^N m \, V(R_i)
\leq
\sum_{i=1}^N m_i \, V(R_i)
\leq
\\
\leq
\sum_{i=1}^N M_i \, V(R_i)
\leq
\sum_{i=1}^N M \,V(R_i)
=
M \left( \sum_{i=1}^N V(R_i) \right)
=
M \,V(R) . \qedhere
\end{multline*}
\end{proof}
\subsection{Upper and lower integrals}
By \propref{mv:sumulbound:prop}, the set of upper and lower Darboux sums are bounded sets and we can take
their infima and suprema. As in one variable, we make the following definition.
\begin{defn}
Let $f \colon R \to \R$ be a bounded function on a closed rectangle $R \subset
\R^n$.
Define
\glsadd{not:lowerdarbouxR}
\glsadd{not:upperdarbouxR}
\begin{equation*}
\underline{\int_R} f
\coloneqq \sup \, \bigl\{ L(P,f) : P \text{ a partition of } R \bigr\} ,
\qquad
\overline{\int_R} f
\coloneqq \inf \, \bigl\{ U(P,f) : P \text{ a partition of } R \bigr\} .
\end{equation*}
We call $\underline{\int}$ the
\emph{\myindex{lower Darboux integral}}\index{Darboux integral} and
$\overline{\int}$ the \emph{\myindex{upper Darboux integral}}.
\end{defn}
And as in one dimension, we define refinements of partitions.
\begin{defn}
Let $R \subset \R^n$ be a closed rectangle.
Let $P = ( P_1, P_2, \ldots, P_n )$
and $\widetilde{P} = ( \widetilde{P}_1, \widetilde{P}_2, \ldots, \widetilde{P}_n )$
be partitions of $R$. We say $\widetilde{P}$ a
\emph{refinement}\index{refinement of a partition} of $P$
if, as sets, $P_k \subset \widetilde{P}_k$ for all $k = 1,2,\ldots,n$.
\end{defn}
If $\widetilde{P}$ is a refinement of $P$,
then subrectangles of $P$ are unions of subrectangles of $\widetilde{P}$.
Simply put, in a refinement, we take the subrectangles of $P$,
and we cut them into smaller subrectangles and call that $\widetilde{P}$.
See \figureref{mv:figrectpart}.
\begin{myfigureht}
\subimport*{figures/}{figrectpart.pdf_t}
\caption{Example refinement of the partition from \figureref{mv:figrect}.
New \myquote{cuts} are marked in
dashed lines. The exact order of the new subrectangles does not
matter.\label{mv:figrectpart}}
\end{myfigureht}
\begin{prop} \label{mv:prop:refinement}
Suppose $R \subset \R^n$ is a closed rectangle, $P$ is a partition of $R$,
and $\widetilde{P}$ is a refinement of $P$.
If $f \colon R \to \R$ is bounded,
then
\begin{equation*}
L(P,f) \leq L(\widetilde{P},f)
\qquad \text{and} \qquad
U(\widetilde{P},f) \leq U(P,f) .
\end{equation*}
\end{prop}
\begin{proof}
We prove the first inequality, and the second follows similarly.
Let $R_1,R_2,\ldots,R_N$ be the subrectangles of $P$
and
$\widetilde{R}_1,\widetilde{R}_2,\ldots,\widetilde{R}_{\widetilde{N}}$ be the
subrectangles of
$\widetilde{R}$.
Let $I_k$ be the set of all indices $j$ such that $\widetilde{R}_j \subset R_k$.
For example, in figures \ref{mv:figrect} and
\ref{mv:figrectpart}, $I_4 = \{ 6, 7, 8, 9 \}$ as
$R_4 =
\widetilde{R}_6 \cup \widetilde{R}_7 \cup
\widetilde{R}_8 \cup \widetilde{R}_9$.
Then,
\begin{equation*}
R_k = \bigcup_{j \in I_k} \widetilde{R}_j,
\qquad
V(R_k) = \sum_{j \in I_k} V(\widetilde{R}_j).
\end{equation*}
Let $m_j \coloneqq \inf \bigl\{ f(x) : x \in R_j \bigr\}$, and
$\widetilde{m}_j \coloneqq \inf \bigl\{ f(x) : \in \widetilde{R}_j \bigr\}$ as usual.
If $j \in I_k$, then $m_k \leq \widetilde{m}_j$. Then
\begin{equation*}
L(P,f) =
\sum_{k=1}^N m_k V(R_k)
=
\sum_{k=1}^N \sum_{j\in I_k} m_k V(\widetilde{R}_j)
\leq
\sum_{k=1}^N \sum_{j\in I_k} \widetilde{m}_j V(\widetilde{R}_j)
=
\sum_{j=1}^{\widetilde{N}} \widetilde{m}_j V(\widetilde{R}_j) = L(\widetilde{P},f) . \qedhere
\end{equation*}
\end{proof}
The key point of this next proposition is that
the lower Darboux integral is less than or equal to the upper Darboux
integral.
\begin{prop} \label{mv:intulbound:prop}
Let $R \subset \R^n$ be a closed rectangle and
$f \colon R \to \R$ a bounded function. Let $m, M \in \R$ be
such that for all $x \in R$, we have $m \leq f(x) \leq M$. Then
\begin{equation}
\label{mv:intulbound:eq}
m \, V(R) \leq
\underline{\int_R} f \leq \overline{\int_R} f
\leq M \, V(R).
\end{equation}
\end{prop}
\begin{proof}
For every partition $P$, via \propref{mv:sumulbound:prop},
\begin{equation*}
m\,V(R) \leq L(P,f) \leq U(P,f) \leq M\,V(R).
\end{equation*}
Taking supremum of $L(P,f)$ and infimum of $U(P,f)$ over all partitions $P$,
we obtain the first and the last inequality in
\eqref{mv:intulbound:eq}.
The key inequality in
\eqref{mv:intulbound:eq}
is the middle one.
Let $P=(P_1,P_2,\ldots,P_n)$ and
$Q=(Q_1,Q_2,\ldots,Q_n)$
be partitions of $R$. Define
$\widetilde{P} = ( \widetilde{P}_1,\widetilde{P}_2,\ldots,\widetilde{P}_n )$
by letting
$\widetilde{P}_k \coloneqq P_k \cup Q_k$ for every $k$.
Then $\widetilde{P}$ is a partition of $R$,
and $\widetilde{P}$ is a refinement of $P$ and also a refinement of $Q$.
By \propref{mv:prop:refinement},
$L(P,f) \leq L(\widetilde{P},f)$ and
$U(\widetilde{P},f) \leq U(Q,f)$. Therefore,
\begin{equation*}
L(P,f) \leq L(\widetilde{P},f) \leq U(\widetilde{P},f) \leq U(Q,f) .
\end{equation*}
In other words, for two arbitrary partitions $P$ and $Q$, we have
$L(P,f) \leq U(Q,f)$.
Via \volIref{\propref*{vI-infsupineq:prop} from volume I}{\propref{infsupineq:prop}},
we obtain
\begin{equation*}
\sup \, \bigl\{ L(P,f) : P \text{ a partition of } R \bigl\}
\leq
\inf \, \bigl\{ U(P,f) : P \text{ a partition of } R \bigl\} .
\end{equation*}
In other words, $\underline{\int_R} f \leq \overline{\int_R} f$.
\end{proof}
\subsection{The Riemann integral}
We have all we need to
define the Riemann integral in $n$-dimensions over rectangles.
As in one dimension, the Riemann
integral is only defined on a certain class of functions, called the
Riemann integrable functions.
\begin{defn}
Let $R \subset \R^n$ be a closed rectangle and
$f \colon R \to \R$ a bounded function such that
\begin{equation*}
\underline{\int_R} f(x)\,dx = \overline{\int_R} f(x)\,dx .
\end{equation*}
Then $f$ is said to be \emph{\myindex{Riemann integrable}},
and we sometimes say simply \emph{\myindex{integrable}}.
We denote the set of Riemann integrable functions on $R$
by $\sR(R)$.\glsadd{not:integrablefuncR}
For $f \in \sR(R)$ define
the \emph{\myindex{Riemann integral}}
\glsadd{not:riemannintR}
\begin{equation*}
\int_R f \coloneqq
\underline{\int_R} f = \overline{\int_R} f .
\end{equation*}
\end{defn}
When the variable $x \in \R^n$ needs to be emphasized, we write
\begin{equation*}
\int_R f(x)\,dx,
\qquad
\int_R f(x_1,\ldots,x_n)\,dx_1 \cdots dx_n,
\qquad
\text{or}
\qquad
\int_R f(x)\,dV .
\end{equation*}
If $R \subset \R^2$, then we often say area instead of volume, and we
write
\begin{equation*}
\int_R f(x)\,dA .
\end{equation*}
\propref{mv:intulbound:prop} immediately implies the following
proposition.
\begin{prop} \label{mv:intbound:prop}
Let $f \colon R \to \R$ be a Riemann integrable function
on a closed rectangle $R \subset \R^n$.
Let $m, M \in \R$ be
such that $m \leq f(x) \leq M$ for all $x \in R$. Then
\begin{equation*}
m \, V(R) \leq
\int_{R} f
\leq M \, V(R) .
\end{equation*}
\end{prop}
\begin{example}
A constant function is Riemann integrable. Proof: Suppose
$f(x) = c$ for all $x \in R$. Then
\begin{equation*}
c \, V(R) \leq \underline{\int_R} f \leq \overline{\int_R} f \leq c\, V(R) .
\end{equation*}
So $f$ is integrable, and furthermore $\int_R f = c\,V(R)$.
\end{example}
The proofs of linearity and monotonicity are almost completely identical as
the proofs from one variable.
We leave the next two propositions as exercises.
\begin{samepage}
\begin{prop}[Linearity] \label{mv:intlinearity:prop}
\index{linearity of the integral}
Let $R \subset \R^n$ be a closed rectangle and let
$f$ and $g$ be in $\sR(R)$ and $\alpha \in \R$.
\begin{enumerate}[(i)]
\item $\alpha f$ is in $\sR(R)$ and
\begin{equation*}
\int_R \alpha f = \alpha \int_R f .
\end{equation*}
\item $f+g$ is in $\sR(R)$ and
\begin{equation*}
\int_R (f+g) =
\int_R f
+
\int_R g .
\end{equation*}
\end{enumerate}
\end{prop}
\end{samepage}
\begin{prop}[Monotonicity]
\index{monotonicity of the integral}
Let $R \subset \R^n$ be a closed rectangle, let
$f$ and $g$ be in $\sR(R)$, and suppose $f(x) \leq g(x)$
for all $x \in R$. Then
\begin{equation*}
\int_R f
\leq
\int_R g .
\end{equation*}
\end{prop}
Checking for integrability using the definition often involves the following
technique, as in the single variable case.
\begin{prop} \label{mv:prop:upperlowerepsilon}
Let $R \subset \R^n$ be a closed rectangle and
$f \colon R \to \R$ a bounded function.
Then $f \in \sR(R)$ if and only if
for every $\epsilon > 0$, there exists a partition $P$ of $R$
such that
\begin{equation*}
U(P,f) - L(P,f) < \epsilon .
\end{equation*}
\end{prop}
\begin{proof}
First, if $f$ is integrable, then the supremum of $L(P,f)$ and
infimum of $U(Q,f)$ over all partitions $P$ and $Q$ are equal and hence the
infimum of $U(P,f)-L(Q,f)$ is zero. Taking a common refinement
$\widetilde{P}$ of $P$ and $Q$ we find
$U(\widetilde{P},f)-L(\widetilde{P},f) \leq U(P,f)-L(Q,f)$.
Hence the infimum of $U(P,f)-L(P,f)$ over all partitions $P$ is zero, and
so for every $\epsilon > 0$, there must be some partition $P$ such that
$U(P,f) - L(P,f) < \epsilon$.
For the other direction, given an $\epsilon > 0$ find $P$ such that
$U(P,f) - L(P,f) < \epsilon$.
\begin{equation*}
\overline{\int_R} f -
\underline{\int_R} f
\leq
U(P,f) - L(P,f)
< \epsilon .
\end{equation*}
As $\overline{\int_R} f \geq \underline{\int_R} f$ and the above holds for
every $\epsilon > 0$, we conclude
$\overline{\int_R} f = \underline{\int_R} f$ and $f \in \sR(R)$.
\end{proof}
Suppose $f \colon S \to \R$ is a function and $R \subset S$
is a closed rectangle. If the restriction $f|_R$ is integrable,
then for simplicity we
say $f$ is \emph{integrable on $R$}, or
$f \in \sR(R)$, and we
write
\begin{equation*}
\int_R f \coloneqq \int_R f|_R .
\end{equation*}
\begin{prop} \label{mv:prop:integralsmallerset}
Let $S \subset \R^n$ be a closed rectangle.
If $f \colon S \to \R$ is integrable and $R \subset S$
is a closed rectangle, then $f$ is integrable on $R$.
\end{prop}
\begin{proof}
Given $\epsilon > 0$, find a partition $P=(P_1,\ldots,P_n)$
of $S$ such that
$U(P,f)-L(P,f) < \epsilon$. By making a refinement of $P$
if necessary,
assume that the endpoints of $R$ are in $P$. That is,
if $R = [a_1,b_1] \times [a_2,b_2] \times \cdots \times [a_n,b_n]$,
then $a_i,b_i \in P_i$.
Let $\widetilde{P} = (\widetilde{P}_1,\ldots,\widetilde{P}_n)$
be the partition of $R$ given by $\widetilde{P}_i = P_i \cap [a_i,b_i]$.
Subrectangles of $\widetilde{P}$ are subrectangles of~$P$, that
is, $R$ is a union of subrectangles of~$P$.
Divide the subrectangles of $P$ into two collections:
Let $R_1,R_2\ldots,R_K$ be the subrectangles of $P$ that are
also subrectangles of $\widetilde{P}$ and
let $R_{K+1},\ldots, R_N$ be the rest.
See \figureref{fig:figrectsubrect}.
Let $m_k$ and $M_k$ be the infimum and supremum
of $f$ on $R_k$ as usual. Then,
\begin{equation*}
\begin{split}
\epsilon & >
U(P,f)-L(P,f)
=
\sum_{k=1}^K (M_k-m_k) V(R_k)
+
\sum_{k=K+1}^N (M_k-m_k) V(R_k)
\\
&
\geq
\sum_{k=1}^K (M_k-m_k) V(R_k)
=
U(\widetilde{P},f|_R)-L(\widetilde{P},f|_R) .
\end{split}
\end{equation*}
Therefore, $f|_R$ is integrable.
\end{proof}
\begin{myfigureht}
\subimport*{figures/}{figrectsubrect.pdf_t}
\caption{A partition of a large rectangle $S$, that also gives a partition
of a smaller rectangle (shaded and outlined) $R \subset S$.
The subrectangles $R_1,R_2,R_3,R_4$ are the subrectangles of
$\widetilde{P} = \bigl( \{ x_{1,1}, x_{1,2} , x_{1,3} \} ,
\{ x_{2,1}, x_{2,2} , x_{2,3} \} \bigr)$.\label{fig:figrectsubrect}}
\end{myfigureht}
\subsection{Integrals of continuous functions}
Although we will prove a more general result later, it is useful to start
with integrability of continuous functions.
To do so, we wish to measure the fineness of partitions.
In one variable, we measure the length of a subinterval.
In several variables, we measure the sides of a subrectangle.
We say a rectangle $R = [a_1,b_1] \times
[a_2,b_2] \times \cdots \times
[a_n,b_n]$ has \emph{longest side at most $\alpha$}\index{longest side} if
$b_k-a_k \leq \alpha$ for all $k=1,2,\ldots,n$.
\begin{prop} \label{prop:diameterrectangle}
If a rectangle $R \subset \R^n$ has longest side at most $\alpha$, then
for all $x,y \in R$,
\begin{equation*}
\snorm{x-y} \leq \sqrt{n} \, \alpha .
\end{equation*}
\end{prop}
\begin{proof}
\begin{equation*}
\begin{split}
\snorm{x-y}
& =
\sqrt{
{(x_1-y_1)}^2
+
{(x_2-y_2)}^2
+ \cdots +
{(x_n-y_n)}^2
}
\\
& \leq
\sqrt{
{(b_1-a_1)}^2
+
{(b_2-a_2)}^2
+ \cdots +
{(b_n-a_n)}^2
}
\\
& \leq
\sqrt{
{\alpha}^2
+
{\alpha}^2
+ \cdots +
{\alpha}^2
}
=
\sqrt{n} \, \alpha . \qedhere
\end{split}
\end{equation*}
\end{proof}
\begin{thm} \label{mv:thm:contintrect}
Let $R \subset \R^n$ be a closed rectangle.
If $f \colon R \to \R$ is continuous, then $f \in \sR(R)$.
\end{thm}
\begin{proof}
The proof is analogous to the one-variable proof with some complications.
The set $R$ is a closed and bounded subset of $\R^n$, and hence compact. So
$f$ is uniformly continuous
by \volIref{\thmref*{vI-thm:Xcompactfunifcont} from volume I}{\thmref{thm:Xcompactfunifcont}}.
Let $\epsilon > 0$ be given. Find a $\delta > 0$ such that
$\snorm{x-y} < \delta$ implies $\sabs{f(x)-f(y)} < \frac{\epsilon}{V(R)}$.
Let $P$ be a partition of $R$, such that longest side of every subrectangle
is strictly less than $\frac{\delta}{\sqrt{n}}$.
If $x, y \in R_k$ for a subrectangle $R_k$ of $P$, then,
by the proposition,
$\snorm{x-y} < \sqrt{n} \frac{\delta}{\sqrt{n}} = \delta$. Therefore,
\begin{equation*}
f(x)-f(y) \leq \sabs{f(x)-f(y)} < \frac{\epsilon}{V(R)} .
\end{equation*}
As $f$ is continuous on $R_k$, which is compact, $f$ attains a maximum and a minimum
on this subrectangle.
Let $x$ be a point where $f$ attains the maximum and $y$ be a point
where $f$ attains the minimum. Then $f(x) = M_k$
and $f(y) = m_k$ in the notation from the definition of the integral.
Thus,
\begin{equation*}
M_k-m_k = f(x)-f(y) <
\frac{\epsilon}{V(R)} .
\end{equation*}
And so
\begin{equation*}
\begin{split}
U(P,f) - L(P,f)
& =
\left(
\sum_{k=1}^N
M_k V(R_k)
\right)
-
\left(
\sum_{k=1}^N
m_k V(R_k)
\right)
\\
& =
\sum_{k=1}^N
(M_k-m_k) V(R_k)
\\
& <
\frac{\epsilon}{V(R)}
\sum_{k=1}^N
V(R_k)
= \epsilon.
\end{split}
\avoidbreak
\end{equation*}
Via application of \propref{mv:prop:upperlowerepsilon}, we find that $f \in
\sR(R)$.
\end{proof}
\subsection{Integration of functions with compact support}
Let $U \subset \R^n$ be an open set and
$f \colon U \to \R$ be a function. The
\emph{\myindex{support}} of $f$ is the set
\begin{equation*}
\operatorname{supp} (f) \coloneqq
\overline{
\{ x \in U : f(x) \not= 0 \}
} ,
\end{equation*}
where the closure is with respect to the subspace topology on $U$.
Taking the closure with respect to the subspace
topology is the same as
$\overline{
\{ x \in U : f(x) \not= 0 \}
} \cap U$, where the closure is with respect to the ambient euclidean space
$\R^n$.
In particular,
$\operatorname{supp} (f) \subset U$.
The support is the closure (in $U$) of the set of points where the
function is nonzero. Its complement in $U$ is open.
If $x \in U$ and $x$ is not in the support of $f$,
then
$f$ is constantly zero in a whole neighborhood of $x$.
A function $f$ is said to have \emph{\myindex{compact support}}
if $\supp(f)$ is a compact set.
\begin{example}
The function $f \colon \R^2 \to \R$ defined by
\begin{equation*}
f(x,y) \coloneqq
\begin{cases}
-x{(x^2+y^2-1)}^2 & \text{if } \sqrt{x^2+y^2} \leq 1, \\
0 & \text{else},
\end{cases}
\end{equation*}
is continuous and its support is the closed unit disc
$C(0,1) = \bigl\{ (x,y) : \sqrt{x^2 + y^2} \leq 1 \bigr\}$, which is a compact set, so $f$ has compact support.
Note that the function is zero on the entire $y$-axis
and on the unit circle, but
all points that lie in the closed unit disc are still within the support
as they are in the closure of points where $f$ is nonzero.
See \figureref{fig:compsup}.
\begin{myfigureht}
\subimport*{figures/}{compsup_full.pdf_t}
\caption{Function with compact support (left), the support
is the closed unit disc (right).\label{fig:compsup}}
\end{myfigureht}
\end{example}
If $U \not= \R^n$, then you must be careful to
take the closure in $U$. Consider the following
two examples.
\begin{example}
Let
$B(0,1) \subset \R^2$ be the unit disc. The function
$f \colon B(0,1) \to \R$ defined by
\begin{equation*}
f(x,y) \coloneqq
\begin{cases}
0 & \text{if } \sqrt{x^2+y^2} > \nicefrac{1}{2}, \\
\nicefrac{1}{2} - \sqrt{x^2+y^2} & \text{if } \sqrt{x^2+y^2} \leq \nicefrac{1}{2},
\end{cases}
\end{equation*}
is continuous on $B(0,1)$ and its support is the smaller closed ball
$C(0,\nicefrac{1}{2})$. As that is a compact set, $f$ has compact support.
The function $g \colon B(0,1) \to \R$ defined by
\begin{equation*}
g(x,y) \coloneqq
\begin{cases}
0 & \text{if } x \leq 0, \\
x & \text{if } x > 0,
\end{cases}
\end{equation*}
is continuous on $B(0,1)$, but its support is the set
$\bigl\{ (x,y) \in B(0,1) : x \geq 0 \bigr\}$. In particular, $g$~is not compactly
supported.
\end{example}
We really only need to consider the case when $U=\R^n$. In light of
\exerciseref{exercise:contcompactsupportRn}, which says every continuous
function on an open $U \subset \R^n$ with compact support can be extended to a
continuous function with compact support on $\R^n$,
considering $U=\R^n$ is not an oversimplification.
\begin{example}
The continuous function $f \colon B(0,1) \to \R$ given by
$f(x,y) \coloneqq \sin\bigl(\frac{1}{1-x^2-y^2}\bigr)$
does not have compact support;
as $f$ is not constantly zero on any neighborhood of every point in $B(0,1)$,
the support is the entire disc $B(0,1)$. The function
does not extend as above to a continuous function on $\R^2$. In fact, it is not
difficult to show that $f$ cannot be extended in any way whatsoever to be
continuous on all of $\R^2$ (the boundary of the disc is the problem).
\end{example}
\begin{prop} \label{mv:prop:rectanglessupp}
Suppose $f \colon \R^n \to \R$ is a continuous function with compact support.
If $R$ and $S$ are closed rectangles such that
$\operatorname{supp}(f) \subset R$
and
$\operatorname{supp}(f) \subset S$, then
\begin{equation*}
\int_S f = \int_R f .
\end{equation*}
\end{prop}
\begin{proof}
As $f$ is continuous, it is automatically integrable on the rectangles $R$, $S$, and $R
\cap S$.
Then \exerciseref{mv:zerooutside} says
$\int_S f = \int_{S \cap R} f = \int_R f$.
\end{proof}
Because of this proposition, when $f \colon \R^n \to \R$ has compact support
and is integrable on a rectangle $R$ containing the support, we write
\begin{equation*}
\int f \coloneqq \int_R f \qquad \text{or} \qquad
\int_{\R^n} f \coloneqq \int_R f .
\end{equation*}
For example, if $f$ is continuous and of compact support, then
$\int_{\R^n} f$ exists.
\subsection{Exercises}
\begin{exercise} \label{exercise:contcompactsupportRn}
Suppose $U \subset \R^n$ is open and $f \colon U \to \R$ is continuous and
of compact support. Show that the function $\widetilde{f} \colon \R^n \to \R$
\begin{equation*}
\widetilde{f}(x) \coloneqq
\begin{cases}
f(x) & \text{if } x \in U, \\
0 & \text{otherwise,}
\end{cases}
\avoidbreak
\end{equation*}
is continuous.
\end{exercise}
\begin{exercise}
Prove \propref{mv:intlinearity:prop}.
\end{exercise}
\begin{exercise}
Suppose $R$ is a closed rectangle with the length of one of the sides equal to 0.
For every bounded function $f \colon R \to \R$, show that $f \in \sR(R)$ and $\int_R f = 0$.
\end{exercise}
\begin{exercise} \label{mv:zerosiderectangle}
Suppose $R$ is a closed rectangle with the length of one of the sides equal to 0,
and suppose $S$ is a closed rectangle with $R \subset S$.
If $f \colon S \to \R$
is a bounded function such that $f(x) = 0$ for $x \in S \setminus R$, show
that $f \in \sR(S)$ and $\int_S f = 0$.
\end{exercise}
\begin{exercise}
Suppose $f\colon \R^n \to \R$ is such that
$f(x) \coloneqq 0$ if $x\not= 0$ and $f(0) \coloneqq 1$. Show that $f$ is integrable
on $R \coloneqq [-1,1] \times [-1,1] \times \cdots \times [-1,1]$ directly using the
definition, and find $\int_R f$.
\end{exercise}
\begin{exercise} \label{mv:zeroinside}
Suppose $R$ is a closed rectangle and $h \colon R \to \R$ is a bounded function
such that $h(x) = 0$ if $x \notin \partial R$ (the boundary of $R$).
Let $S$ be a closed rectangle.
Show that $h \in \sR(S)$ and
\begin{equation*}
\int_{S} h = 0 .
\avoidbreak
\end{equation*}
Hint: Write $h$ as a sum of functions as in \exerciseref{mv:zerosiderectangle}.
\end{exercise}
\begin{exercise} \label{mv:zerooutside}
Suppose $R$ and $R'$ are two closed rectangles with $R' \subset R$. Suppose $f \colon R \to \R$ is in $\sR(R')$
and $f(x) = 0$ for $x \in R \setminus R'$.
Show that $f \in \sR(R)$ and
\begin{equation*}
\int_{R'} f = \int_R f .
\end{equation*}
Do this in the following steps.
\begin{enumerate}[a)]
\item
First do the proof assuming that furthermore $f(x) = 0$ whenever $x
\in \overline{R \setminus R'}$.
\item
Write $f(x) = g(x) + h(x)$ where $g(x) = 0$ whenever $x
\in \overline{R \setminus R'}$, and $h(x)$ is zero except perhaps on
$\partial R'$.
Then show $\int_R h = \int_{R'} h = 0$ (see \exerciseref{mv:zeroinside}).
\item
Show
$\int_{R'} f = \int_R f$.
\end{enumerate}
\end{exercise}
\begin{exercise}
Suppose $R' \subset \R^n$ and $R'' \subset \R^n$ are two rectangles
such that $R = R' \cup R''$ is a rectangle, and $R' \cap R''$ is rectangle
with one of the sides having length 0 (that is $V(R' \cap R'') = 0$).
Let $f \colon R \to \R$ be a function such that $f \in \sR(R')$ and
$f \in \sR(R'')$. Show that $f \in \sR(R)$ and
\begin{equation*}
\int_{R} f = \int_{R'} f + \int_{R''} f .
\avoidbreak
\end{equation*}
Hint: See previous exercise.
\end{exercise}
\begin{exercise}
Prove a stronger version of \propref{mv:prop:rectanglessupp}.
Suppose $f \colon \R^n \to \R$ is a function with compact support but not
necessarily continuous.
Prove that
if $R$ is a closed rectangle such that $\operatorname{supp}(f) \subset R$
and $f$ is integrable on $R$, then for every other closed rectangle
$S$ with $\operatorname{supp}(f) \subset S$,
the function $f$ is integrable on $S$ and
$\int_S f = \int_R f$.
Hint: See \exerciseref{mv:zerooutside}.
\end{exercise}
\begin{exercise}
Suppose $R$ and $S$ are closed rectangles of $\R^n$.
Define $f \colon \R^n \to \R$ as $f(x) \coloneqq 1$ if
$x \in R$, and $f(x) \coloneqq 0$ otherwise. Prove $f$ is integrable on $S$
and compute $\int_S f$. Hint: Consider $S \cap R$.
\end{exercise}
\begin{samepage}
\begin{exercise}
Let $R \coloneqq [0,1] \times [0,1] \subset \R^2$.
\begin{enumerate}[a)]
\item
Suppose $f \colon R \to \R$ is defined by
\begin{equation*}
f(x,y) \coloneqq
\begin{cases}
1 & \text{if } x = y, \\
0 & \text{else.}
\end{cases}
\end{equation*}
Show that $f \in \sR(R)$ and compute $\int_R f$.
\item
Suppose $f \colon R \to \R$ is defined by
\begin{equation*}
f(x,y) \coloneqq
\begin{cases}
1 & \text{if } x \in \Q \text{ or } y \in \Q, \\
0 & \text{else.}
\end{cases}
\end{equation*}
Show that $f \notin \sR(R)$.
\end{enumerate}
\end{exercise}
\end{samepage}
\begin{exercise}
Suppose $R$ is a closed rectangle, and suppose $S_j$ are closed rectangles
such that $S_j \subset R$ and $S_j \subset S_{j+1}$ for all $j$.
Suppose $f \colon R \to \R$ is bounded and $f \in \sR(S_j)$ for all $j$.
Show that $f \in \sR(R)$ and
\begin{equation*}
\lim_{j\to\infty} \int_{S_j} f = \int_R f .
\end{equation*}
\end{exercise}
\begin{exercise}
Suppose $f\colon [-1,1] \times [-1,1] \to \R$ is a Riemann
integrable function such $f(x) = -f(-x)$. Using the definition prove
\begin{equation*}
\int_{[-1,1] \times [-1,1]} f = 0 .
\end{equation*}
\end{exercise}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\sectionnewpage
\section{Iterated integrals and Fubini theorem}
\label{sec:iteratedints}
\sectionnotes{1--2 lectures}
The Riemann integral in several variables
is hard to compute via the definition.
For one-dimensional Riemann integral, we have the fundamental
theorem of calculus,
%(FIXME link?)
which allows computing many integrals without
having to appeal to the definition of the integral.
We will rewrite
a Riemann integral in several variables into
several one-dimensional Riemann integrals
by iterating. However, if $f \colon [0,1]^2 \to \R$ is a Riemann integrable
function, it is not immediately clear if the three expressions
\begin{equation*}
\int_{[0,1]^2} f ,
\qquad
\int_0^1 \int_0^1 f(x,y) \, dx \, dy ,
\qquad \text{and}
\qquad
\int_0^1 \int_0^1 f(x,y) \, dy \, dx
\end{equation*}
are equal, or if the last two are even well-defined.
\begin{example}
Define
\begin{equation*}
f(x,y) \coloneqq
\begin{cases}
1 & \text{if } x=\nicefrac{1}{2} \text{ and } y \in \Q, \\
0 & \text{otherwise.}
\end{cases}
\end{equation*}
Then $f$ is Riemann integrable on $R \coloneqq [0,1]^2$ and $\int_R f = 0$.
Moreover, $\int_0^1 \int_0^1 f(x,y) \, dx \, dy = 0$.
However,
\begin{equation*}
\int_0^1 f(\nicefrac{1}{2},y) \, dy
\end{equation*}
does not exist, so strictly speaking,
$\int_0^1 \int_0^1 f(x,y) \, dy \, dx$
does not make sense.
See \figureref{fig:fubinibad}.
\begin{myfigureht}
\subimport*{figures/}{fubinibad.pdf_t}
\caption{Left: $[0,1]^2$ with the line $x=\nicefrac{1}{2}$ marked
dotted and $\int_0^1 f(x,y) \, dx$ marked as gray solid line for a generic $y$.
Center: Similar picture but $\int_0^1 f(x,y) \, dy$
marked for some $x \not= \nicefrac{1}{2}$.
Right: The three different rectangles in the partition used to integrate $f$
in different grays.\label{fig:fubinibad}}
\end{myfigureht}
Proof: