These are examples of improper integrals. If the function is not defined at some point on your region of integration, you need to evaluate a limit.

In your first example, you need to rewrite this as

Can you go from there?

In the second example, you need to break it up into two definite integrals.