When x=π/4, (3sin(π/4)+sin(π/2))/(1+cos(π/4)+cos(π/2))=
(3/√2+1)/(1+1/√2)=(3+√2)/(1+√2); but tan(π/4)=1, so the identity is false.
(3sin(x)+sin(2x))/(1+cos(x)+cos(2x))=
(3sin(x)+2sin(x)cos(x))/(1+cos(x)+2cos2(x)-1)=
sin(x)(3+2cos(x))/(cos(x)(1+2cos(x)))=tan(x)(3+2cos(x))/(1+2cos(x)).
The identity should have been:
(sin(x)+sin(2x))/(1+cos(x)+cos(2x))=tan(x).