Help differentating $f(x) = \sqrt\frac{x^2-1}{x^2+1}$ The equation I'm trying to differentiate is, $ f(x) = \sqrt\frac{x^2-1}{x^2+1}$ and I know the answer is meant to be 
$$=\frac{\frac{x\sqrt {x^2+1}}{\sqrt {x^2-1}}-\frac{x\sqrt {x^2-1}}{\sqrt {x^2+1}}}{x^2+1}$$
But when I do the working out I get this
$$=\frac{(x^2-1)^\frac{1}{2}}{(x^2+1)^\frac{1}{2}}$$ 
$$=\frac{\frac{1}{2}(x^2-1)^\frac{-1}{2}\cdot2x\cdot(x^2+1)^\frac{1}{2}-(x^2-1)^\frac{1}{2}\cdot\frac{1}{2}(x^2+1)^\frac{-1}{2}\cdot2x}{x^2+1}$$
simplify 
$$=\frac{x(x^2-1)^\frac{-1}{2}\cdot(x^2+1)^\frac{1}{2}-(x^2-1)^\frac{1}{2}\cdot x(x^2+1)^\frac{-1}{2}}{x^2+1}$$
$$=\frac{\frac{\sqrt {x^2+1}}{x\sqrt {x^2-1}}-\frac{\sqrt {x^2-1}}{x\sqrt {x^2+1}}}{x^2+1}$$
As you can see two of my $x$'s are in the wrong location, and I just can't figure out what I'm doing wrong.  Any help as to what steps I'm doing wrong or missing would be much appreciated.
 A: Going from your second last line to the last line, you put the $x$ factors into the denominator. Instead, you need to leave them in the numerator. This is because the power of $\frac{-1}{2}$ only apply to the expressions in the brackets, but the $x$ factors are outside of the brackets, so they are not affected. Thus, for example, with the first term in the numerator, you have
$$\begin{equation}\begin{aligned}
x(x^2-1)^\frac{-1}{2}\cdot(x^2+1)^\frac{1}{2} & = x\left((x^2-1)^\frac{-1}{2}\cdot(x^2+1)^\frac{1}{2}\right) \\
& = x\left(\frac{\sqrt {x^2+1}}{\sqrt {x^2-1}}\right) \\
& = \frac{x\sqrt {x^2+1}}{\sqrt {x^2-1}}
\end{aligned}\end{equation}\tag{1}\label{eq1}$$
A: You have erroneously transposed the two lone $x$'s in the second-last line into $1/x$'s in the last. (That is, they incongrously turn from being mulitplied with the radicals to dividing them.)
$$=\frac{\color{blue}x(x^2-1)^\frac{-1}{2}\cdot(x^2+1)^\frac{1}{2}-(x^2-1)^\frac{1}{2}\cdot \color{blue}x(x^2+1)^\frac{-1}{2}}{x^2+1}$$
$$=\frac{\frac{\sqrt {x^2+1}}{\color{red}x\sqrt {x^2-1}}-\frac{\sqrt {x^2-1}}{\color{red}x\sqrt {x^2+1}}}{x^2+1}$$
A: Just a small trick.
When you face expressions which contains products, quotients, powers, logarithmic differentiation makes life easier.
$$y= \sqrt\frac{x^2-1}{x^2+1}\implies \log(y)=\frac 12 \log(x^2-1)-\frac 12 \log(x^2+1)$$ Differentiate both sides
$$\frac {y'} y=\frac 12 \frac {2x}{x^2-1}-\frac 12 \frac {2x}{x^2+1}=\frac{2x}{(x^2-1)(x^2+1)}$$
$$y'=y\times\frac {y'} y=\sqrt\frac{x^2-1}{x^2+1}\times\frac{2x}{(x^2-1)(x^2+1)}$$ and simplify.
