How can I prove the inequality about integration of complex-valued function Let $f(x):R\to C$ be a function from real number to complex value. And let we use the defination that if $f(x)=g(x)+i\cdot h(x)$, then $\int_{[a,b]}f(x)dx := \int_{[a,b]}g(x)dx + i\cdot\int_{[a,b]}h(x)dx$. How can I prove the inequality:
$$\left\lvert \int_{[a,b]}f(x)dx\right\rvert \le \int_{[a,b]}\left\lvert f(x)\right\rvert dx$$
 A: This follows from the identity for functions of a real variable.
$$\displaystyle \left|\int g(z)\, dz + i\int h(z) \, dz\right|^2 = \left(\int g \,  dz \right)^2+ \left(\int h \, dz\right)^2  $$
$$\le \int g^2 \, dz + \int h^2 \, dz = \int (g+ ih )(g-ih) \, dz= \int \left|g+ih\right|^2 \, dz$$
We have $$\left(\int g \, dz \right)^2 \le \int g^2 \, dz $$ by the Cauchy-Schwartz inequality $$\left(\int pq \, dz \right)^2 \le \int p^2 \, dz\int q^2 \, dz $$ with $p(z)=g(z)$ and $q(z)=1.$
A: If the inequality holds for $f$, it also holds for $zf$ for any $z\in \Bbb C$. Therefore, we may assume wlog that $\int_{[a,b]}f(x)\,\mathrm dx$ is a non-negative real.
In this special case, we have
$$\begin{align} \left|\int_{[a,b]}f(x)\,\mathrm dx\right|&=\int_{[a,b]}f(x)\,\mathrm dx\\&=\int_{[a,b]}g(x)\,\mathrm dx+i\int_{[a,b]}h(x)\,\mathrm dx\\&
=\int_{[a,b]}g(x)\,\mathrm dx\\
&\le\int_{[a,b]}|g(x)|\,\mathrm dx\\
&\le\int_{[a,b]}|f(x)|\,\mathrm dx\end{align}$$
A: Proof that works in any Euclidean space, not merely in $\mathbb C = \mathbb R^2$.  Write $\;\cdot\;$ for the usual dot product in $\mathbb R^n$.  We will use the Schwarz inequality $|\mathbf x\cdot\mathbf y| \le \|\mathbf x\|\;\|\mathbf y\|$.
Claim. Let $f : [a,b]\to \mathbb R^n$ be integrable.  Then
$$
\left\|\int_{[a,b]} f(x)\;dx\right\|\le \int_{[a,b]} \|f(x)\|\;dx .
\tag1$$
Proof. Consider the vector $\mathbf v = \int_{[a,b]} f(x) dx$.  If it is zero, then $(1)$ is clearly true.   So assume $\mathbf v \ne \mathbf 0$.  Then
$$
\mathbf u := \frac{1}{\|\mathbf v\|} \mathbf v 
$$
is a unit vector.  Now
$$
\mathbf v\cdot \mathbf u = \|\mathbf v\|\; \mathbf u \cdot \mathbf u
=\|\mathbf v\| .
$$
So compute
$$
\left\|\int_{[a,b]} f(x)\;dx\right\| = \left(\int_{[a,b]} f(x)\;dx\right) \cdot \mathbf u
\\ =
\left(\int_{[a,b]} f(x)\cdot \mathbf u\;dx\right)
\\ \le
\left(\int_{[a,b]} |f(x)\cdot \mathbf u|\;dx\right)
\\ \le
\left(\int_{[a,b]} \|f(x)\|\; \|\mathbf u\|\;dx\right)
\\=
\left(\int_{[a,b]} \|f(x)\|\;dx\right)
$$
