\(cotb=a\Rightarrow\frac{cosb}{sinb}=a\Rightarrow cosb=a.sinb\)
\(sin\left(2b-\frac{\pi}{4}\right)=\frac{\sqrt{2}}{2}\left(sin2b-cos2b\right)\)
\(=\sqrt{2}sinb.cosb-\frac{\sqrt{2}}{2}\left(1-2sin^2b\right)=a\sqrt{2}sin^2b+\sqrt{2}sin^2b-\frac{\sqrt{2}}{2}\)
\(=\left(a\sqrt{2}+\sqrt{2}\right)sin^2b-\frac{\sqrt{2}}{2}=\left(a\sqrt{2}+\sqrt{2}\right).\frac{1}{1+cot^2b}-\frac{\sqrt{2}}{2}\)
\(=\frac{a\sqrt{2}+\sqrt{2}}{1+a^2}-\frac{\sqrt{2}}{2}\)