I need to find the derivative of

a) g(x) = (x-e^(-2x)) / (1-x*e^(-2x))

b) f(y) = cos[sqrt(x^2 + 4)]

For a) i get up to

[(1 + 2e^-2x)(1 - xe^-2x) + (e^-2x - 2xe^-2x)(x - e^-2x)] / (1 - xe^-2x)

but it's supposed to somehow be simplified to -2(x+1) / (x-1)

I don't know how to get here from my answer.

for b) I just need help finding the inverse and then I can find the derivatives myself