How to integrate $\int \frac{dx}{\sqrt{ax^2-b}}$

So my problem is to integrate

$$\int \frac{dx}{\sqrt{ax^2-b}},$$

where $a,b$ are positive constants. What rule should I use here? Should substitution be used or trigonometric integrals?

The solution should be:

$$\frac{\log\left(\sqrt{a}\sqrt{ax^2-b}+ax\right)}{\sqrt{a}}+C$$

Thank you for any help =)

Solutions Collecting From Web of "How to integrate $\int \frac{dx}{\sqrt{ax^2-b}}$"

The question says “Should substitution be used or trigonometric integrals?”. But a trigonometric substitution is a substitution, not an alternative to substitution.
$$
\int \frac{dx}{\sqrt{ax^2-b}} = \int\frac{dx/\sqrt{b}}{\sqrt{\frac a b x^2 – 1}} = \int \frac{\sec\theta\tan\theta\,d\theta/\sqrt{a}}{\sqrt{\sec^2\theta – 1}}
$$
Then use the fact that $\sec^2\theta-1=\tan^2\theta$. The substitution is $\sec\theta=x\sqrt{\frac a b}$ so that $\sec\theta\tan\theta\,d\theta=dx\sqrt{\frac a b}$ and thus $\sec\theta\tan\theta\,d\theta/\sqrt{a} = dx/\sqrt{b}$.

$$
\begin{array}{cc|c|c}
& \text{When you have} & \text{then use} & \text{so that} \\
\hline
& (\text{variable})^2 + \text{positive constant} & \text{variable}=\tan\theta & \tan^2\theta+1\text{ becomes }\sec^2\theta \\
& (\text{variable})^2 – \text{positive constant} & \text{variable}=\sec\theta & \sec^2\theta-1\text{ becomes }\tan^2\theta \\
& \text{positive constant} – (\text{variable})^2 & \text{variable}=\sin\theta & 1-\sin^2\theta\text{ becomes }\cos^2\theta \\
\end{array}
$$
In the last one, $\cos\theta$ rather than $\sin\theta$ will also work.

Use the substitution: $\,\,u=\sqrt{\dfrac ab}x$. You ‘ll have to integrate $ \displaystyle\int \dfrac{\mathrm d\, u}{\sqrt{u^2-1}} $.
Now either you’ve heard of inverse hyperbolic functions and you have the answer.
Either you only know hyperbolic functions; then you can use the substitution: $u=\cosh t,\enspace t\ge 0$. At the end, you’ll have to compute the inverse cosh.

Here’s a good way to approach these sorts of integration problems. It won’t always lead you directly to a solution, but it often works. When I write “these sorts,” what I mean is: integrals with Pythagorean expressions in them; i.e., sums or differences of squares inside of a radical (or raised to a power that’s an integer multiple of $\frac{1}{2}$).

Notice that $\sqrt{ax^2 – b} = \sqrt{(\sqrt{a}x)^2 – (\sqrt{b})^2}$ is of that form. Sketch a right triangle with the hypotenuse of length $\sqrt{a}x$ and a leg of length $\sqrt{b}$. Name the angle between these two sides $\theta$. Then, the radical expression is the length of the third leg (opposite angle $\theta$).

Write down the trigonometric relationship between $x$ and $\theta$ suggested by your picture.

$$\cos \theta = \frac{\sqrt{b}}{\sqrt{a}x} \qquad\Longleftrightarrow\qquad \sqrt{b}\sec\theta = \sqrt{a}x$$

From here, you can write down the radical expression in terms of $\tan \theta$ and complete the exercise from there.

You have some help here Integrate: $\int \frac{dx}{x \sqrt{(x+a) ^2- b^2}}$
– same case after substitution x=1/y