## Final Answer

## Step-by-step Solution

Problem to solve:

Solving method

We can solve the integral $\int\frac{x}{x^2-1}dx$ by applying integration method of trigonometric substitution using the substitution

Differentiate both sides of the equation $x=\sec\left(\theta \right)$

Find the derivative

Taking the derivative of secant function: $\frac{d}{dx}\left(\sec(x)\right)=\sec(x)\cdot\tan(x)\cdot D_x(x)$

Now, in order to rewrite $d\theta$ in terms of $dx$, we need to find the derivative of $x$. We need to calculate $dx$, we can do that by deriving the equation above

Substituting in the original integral, we get

Apply the trigonometric identity: $\sec\left(x\right)^2-1$$=\tan\left(x\right)^2$, where $x=\theta $

Simplify the fraction by $\tan\left(\theta \right)$

We can solve the integral $\int\frac{\sec\left(\theta \right)^2}{\tan\left(\theta \right)}d\theta$ by applying integration by substitution method (also called U-Substitution). First, we must identify a section within the integral with a new variable (let's call it $u$), which when substituted makes the integral easier. We see that $\tan\left(\theta \right)$ it's a good candidate for substitution. Let's define a variable $u$ and assign it to the choosen part

Differentiate both sides of the equation $u=\tan\left(\theta \right)$

Find the derivative

The derivative of the tangent of a function is equal to secant squared of that function times the derivative of that function, in other words, if ${f(x) = tan(x)}$, then ${f'(x) = sec^2(x)\cdot D_x(x)}$

The derivative of the linear function is equal to $1$

Now, in order to rewrite $d\theta$ in terms of $du$, we need to find the derivative of $u$. We need to calculate $du$, we can do that by deriving the equation above

Isolate $d\theta$ in the previous equation

Simplify the fraction $\frac{\frac{\sec\left(\theta \right)^2}{u}}{\sec\left(\theta \right)^2}$ by $\sec\left(\theta \right)^2$

Substituting $u$ and $d\theta$ in the integral and simplify

Any expression multiplied by $1$ is equal to itself

The integral of the inverse of the lineal function is given by the following formula, $\displaystyle\int\frac{1}{x}dx=\ln(x)$

Replace $u$ with the value that we assigned to it in the beginning: $\tan\left(\theta \right)$

Express the variable $\theta$ in terms of the original variable $x$

Any expression divided by one ($1$) is equal to that same expression

As the integral that we are solving is an indefinite integral, when we finish integrating we must add the constant of integration $C$