Only the two joins can fail, so continuity gives two equations.
At x=4π. From the left, using sin4π=21:
4π+a2⋅21=4π+a
From the right, using cot4π=1:
2⋅4π⋅1+b=2π+b
Equating,
4π+a=2π+b⟹a−b=4π…(i)
At x=2π. From the left, cot2π=0, so the value is 0+b=b. From the right, cosπ=−1 and sin2π=1, so the value is −a−b. Equating,
b=−a−b⟹a+2b=0…(ii)
Solving. From (ii), a=−2b. Putting that into (i):
−2b−b=4π⟹b=−12π,a=−2b=6π
a=6π,b=−12π
Check. At 4π: left =4π+6π=125π and right =2π−12π=125π. At 2π: left =−12π and right =−6π+12π=−12π. ✓