We will need the following 3 formulas:

`sin2x=2sinxcosx` if we put `x/2` ` ` instead of `x` we get

`sinx=2sin (x/2) cos (x/2)` **(1)**

`cos2x=cos^2x-sin^2x` if we put `x/2` instead of `x` we get

`cos x=cos^2(x/2)-sin^2(x/2)` **(2)**

`sin^2x+cos^2x=1` if we put `x/2` instead of `x` we get

`sin^2(x/2)+cos^2(x/2)=1` ** (3)**

Now let's start from the left side and thry to get the right hand side.

`(sinx+sin(x/2))/(1+cosx+cos^2(x/2))=`

Now we use formula (1) for numerator and formula (2) for denominator.

`(2sin(x/2)cos(x/2)+sin(x/2))/(1+cos^2(x/2)-sin^2(x/2)+cos(x/2))=`

Now we use formula (3) for `1` in denominator.

`(sin(x/2)(2cos(x/2)+1))/(sin^2(x/2)+cos^2(x/2)+cos^2(x/2)-sin^2(x/2)+cos(x/2))=`

`(sin(x/2)(2cos(x/2)+1))/(2cos^2(x/2)+cos(x/2))=(sin(x/2)(2cos(x/2)+1))/(cos(x/2)(2cos(x/2)+1))=(sin(x/2))/(cos(x/2))=`

and since `tan x=(sinx)/(cosx)` we get

`tan(x/2)`

which proves your identity.