AMC 12A 2020 Problem 9

How many solutions does the equation \tan (2 x)=\cos \left(\dfrac{x}{2}\right) have on the interval [0,2 \pi] ?

Answer Choices
A. 1
B. 2
C. 3
D. 4
E. 5