In evaluating $\int_{-\pi/2}^{\pi/2} \sin x \;dt$, why can we treat $x$ as a constant and simply take $\sin x$ out of the integral? Why do we consider two independent variables to be constant with respect to each other?
I was evaluating $\int_{-\pi/2}^{\pi/2} \sin x \;dt$. In the solution to the problem, they simply take $\sin x$ out of integral, treating it like a constant to $t$, and write the integral as $\pi \sin x$.
According to me, if $t$ runs from $-\pi/2$ to $\pi/2$, how can we be sure that $x$ is a constant in that interval? It can be a variable in that interval.
Where am I wrong?
 A: Please note that when we have two independent variables, the variation of each of them does not affect the other one.
For example, suppose that $x$ and $t$ are two independent variables and can vary in their domains $D_x = \{ x_1, \cdots , x_m \}$ and $D_t =\{ t_1, \cdots , t_n \}$, respectively. Now, consider the following sum:$$\sum_{i=1}^n A(x)B(t)=A(x)B(t_1) + \cdots + A(x)B(t_n)$$$$=A(x)\left ( B(t_1) + \cdots + B(t_n) \right )=A(x)\sum_{i=1}^nB(t_i),$$where $A(x)$ and $B(t)$ are some functions of $x$ and $t$, respectively. In the above calculation, we treat $A(x)$ as a constant. In fact, although $x$ can vary in its domain $D_x$, in the computation of the sum $x$ can take any fixed value from its domain $D_x$ (though we may not know which of them), so $A(x)$ can be considered as a constant in the above calculation.
A similar argument can be applied for your example. In fact, we have$$\int_{-\frac{\pi }{2}}^{\frac{\pi }{2}} \sin x dt = \sin x \int_{-\frac{\pi }{2}}^{\frac{\pi }{2}} dt = \pi \sin x .$$
