Question: Sorry to ask about a (probably) faily easy task, but I am new to integrals and can't solve this one:

I am trying to calculate $\displaystyle \int \frac{dx}{2-x^2}$. 

The solution is $\displaystyle \frac{\log(x+\sqrt{2})-\log(\sqrt{2}-x)}{2\sqrt{2}}$, but I don't know how to get there. 

It must have something to do with the rule $\displaystyle \int \frac{1}{x} = log(|x|)+c$.

I thought about writing $\displaystyle \int \frac{1}{(2-x^2)}$ as $\displaystyle \int (2-x^2)^{-1}$, but the rule for potences is not applicable here as it seems, because we would divide by zero. 

So there must be multiple rules to get to the above term. Which ones would you use?

Answer: 
You can do partial fraction decomposition: $$\frac{ 1}{(2 - x^2)} =\frac A{\sqrt 2 - x} + \frac B{\sqrt 2 + x}$$

where $A(\sqrt 2+x) + B(\sqrt 2 - x) = 0\cdot x + 1$.

Then solve for $A, B$.
$$\int \frac{1}{2-x^2}dx = \int \frac{1}{2} . \frac{1}{1-\frac{x^2}{2}}dx = \frac{1}{2}\int\frac{1}{1-\frac{x^2}{2}}dx$$

Now substitue $u=\frac{x}{\sqrt{2}}$ and $du=\frac{1}{\sqrt{2}}dx$.

Remember that

$$\int \frac{1}{a^2-x^2}dx=\frac{1}{2a} \ln \frac{|a+x|}{|a-x|}+C$$ for $x\neq a$