Simplifying Differentiation I'm working off my textbook and I've followed the steps easily enough until it gets to this

$ \dfrac {dy}{dx} = \dfrac{(x^2 + 1)^3}{2 \sqrt{x - 1}} + \sqrt{x-1}~(6x)~(x^2 + 1)^2$
$= \dfrac{(x^2 + 1)^2}{2\sqrt{x - 1})}[(x^2 + 1) + 12x(x - 1)]$
$= \dfrac{(x^2 + 1)^2(13x^2 - 12x + 1)}{2\sqrt{x - 1}}$

How do they go from the first line onwards?
Thanks in advance (sorry about formatting)

I will assume that we are looking at
$$\frac{(x^2+1)^3}{2\sqrt{x-1}} +\sqrt{x-1}(6x)(x^2+1)^2.$$
Take out the common factor $(x^2+1)^2$, and multiply and divide by $2\sqrt{x-1}$. We get
$$\frac{(x^2+1)^2}{2\sqrt{x-1}}\left((x^2+1)+(2)(x+1)(6x)     \right).$$
Now simplify the expression on the right. 
That seems to be the way it was thought of. I would prefer to first bring the expression to the common denominator $2\sqrt{x-1}$. We then get 
$$\frac{(x^2+1)^3 +2(x-1)(6x)(x^2+1)^2}{2\sqrt{x-1}}.$$
Now take out the common factor 
$\dfrac{(x^2+1)^2}{2\sqrt{x-1}}$. Perhaps that was the way it was done, with a step skipped. 
Remark: If you have seen the (natural) logarithm already, the following approach, called logarithmic differentiation, may appeal to you. It is of at most marginal utility in this problem, but could be useful when differentiating a longer product. 
We were differentiating $(x^2+1)^3 \sqrt{x-1}$. Let
$$y=(x^2+1)^3\sqrt{x-1}.$$
Take the natural logarithm of both sides. Using "laws of logarithms," we get
$$\ln y=3\ln(x^2+1)+\frac{1}{2}\ln(x-1).$$
Differentiate, using the Chain Rule. We get
$$\frac{1}{y}\frac{dy}{dx}=\frac{6x}{x^2+1} +\frac{1}{2(x-1)}.$$
Finally, multiply by $y$ to get $\frac{dy}{dx}$. 
