1) Please help me to understand this rule:

$\displaystyle \int_a^b{g(x)} dt = b*g(x) - a*g(x)$

When I apply the rule to the following equation--

$\displaystyle \frac{\pi}{2x}=\int_{0}^{\frac{\pi}{2}}\frac{\pi\l eft(1+\tanh\left(\frac{-\ln{\sin\theta}}{2} \right ) \right )}{4x} d\theta$

I get:

$\displaystyle \frac{\pi}{2}\frac{\pi\left(1+\tanh\left(\frac{-\ln{\sin\frac{\pi}{2}}}{2} \right ) \right )}{4x}=\frac{\pi^2}{8x}\neq\frac{\pi}{2x}$

which doesn't make sense. What am I missing?

2) How does the rule work for definite integrals whose intervals are infinite, such as in the gamma function?

Pardon my ignorance.