find the derivative of :

$\displaystyle (sin^2(x) + 1) / (cos^2(x) + 1)$

I tried just using a combination of quotient and chain rule, but I got some REALLY huge nasty answer. I'm thinking there is someway to simplify this, but not sure how.

Someone told me this was the answer, but I'm not sure how they got it :

$\displaystyle sin(2x) + (2sec(x)^2) * (tan(x))$