I am trying to find Number of distinct roots of $$f(x)=x+5\cos x=0$$ in $\left[0, \pi \right]$
we have $f(0)=5 \gt 0$ and $f(\pi)=\pi-5 \lt 0$ so by IVT we have at least one root in $\left[0, \pi \right]$
Now IVT does not give information on number of roots, So I assumed let $p$ and $q$ are two distinct roots of $f(x)$ in $\left[0, \pi \right]$
Now $$f(p)=f(q)=0$$ Now applying Rolle's Theorem we get
$$f'(c)=0$$ that is
$$1-5 \sin c=0$$
so $$c =\arcsin(0.2)$$ which $\in$ $\left[0,\pi \right]$
hence My assumption that there are two roots $p$ and $q$ is correct. But Graph shows there is only one root in $\left[0,\pi \right]$
Where I went wrong?
You proved correctly that if thare are two roots $p,q\in[0,\pi]$, then one of them is smaller that $\arcsin\left(\frac15\right)$, whereas the other one is larger. The doesn't imply that those roots actually exist.
For instance, by the same argument, if the equation $x^2=-1$ has two real roots, then one of them is positive and the other one is negative. However, those roots do not exist.