Showing that $\int_0^\infty \frac{|\cos x|}{1+x} \, dx$ diverges (Baby Rudin Exercise 6.9) Motivated by Baby Rudin Exercise 6.9
I need to show that $\int_0^\infty \frac{|\cos x|}{1+x} \, dx$ diverges.
My attempt: 
$\frac{|\cos x|}{1+x} \geq \frac{\cos^2 x}{1+x}$, and then $\int_0^\infty \frac{\cos^2 x}{1+x} \, dx + \int_0^\infty \frac{\sin^2 x}{1+x} \, dx = \int_0^\infty \frac{1}{1+x} \, dx$. 
Since the right integral diverges, either or both of the integrals on the left most diverge. Since both diverge (at least I'm inclined to believe), now if I show that $\int_0^\infty \cos^2 x / (1+x) \, dx \geq \int_0^\infty \sin^2 x / (1+x) \, dx $ we'll be done. Here's where I am stuck.
 A: You're on the right track. Since $\cos^2(x + {\pi \over 2}) = \sin^2 x$, 
$$\int_{0}^{\infty} {\cos^2 x   \over 1 + x}\,dx = \int_{{\pi \over 2}}^{\infty} {\cos^2 (x - {\pi \over 2})  \over 1 + (x - {\pi \over 2})}\,dx $$
$$= \int_{{\pi \over 2}}^{\infty} {\sin^2 x  \over 1 + (x - {\pi \over 2})}\,dx $$
$$> \int_{{\pi \over 2}}^{\infty} {\sin^2 x  \over 1 + x}\,dx $$
Although the integral here starts at ${\pi \over 2}$, the first part will always be finite. So if $\int_{0}^{\infty} {\sin^2 x  \over 1 + x}\,dx $ is
infinite, so is $\int_{{\pi \over 2}}^{\infty} {\sin^2 x  \over 1 + x}\,dx$, and therefore by the above so is $\int_{0}^{\infty} {\cos^2 x   \over 1 + x}\,dx $.
A: $\int_{\pi/2}^{\infty} \frac{|\cos x|}{1+x} =
\sum_{r=0}^{\infty} \int_{\pi/2 + \pi r}^{\pi/2 + \pi r+1} \frac{|\cos x|}{1+x}dx \geq
\sum_{r=0}^{\infty} \int_{\pi/2 + \pi r}^{\pi/2 + \pi r+1} \frac{|\cos x|}{1+(\pi/2 + \pi r+1)}dx =
\sum_{r=0}^{\infty} \frac{1}{1+(\pi/2 + \pi r+1)} \int_{\pi/2 + \pi r}^{\pi/2 + \pi r+1} |\cos x| dx =
 \int_{\pi/2}^{\pi/2 + \pi} |\cos x| dx \sum_{r=0}^{\infty} \frac{1}{1+(\pi/2 + \pi r+1)} = 
\infty$
Basically, split the integral up into regions from $[\pi/2, 3\pi/2], [3\pi/2, 5\pi/2] \dotso $ and consider the lowest value of $\frac{1}{1+x}$ in that region. Use the fact that the Harmonic series diverges.
[edit] Fixed.
A: We have
\begin{align}
I_n & = \int_{n\pi}^{(n+1)\pi} \dfrac{\vert \cos(x) \vert}{1+x}dx = 2\int_{n\pi}^{n\pi+\pi/2} \dfrac{\vert \cos(x) \vert}{1+x}dx \geq 2\int_{n\pi}^{n\pi+\pi/6} \dfrac{\vert \cos(x) \vert}{1+x}dx\\
& \geq 2 \int_{n\pi}^{n\pi+\pi/6} \dfrac{1/2}{1+x}dx =\int_{n\pi}^{n\pi+\pi/6} \dfrac{dx}{1+x} > \int_{n\pi}^{n\pi+\pi/6} \dfrac{dx}{(n+2)\pi} = \dfrac1{6(n+2)}
\end{align}
Hence, your integral is bounded below by $\sum_{n=0}^{\infty} I_n$, which clearly diverges.
A: The integrand function is positive and for every $x\in\mathbb{R}^+$ close to an element of $\pi\mathbb{Z}$ we have that $|\cos x\,|$ is close to one. For instance, if the distance between $x$ and $\pi\mathbb{Z}$ is $\leq\frac{\pi}{3}$ we have $|\cos x\,|\geq\frac{1}{2}$. That gives:
$$\int_{0}^{n\pi}\frac{\left|\cos x\right|}{1+x}\,dx = \pi \int_{0}^{n}\frac{\left|\cos(\pi x)\right|}{1+\pi x}\,dx \geq \frac{\pi}{2}\sum_{k=1}^{n-1}\int_{k-1/3}^{k+1/3}\frac{dx}{1+\pi x}$$
and the last sum is greater than:
$$\frac{\pi}{3}\sum_{k=1}^{n-1}\frac{1}{\left(1+\frac{\pi}{3}\right)+\pi k}\geq\frac{H_n-1}{3}.$$
We may also use integration by parts together with the identity:
$$ \int_{0}^{y}|\cos x\,|\,dx =\frac{2}{\pi} y +O(1) $$
that gives:

$$ \int_{0}^{y}\frac{|\cos x\,|}{1+x}\,dx = O(1)+\frac{2}{\pi}\int_{0}^{y}\frac{x\,dx}{(1+x)^2} =\frac{2}{\pi}\,\log(y+1)+O(1).$$

