Solving $a\mathrm{sin}x+b\mathrm{cos}x=c$

Suppose $a\mathrm{sin}x+b\mathrm{cos}x=c$ . My teacher told me that with changing variable we can solve it by this : $(c+b){t}^{2}-2at+(c-b)=0$ where $t=\mathrm{tan}\frac{x}{2}$ . I thought it is true always but today found a problem . When we define $\mathrm{sin}x$ and $\mathrm{cos}x$ with $\mathrm{tan}\frac{x}{2}$ , we should consider $\mathrm{cos}\frac{x}{2}\ne 0$ and $x\ne 2k\pi +\pi $ but it can be the answer of the main equation (i.e. $a\mathrm{sin}x+b\mathrm{cos}x=c$ ) ! So , that formula is incomplete ?

Suppose $a\mathrm{sin}x+b\mathrm{cos}x=c$ . My teacher told me that with changing variable we can solve it by this : $(c+b){t}^{2}-2at+(c-b)=0$ where $t=\mathrm{tan}\frac{x}{2}$ . I thought it is true always but today found a problem . When we define $\mathrm{sin}x$ and $\mathrm{cos}x$ with $\mathrm{tan}\frac{x}{2}$ , we should consider $\mathrm{cos}\frac{x}{2}\ne 0$ and $x\ne 2k\pi +\pi $ but it can be the answer of the main equation (i.e. $a\mathrm{sin}x+b\mathrm{cos}x=c$ ) ! So , that formula is incomplete ?