$f(x)=a\sin x + b \cos x\equiv 0$ Let $$f(x)=a\sin x + b \cos x$$
where a,b are some constants.
Let there are exists $x_1, x_2$ such that $$f(x_1)=f(x_2)=0$$ $x_1-x_2\not =\pi k, k \in \mathbb Z $ .
Prove that $f(x)=0$ for all $x\in \mathbb R$. And is it $a=b=0$ in this case or not?
###My work
I see that $f(x_1)=f(x_2)=0$.
$$a\sin x_1 + b \cos x_1=0 \Rightarrow \tan x_1=-\frac ba $$
$$a\sin x_2 + b \cos x_2=0 \Rightarrow \tan x_2=-\frac ba $$
Hence, $\tan x_1-\tan x_2=0$. Then $\sin(x_1- x_2)=0 \Rightarrow x_1-x_2=\pi k$.
But $x_1-x_2\not =\pi k$.
Where my mistake? How I need continue to solve my problem?
 A: Your assumption that $a$ is $0$ is wrong. For $a\ne 0$ the result is true. But then we arrive at a contradiction, implying that $a=0\implies b=0$
A: Keep $\tan$ out of the game.
When $(a,b)\ne(0,0)$ then the point $(a,b)\in{\mathbb R}^2$ has distance $A:\sqrt{a^2+b^2}>0$ from the origin, and there is a unique $\phi\in[0,2\pi[\>$ such that
$$a=A\cos\phi,\quad b=A\sin\phi\ .$$
It follows that
$$f(x)=A(\cos\phi\sin x+\sin\phi\cos x)=A\sin(x+\phi)\ ,$$
so that $f$ has two zeros differing $\pi$ modulo $2\pi$. Since such pairs of zeros have been excluded it follows that in fact $(a,b)=(0,0)$, so that $f(x)\equiv0$.
A: Actually, the solution is much easier than this.  We have the system $$a \sin x_1 + b \cos x_1 = 0, \\ a \sin x_2 + b \cos x_2 = 0,$$ so $$a \sin x_1 \sin x_2 + b \cos x_1 \sin x_2 = 0, \\ a \sin x_1 \sin x_2 + b \cos x_2 \sin x_1 = 0,$$ hence $$b (\cos x_1 \sin x_2 - \cos x_2 \sin x_1) = b \sin (x_2 - x_1) = 0,$$ and similarly, $$a \sin x_1 \cos x_2 + b \cos x_1 \cos x_2 = 0, \\ a \sin x_2 \cos x_1 + b \cos x_1 \cos x_2 = 0,$$ hence $$a (\sin x_1 \cos x_2 - \sin x_2 \cos x_1) = a \sin (x_1 - x_2) = 0.$$  But since $x_1 - x_2 \ne \pi k$ for any integer $k$, $\sin (x_1 - x_2) \ne 0$ and we are forced to conclude that $a = b = 0$.
Note that this approach does not create any issues with division by $0$--we might be multiplying by $0$, but this only creates the possibility of extraneous solutions.  But since there are no solutions except $a = b = 0$, we don't need to perform any additional checking.
A: Let $$f(x)=a\sin x+b\cos x$$
where $a,b$ are two real constants ($\,a,b\in\mathbb{R}\,$) .
If there exist $x_1, x_2$ such that $$f(x_1)=f(x_2)=0$$ and $\;x_1-x_2\not=\pi k\;,\;$ for any $\;k\in\mathbb{Z}\;,\;$ then
$a=b=0\;$ and $\;f(x)=0\;$ for all $\;x\in\mathbb{R}\;.$
Proof :
$\begin{cases}
f(x_1)=0\\
f(x_2)=0
\end{cases}$
$\begin{cases}
a\sin x_1+b\cos x_1=0\\
a\sin x_2+b\cos x_2=0
\end{cases}$
The determinant of the previous system is
$D=\left|\begin{matrix}\sin x_1\quad\cos x_1\\\sin x_2\quad\cos x_2\end{matrix}\right|=\\\quad=\sin x_1\cos x_2-\cos x_1\sin x_2=\sin\big(x_1-x_2\big)\;.$
Since $\;x_1-x_2\not=\pi k\;,\;$ for any $\;k\in\mathbb{Z}\;,\;$ it results that
$D=\sin\big(x_1-x_2\big)\ne0\;.$
By using Cramer’s Rule, we get the solution of the system :
$\begin{cases}
a=\dfrac{\left|\begin{matrix}0\quad\cos x_1\\0\quad\cos x_2\end{matrix}\right|}D=0\\
b=\dfrac{\left|\begin{matrix}\sin x_1\quad0\\\sin x_2\quad0\end{matrix}\right|}D=0
\end{cases}$
Hence,
$a=b=0\;$ and $\;f(x)=0\;$ for all $\;x\in\mathbb{R}\;.$
