# Upper Bound on Complex Line Integral

I'm working through the second edition of Complex Variables by Stephen Fisher, and reached a proof involving the upper bound of line integrals, namely $$\left| \int_\gamma u(z)\;dz \right| \leq \left(\mathop{\text{max}}_{z \;\in\; \gamma}\right)\text{length}(\gamma).$$ Now my problem isn't with the statement, but rather a part of the proof. In it, we suppose $g$ is a complex-valued continuous function on $[a, b]$ and we want to show that $$\left|\int_a^b g(t)\;dt\right| \leq \int_a^b \left|g(t)\right|\;dt.$$ Assuming $\int_a^bg(t)\;dt \neq 0$ and letting $$\theta = \text{Arg}\left(\int_a^bg(t)\;dt\right),$$ we are somehow able to show $$0 < \left|\int_a^b g(t)\;dt\right| = e^{-i\theta}\int_a^b g(t)\;dt.$$ My question is on how this last equality holds true. Not only am I unsure how to get to the right hand side from the left, but I'm also unsure about the validity of the equation in general. For instance, shouldn't the left hand side be a real number (the absolute value of a complex value) and the right side consist of an imaginary part since $$e^{-i\theta}\int_a^bg(t)\;dt = \left(\int_a^bg(t)\;dt\right)(\cos{\theta} - i\sin{\theta}) = \text{some complex number}?$$ I recognize the right side as almost being the polar representation of $\int_a^b g(t)\;dt$, but I'm not sure if that helps. Thanks for any insight.

Forget that it's an integral for a second. Say $z$ is that integral. You know that there exists $\theta\in\Bbb R$ with $$z=e^{i\theta}|z|.$$That says $$|z|=e^{-i\theta}z,$$which is the equality you're puzzled about.
Yes, the last thing on the right is a complex number. So what? It's a complex number that happens to equal $|z|$.