Find all $a>0$ such that the following improper integral converges. The problem is integral:
$$
\int\limits_0^{\frac{\pi}{2}}\sec^a(x)dx
$$
I managed to think that if $a=1$, the integral diverges and by the comparison test, for all $a>1$ the integral also diverges.
However, I don't know what to do next. Since $a$ is a real number, I can't get its anti-derivative directly.
 A: Hint: Note that
$$\sec(x)=\frac{1}{\sin\left(\frac{\pi}{2}-x\right)}.$$
Moreover recall that
$$\lim_{t\to 0}\frac{\sin t}{t}=1,$$
thus near $\frac{\pi}{2}$ we have
$$\frac{1}{\sin\left(\frac{\pi}{2}-x\right)}\sim\frac{1}{\frac{\pi}{2}-x}.$$
Then apply comparison test.
A: Hint:
$$\int\limits_0^{\frac{\pi}{2}}\sec^a(x)dx = \int\limits_0^{\frac{\pi}{2}}\csc^a(x)dx = \int\limits_0^{\frac{\pi}{2}} \frac{1}{\sin^a(x)}dx$$
and note that $\sin x \stackrel{x \rightarrow 0}{\sim} x$.
Then you can use the limit comparison test for improper integrals.
A: It seems to me that you can compare this integral to:
$$
\int\limits_0^{\frac{\pi}{2}}\frac{\sin(x)}{cos^a(x)}dx < \int\limits_0^{\frac{\pi}{2}}\sec^a(x)dx
$$
This is true because $\sin(x) \leq 1$. Then we can do a $u$-substitution: $u = \cos(x)$ and $du = -\sin(x)dx$ and $u$ goes from $1$ to $0$:
$$
\int\limits_0^{\frac{\pi}{2}}\frac{\sin(x)}{cos^a(x)}dx = -\int\limits_1^0 u^{-a}du = -\frac{1}{1 - a}\lim_{x\rightarrow 0}\left[x^{1 -a} - 1\right] \text{, for $a \neq 1$}
$$
So, just as you found, we see this definitely diverges for $a > 1$. Furthermore, since, when $a = 1$, you get the natural log, it also diverges for $a = 1$.
Clearly this integral converges when $0 < a < 1$, but that doesn't "help" us because our test integral is less than the original. However, it's not that difficult to multiple the $\sin(x)$ to make it larger than $1$. On the interval from $0$ to $\frac{\pi}{2}$, $\sin(x)$ monotonically increases. Therefore we simply choose a particular value of $\sin(x)$ for $x > 0$ and multiply it by an amount large enough to make it larger than $1$. We then get:
$$
A\int\limits_{x_0}^{\frac{\pi}{2}}\frac{\sin(x)}{cos^a(x)}dx \geq \int\limits_{x_0}^{\frac{\pi}{2}}\sec^a(x)dx \text{, such that $A\sin(x_0) \geq 1$}
$$
Since $x_0 < \frac{\pi}{2}$, the first part of the integral surely converges. This shows that the "second" part converges, so the full integral also does.
Edit: To make this concrete (and this is strictly for $a > 0$...there's little doubt that the integral converges when $a < 0$), we choose an $x_0$ such that $0 < x_0 < \frac{\pi}{2}$ and an $A$ (along with $x_0$) such that $A\sin(x_0) \geq 1$. The original integral then becomes:
$$
\int\limits_0^\frac{\pi}{2} \sec^a(x)dx = \int\limits_0^{x_0}\sec^a(x)dx + \int\limits_{x_0}^\frac{\pi}{2}\sec^a(x)dx
$$
We can bound the first integral by simply taking the smallest value (when at $x = 0$: $\sec^a(0) = 1$) and the largest value (when $x = x_0$: $\sec^a(x_0)$):
$$
\int\limits_0^{x_0} dx \leq \int\limits_0^{x_0}\sec^a(x)dx \leq \sec^a(x_0)\int\limits_0^{x_0}dx
$$
This means that the first integral is somewhere between $x_0$ and $x_0\sec^a(x_0)$. Finally the second integral can be bounded by:
$$
\sec^a(x_0)\int\limits_{x_0}^\frac{\pi}{2}dx
\leq \int\limits_{x_0}^\frac{\pi}{2}\sec^a(x) \leq A\int\limits_{x_0}^\frac{\pi}{2}\frac{\sin(x)}{\cos^a(x)}dx
$$
Left Part (Smaller): $\sec^a(x_0)$ is the smallest value of $\sec(x)$ on the interval from $\left[x_0, \frac{\pi}{2}\right)$, so then we just multiply by the length of the interval: $\frac{\pi}{2} - x_0$.
Right Part (Larger): This is because we have chosen $A$ and $x_0$ such that $A\sin(x_0) \geq 1$ and thus, for all $x$, $x_0 < x < \frac{\pi}{2}$, $\frac{A\sin(x)}{\cos^a(x)} > \frac{1}{\cos^a(x)}$.
The only thing left is to prove such an $A$ and $x_0$ exist. They do because $\sin(x)$ monotonically increases on the interval $\left[0, \frac{\pi}{2}\right)$, going from $0$ to $1$ (you can formally prove this by showing that the derivative of $\sin(x)$, $\cos(x)$, is greater than zero on the interval $\left(0, \frac{\pi}{2}\right)$). If we choose any point, $0 < x_0 < \frac{\pi}{2}$, we can find the value of $\sin(x_0)$, then choose $A = \frac{1}{\sin(x_0)}$. Because $\sin(x)$ monotonically increases, if $A\sin(x_0) \geq 1$, then for all $x$ such that $x_0 < x < \frac{\pi}{2}$, $A\sin(x) > A\sin(x_0) \geq 1$.
