How do we solve the integral $\int \frac{1}{x^2-y}\mathrm{d}x$? The integral to be solved is given by:
$$ I = \int \frac{1}{x^2-y}\mathrm{d}x$$
I was wondering what integral substitution I would need to make. I looked at symbolab and it directed me to use $x = u\sqrt{y}$ as a substitution, but where does it come from?
 A: You don't have to make a substitution to solve this integral. Take a look at the following if $y>0$:
$$\frac{1}{x^2-y} = \frac{1}{(x-\sqrt y)(x+\sqrt y)} = \frac{1}{2\sqrt y} \frac{(x+\sqrt y) - (x-\sqrt y)}{(x-\sqrt y)(x+\sqrt y)}$$
$$=\frac{1}{2\sqrt y} \left(\frac{1}{x-\sqrt y} - \frac{1}{x+\sqrt y}\right)$$
I hope you can directly the integrate this now. By the way, this is popularly known as the partial fractions technique.
If $y=0$, there is nothing to talk about. If $y<0$, you can still split the integrand as:
$$\frac{1}{x^2-y} = \frac{1}{(x-i\sqrt{-y})(x+i\sqrt{-y})}=\frac{1}{2i\sqrt{-y}} \left(\frac{1}{x-i\sqrt{-y}} - \frac{1}{x+i\sqrt{-y}}\right)$$
There is nothing special about the introduction of $i = \sqrt{-1}$, you can still integrate everything in the usual way, while keeping in mind that only the real part of the expression is of interest to us. The imaginary part will anyway turn out to be zero in this case.
P.S. I assumed $y$ is a constant w.r.t. $x$ because that's what we do unless otherwise specified.
A: Here, you need to regard $y$ as a constant, at least for this integral.
The right substitution really depends on the sign of $y$. If $y > 0$, then $x = u\sqrt{y}$ is appropriate. If $y < 0$, then you want $x = u \sqrt{-y}$.
The advantage of making the substitution versus what epsilon-emperor does, is that you will need to integrate a rational function, either $\frac{1}{u^2 - 1}$ or $\frac{1}{u^2 + 1}$ that has no parameters in it, rather than $\frac{1}{x^2 - y}$, which is a pain.
The answers will look different in each case. You know that the integral of $\frac{1}{u^2 + 1}$ will be an arctangent function, whereas (at least if you want to avoid inverse hyperbolic functions), you will integrate $\frac{1}{u^2 - 1}$ by partial fractions.
A: Epsilon-Emperor's trick is very good. Here is the solution using trigonometry substitution giving the same result (assuming y>0;if y<0, use similar  $\tan \theta$ substitution instead；if y=0, then it is trival).
$I = \int \frac{1}{x^2-y}\mathrm{d}x$
${x^2-y}=$y(($\frac{x}{\sqrt y})^2-1)$
set $\frac{x}{\sqrt y}$= $\sec\theta$,$dx=\sqrt y  $ $\sec\theta$ $\tan \theta $ d$ \theta$
$y((\frac{x}{\sqrt y})^2-1)$ = $y\tan\theta ^2$,
$I = \int \frac{1}{y\tan\theta ^2}\sqrt y  $ $\sec\theta$ $\tan \theta$ d$ \theta$
=$\int \frac{1}{\sqrt y\tan\theta}  $ $\sec\theta$ d$ \theta$
=$\int \frac{1}{\sqrt y}  $ $\csc\theta$ d$ \theta$
=$\frac{1}{\sqrt y} $$ln|\csc\theta$-$\cot\theta$|+C
= $\frac{1}{2\sqrt y}$ $ln|\frac{x-\sqrt{y}}{ x+\sqrt {y}}$|+C
(last step from $\frac{x}{\sqrt y}= \sec \theta$)
A: If you follow the substitution advice "y" will go out of the integral as a constant the integration will concern another function of "u" variable that is not easy to integrate as the first one , I will recommend to you to go as x=cos(a) a trigonometric function is very flexible tool you can find your way to a form of integral with a multiplication of two trigonometric function then you can integrate by part ,sorry I don't know your mathematic level.this is as far as I can go
