Determining convergence of improper integrals including $ \int_{0} ^ {1} \frac{\ln\left(1+e^x\right)-x}{x^2}\text{d}x $ Will you please help me figure out whether the following improper integrals converge or not? 

  
*
  
*$$
\int _ {0} ^ {\infty}  \frac{x^2}{2^x}\text{d}x
 $$
  
*$$
\int_{0} ^ {1} \frac{\ln\left(1+e^x\right)-x}{x^2}\text{d}x
$$

As for the first one, I have no idea. 
As for the second,
I have tried rewriting it as:
$$
\int_{0} ^ {1} \frac{\ln\left(\frac{1+e^x}{e^x}\right)}{x^2}\text{d}x
$$
but I have no idea if it helps me or not.
Thanks in advance.
 A: Hint You're on the right track with your manipulation in (2). Since $e^x$ is increasing, for all $x \in [0, 1]$ we have $$\frac{1 + e^x}{e^x} = 1 + \frac{1}{e^x} \geq 1 + \frac{1}{e} =: C > 0 .$$ Since $\log$ is increasing, we have 
$$\frac{\log\left(\frac{1 + e^x}{e^x}\right)}{x^2} \geq \frac{\log C}{x^2} $$ on $(0, 1]$. What can you say about the integral $$\int_0^1 \frac{\log C}{x^2} \, dx$$ relevant to the (direct) comparison test?
For (1), one can determine convergence again by comparing the integrand to a judiciously chosen function.

Additional hint For (1), show that $x^2 \leq a^x$ for all sufficiently large $x$ for some suitable constant $a$.

Remark One can also determine the convergence of the integral in (1) by evaluating it directly, though this is probably slower: Applying integration by parts twice shows that it has value $\frac{2}{(\log 2)^3}$.
A: In the first case we may note $f(x) = \frac{x^2}{2^x}$ defines a decreasing  function for all $x > \frac{1}{\ln 2}$ since
$$ f'(x) = \frac{2x}{2^x} - \frac{\ln 2 x^2}{2^{x}} = \frac{2x(1 - \ln 2 x)}{2^x} < 0$$
Hence we may split the integral as follows 
$$ \int_0^\infty \frac{x^2}{2^x} \ dx = A + \int_\frac{1}{\ln 2}^\infty \frac{x^2}{2^x}, \ A \in \mathbb{R}$$
Now since the integrand in the latter part is decreasing, and the terms in the integrand are positive then if the series
$$ S = \sum_{n=0}^\infty \frac{n^2}{2^n}$$
converges it follows that the latter part of the integral converges. Lucky for you this series converges, and its value may be found by considering the geometric series with value $x = \frac{1}{2}$, its derivatives, and some nice algebra. Alternatively apply whatever series convergence test you are familiar with.
In the second case consider the function
$$ g(x) = \ln(1 + e^x) - x$$
We have
$$ g'(x) = \frac{e^x}{1 + e^x} - 1$$
Since
$$ \frac{e^x}{1 + e^x} < 1$$
We must have
$$ g'(x) < 0$$
Hence $g(x)$ is a decreasing function and $g(0) = \ln(1 + e)$ hence for $x \in [0,1]$ we have
$$ \int_0^1 \frac{\ln(1 + e^x) - x}{x^2} \ dx \geq \int_0^1 \frac{\ln(1 + e)}{x^2} \ dx$$
which does not converge, hence the original integral does not converge.
