Linearizing a function involving an integral about a point 
Find the linearization of $$g(x)= \int_0^{\cot(x)} \frac{dt}{t^2 + 1}$$ at $x=\frac{\pi}{2}$.

I know to find linearization I first plugin the $x$ values into my function $g(x)$: $g(\pi/2)$.
Then as I understand it, I make the necessary conversions to form the following function:
$$L(x)=g(a)+g'(a)(x-a)$$
Which yields... I'm not sure. I've gotten decent at the definite integrals which use numbers, but my online course in precalculus has left me with serious gaps involving the unit circle and $\sin$/$\cos$/$\tan$ conversions.
Can someone help walk me through this problem to where I can fully understand what is being asked of similar problems?

$$
y = \int_0^u \frac{dt}{t^2 + 1} \quad \text{and} \quad u = \cot x.
$$
$$
\frac {dy}{du} = \frac 1 {u^2+1} \quad\text{and}\quad \frac{du}{dx} = -\csc^2 x.
$$
When $x=\pi/2$ then $-\csc^2 x = -1$ and $\cot x = 0$, so $\dfrac 1 {u^2+1} = \dfrac 1 {0^2+1} = 1$.
Bottom line:
$$
\left. \frac{dy}{dx} \right|_{x=\pi/2} = -1.
$$
Alternatively, one can say
$$
\int_0^{\cot x} \frac{dt}{t^2+1} = \arctan(\cot x) - \arctan 0 = \frac\pi 2 - x,
$$
and that's easy to differentiate with respect to $x$.
