Find the period of $f(x)=\sin^2(x)$ $f(x+p)=f(x)$
$\sin^2(x+p)=\sin^2(x)$
$\sin^2(x+p)-\sin^2(x)=0$
$[\sin(x+p)-\sin(x)][\sin(x+p)+\sin(x)]=0$
$\sin(x+p)-\sin(x)=0$
$\sin(x+p)=\sin(x)$
This is the part iI don't get:
$x+p=x+2kπ$
$p=2kπ$
My question: how did we get $x+p=x+2kπ$ from $\sin(x+p)=\sin(x)$
And yeah I know the exercise doesn't end there, but I only want to understand this part first.
 A: To answer the question directly, suppose $\sin^2x $ is periodic with period $p$.  We need to find the smallest $p > 0$ such that
\begin{equation}
\sin^2(x+p) = \sin^2 x \tag{1}\label{eq1}
\end{equation}
for all $x$, if such exists.
Method 1:
$\cos 2x = \cos^2 x - \sin^2 x = 1 - 2\sin^2 x$.  Therefore, $\sin^2x = \frac{1}{2}\Big( 1 - \cos2x \Big)$.  If you accept that $\sin$ and $\cos$ are both periodic with period $2\pi$ it is thus apparent that $\sin^2x$ is also periodic with period $\pi$.
Method 2:
Suppose $\sin^2x$ is periodic with period $p$.  Then taking $x=0$ in equation \eqref{eq1} gives $\sin^2 p = 0$.  Now we are only interested in the smallest positive $p$ and therefore we must have $p \geqslant \pi$ since $\pi$ is the smallest positive zero of $\sin x$.  Now take $p = \pi$.
\begin{align}
\sin^2(x+\pi) -\sin^2 x &= \Big(\sin(x+\pi)-\sin(x)\Big)\Big(\sin(x+\pi) +\sin (x)\Big) \\
&= \Big(\sin x \cos \pi + \cos x \sin \pi - \sin x\Big)\Big(\sin x \cos \pi + \cos x \sin \pi + \sin x\Big) \\
&=\Big(-\sin x - \sin x\Big)\Big(-\sin x + \sin x\Big) \\
&=0
\end{align}
So we have $\sin^2(x+\pi) = \sin^2(x) $ for all $x$ and $\pi$ is the smallest number with this property so $\sin^2 x$ is periodic with period is $\pi$.
A: That is not quite correct, as we have the basic equivalence for equations in sines:
$$\sin x=\sin y\iff \begin{cases}x\equiv y\mod 2\pi &\text{or} \\x\equiv \pi -y\mod 2\pi.\end{cases}$$
The initial equation can also be solved  linearising both sides:
$$\sin^2(x+p)=\sin^2x\equiv \frac{1-\cos 2(x+p)}{2}=\frac{1-\cos2x}{2}\iff =\cos 2(x+p)=\cos 2x\\\iff 2(x+p)\equiv \pm 2x\mod 2\pi.$$
A: The equation $f(x+p) = f(x)$ is the definition of a periodic function, which you have used on $f(x) = \sin^2(x)$ to reach the conclusion that $\sin(x+p) = \sin(x)$ must hold. If it was another function that we knew nothing about, we couldn't really go any further but say that $\sin^2(x)$ and $\sin(x)$ have the same period. But because this is the sine function which we understand very well, we know that its period is $2\pi$. Thus, the output of the function is repeated at $2\pi,4\pi,6\pi$... Hence we can say that the input of the function must satisfy $x+p=x+2k\pi$.
To give a different example.. say we arrived to the case where we had $\tan(x+p) = \tan(x)$ instead. Here, we know that the period of $tan$ is $\pi$, so we can conclude that $x+p=x+k\pi$.
A: Before we start consider this preliminary question.

If $\sin a = \sin b$ solve for $b$ in terms of $a$.

Well if $(\cos a, \sin b) = (x,y)$ there is only one other point of a circle with the same $y$ value.  That would be $(-x,y)$ and that occurs if $b = \pi - a$.
so if $0\le a,b < 2\pi$ then only options are $b= a$ or $b = \pi -a$.  And if we remove the restrictions we have $b = a +2k\pi$ or $b= (2k+1)\pi -a$ for so integer $k$.
....
Now we do your question.
Suppose $\sin (x+p) = \sin x$ for all $x$.
Let $y = x+p$ and we have $\sin(y) = \sin x$ and we just did that.  $y = x +p = x +2k\pi$ or $y=x+p= (2k+1)\pi - x$.
In the first case we have $p =2k\pi$.  And in the second case $p=(2k+1)\pi - 2x$ but that makes $p$ dependent upon $x$ and won't have a single value for every possible $x$.
so if $p$ is a period it must be the first case and $p = 2k\pi$ for some $k$.  And to find "the" period we need the smallest positive value of $2k\pi$ so that $\sin^2(x+2k\pi) = \sin^2 x$ and as $k=1$ works that's the smallest.
Not $k=0$ and $p =0$ is not an acceptable value for a period.  Claiming a function "has period $0$" would be to so "$f(x) = f(x+0)$ for all $x$" and that's....  well, that's just pointless.
