Given :
sin3x(sin3x−cosx)=sinx(sinx−cos3x)⇒sin23x−sin2x=sin3xcosx−sinxcos3x⇒(sin3x−sinx)(sin3x+sinx)=sin2x⇒sin2xsin4x=sin2x⇒sin2x(sin4x−1)=0⇒sin2x=0 or sin4x=1
When sin2x=0, we get
2x=0,π,2π,3π,4π⇒x=0,π2,π,3π2,2π
When sin4x=1, we get
4x=π2,5π2,9π2,13π2⇒x=π8,5π8,9π8,13π8
Therefore, the sum of all possible values of x is
5π+7π2=17π2=aπb∴a+b=19