Suppose we have two functions that meet at one point, does this mean that their derivatives would also meet at one point? The title is wrong, I'm aware of that, however, i just encountered one question that says it's correct. I must be missing something, please help me find it. Thank you all for your help.
Given two functions $h(x) = p-\cos(x)$ and $k(x) = \sin^2(x)$ in the interval $[0,\pi]$ determine the set of $p$ so that the graphs of the two functions meet within the given interval.
My thoughts: usually the way to find the answer to such problems is simply to set the two equations equal to each other, however in this case, there is the variable p so we can't do that. but after seeing how the graphs look, I thought to take the derivative of the two functions and set them equal to each other which also turns out to be correct. However, I don't know why it is correct since we can't do this in all cases.
My intuition tells me its a very simple thing that I am somehow ignoring, but I just don't know what it is, so again thank you for your help
 A: Choose any number $\theta$ in the interval $(0,\pi)$ and let $p_\theta=\sin^2(\theta)+\cos(\theta)$. Then $(\theta,\sin^2(\theta))$ is a point of intersection of the graphs of $p_\theta-\cos(x)$ and $\sin^2(x)$. So this shows that there are many parameters $p$ so that $p-\cos(x)$ and $\sin^2(x)$ have a point of intersection in the interval $(0,\pi)$. Indeed, I can find a parameter for any choice of $\theta$ in $(0,\pi)$.
What you did was narrow in on $\theta=\pi/3$ by setting the derivatives equal to each other. You then computed $p_{\pi/3}=\sin^2(\pi/3)+\cos(\pi/3)=\frac{3}{4}+\frac{1}{2}=\frac{5}{4}$. So in this case, I would say that using derivatives was a red herring.
Now, you could say that for $\theta=\pi/3$, you get an intersection point for both the original functions and their derivatives.  This is only choice of $\theta$ where this happens unless you allow the endpoints $0$ or $\pi$ as the $x$-value. If you allowed these values you would get $(0,0)$ or $(\pi,0)$ as an intersection point for both $\pm 1-\cos x$ and $\sin^2(x)$, as well as their derivatives. These solutions show up in your calculations at the point where you simplified $2\sin x\cos x= \sin x$ to $\cos x=\frac{1}{2}$ since you have to account for $\sin x = 0$.
A: The following figure could have been drawn by hand. It shows the curves $y=h_p(x):=p-\cos x$ and $y=k(x):=\sin^2 x$ for the maximal and the minimal values of $p$ that give $\geq1$ points of intersection in the interval $0\leq x\leq\pi$. These special values  $p_\max$ and $p_\min$ lead to special "graphical" conditions that determine their values. In the case of $p_\max$ we indeed have equalities $$h_p(x)=k(x)\qquad\wedge\qquad h_p'(x)=k'(x)$$
for a certain (unknown) $x$, whereas in the case of $p_\min$ we see that the incidence point is at $x=\pi$.

