I have to find the solution of the equation $x=\cos(x)$, $x$ is real. I solved it graphically but is there any other way to solve this except numerical approximation?
I have seen the Dottie number question asked on this page but I am curious about other equations like $x=\sin(x)$. [I know the solution is $x=0$], $x=\sec(x)$ etc., and also when a function $x-f(x)$ has a zero?
Hmm. If we traverse into complex numbers, we could try something like this: \begin{align*} \cos(x)&=x \\ \text{Re}[e^{ix}]&=x \quad \text{Expand into complexes temporarily:}\\ e^{ix}&=x\\ x \,e^{-ix}&=1 \\ -ix \, e^{-ix}&=-i \\ -ix&=W(-i) \\ x&=i \,W(-i)\quad \text{Getting back to the reals:} \\ x&=\text{Re}\left[i\,W(-i)\right]. \end{align*} Here $W$ is the Lambert $W$ function. However, this approach simply doesn't work. The numerical value of the final result is approximately 0.576, whereas the actual Dottie number is closer to 0.739. I suspect the problem is where we assume we can just go to the complexes, and then come back out of them without any penalty. Indeed, some numerical experiments in the Wolfram Dev Platform indicate that this is so. Expanding into the complexes, where we remove taking the real part, gets us into the wrong answer.
In summary, I would go with @Felix Marin's comment, and use bisection.