To prove
#2tan^-1(tan (A/2) * tan(pi/4 - B/2))=tan^-1((sinAcosB)/(cosA+sinB))#
Let #A/2=x and (pi/4-B/2)=y#
so
#2x=Aand 2y=pi/2-B#
Now
#LHS=2tan^-1(tan (A/2) * tan(pi/4 - B/2))#
#=2tan^-1(tanx * tany)#
#=tan^-1((2tanx * tany)/(1-tan^2x * tan^2y))#
#=tan^-1((2tanx * tany*cos^2x*cos^2y)/(cos^2xcos^2y-tan^2xtan^2y*cos^2xcos^2y))#
#=tan^-1((2sinx cosx*2sinycosy)/(2(cos^2xcos^2y-sin^2xsin^2y)))#
#=tan^-1((sin2x sin2y)/(2(cosxcosy-sinxsiny)(cosxcosy+sinxsiny)))#
#=tan^-1((sin2x sin2y)/(2cos(x+y)cos(x-y)))#
#=tan^-1((sin2x sin2y)/(cos(2x)+cos(2y)))#
#=tan^-1((sinA sin(pi/2-B))/(cosA+cos(pi/2-B)))#
#=tan^-1((sinA cosB)/(cosA+sinB))=RHS#
Proved