Disclaimer: don't take my work as gospel, but here is my working:
#(1-cosx+sinx)/(1+cosx+sinx)=(1-cosx+sinx)/(1+cosx+sinx)*(1+cosx+sinx)/(1+cosx+sinx)#
Multiplying by #a/a# effectively doesn't change the value of the sum.
#=(1-cos^2x+sin^2x+2sinx)/(1+sin^2x+cos^2x+2sinx+2cosx+2sinxcosx)#
From the identity #sin^2x+cos^2x=1# thus #sin^2x=1-cos^2x#:
#=(2sin^2x+2sinx)/(2+2sinx+2cosx+2sinxcosx)#
#=[cancel2(sin^2x+sinx)]/(cancel2 (1+sinx+cosx+sinxcosx)#
#=(sin^2x+sinx)/(sinxcosx+sinx+cosx+1)#
Take out a factor of #sinx# on the top and factorise the bottom to get:
#=[sinx(cancel(sinx+1))]/[(cancel(sinx+1))(cosx+1)#
#=sinx/(cosx+1)#
I'm not too sure how to simplify this further. I almost feel like there is a sort of #sinx/cosx=tanx# going on, but I can't manipulate the fraction to do so. According to wolframalpha, this fraction simplifies to #tan(x/2)# but I'm not sure how to get there. Sorry...
Hope this helps