Solving $x - 2 = \cos(\pi x)$ I am trying to find the intersect of two lines.
$$\begin{align}
y&=\cos(\pi x)\\
y&=x-2
\end{align}$$
By looking at these two expressions, I can tell that $(1,-1)$ is an intersection point. However, I want to be able to solve this problem by equating both expressions.
I did...
$$x-2=\cos(\pi x)$$
but I do not know what to do with the $\cos(\pi x)$. How do I solve this?
 A: There is no analytical solutions for this kind of transcendental equations (this is already the case for $x=\cos(x)$ and you need to consider numerical methods for solving it.
In the real domain, beside the trivial $x=1$, there is another root; graphing the function $$f(x)=x-2-\cos (\pi  x)$$ you probably noticed that the other root is close to $x_0=2.5$. 
So, starting at this point, use Newton method the iterates of which being 
$$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}=x_n+\frac{2-x_n+\cos (\pi  x_n)}{\pi  \sin (\pi  x_n)+1}$$ giving
$$\left(
\begin{array}{cc}
 n & x_n \\
 0 & 2.500000000 \\
 1 & 2.379273496 \\
 2 & 2.376969505 \\
 3 & 2.376967009
\end{array}
\right)$$ which is the solution for ten significant figures.
If you let $x=y+2$, the equation becomes $$g(y)=y-\cos(\pi y)$$ and using Taylor series $$g(y)=-1+y+\frac{\pi ^2 }{2}y^2+O\left(y^3\right)$$ Ignoring the higher order terms, this would give $$y=\frac{\sqrt{4+8 \pi ^2}-2}{2 \pi ^2}\approx 0.361 \implies x\approx 2.361$$ which is not too bad for an approximation.
Sooner or later, you will learn that we can, better than with Taylor expansions, approximate functions using Padé approximants. For $g(y)$, a simple one would be
$$g(y)=\frac{-1+\frac{7 }{6}y+\left(\frac{5 \pi ^2}{12}-\frac{1}{6}\right) y^2 }{1-\frac{1}{6}y+\frac{\pi ^2 }{12}y^2 }$$ Solving the quadratic corresponding to the numerator would give 
$$y=\frac{\sqrt{100+240 \pi ^2}-14}{10 \pi ^2-4}\approx 0.376849 \implies x\approx 2.376849$$ which is obviously much better.
Simpler, but less accurate, would be a Taylor expansion around $y=\frac 19$ giving
$$g(y)=-\frac{1}{6}+\left(1+\frac{\sqrt{3} \pi }{2}\right)
   \left(y-\frac{1}{3}\right)+O\left(\left(y-\frac{1}{3}\right)^2\right)$$ and ignoring the high order terms $$y=\frac{3+\sqrt{3} \pi }{3 \left(2+\sqrt{3} \pi \right)}\approx 0.378128\implies x\approx 2.378128$$
A: As said by Claude, there is no analytical solution to this equation and you need to resort to numerical methods.
The first step is to number and isolate the roots.
The derivative of $x-2-\cos\pi x$ is $1+\pi\sin\pi x$, which vanishes for
$$x=-\frac1\pi\arcsin\frac1\pi+2k,\\x=\frac1\pi\arcsin\frac1\pi+2k+1.$$
This plot shows the alternation of the local extrema and shows that there are exactly three crossings of the axis. (The first positive maximum has ordinate $0.051101966$.)


The root close to $1$ can also be approximated by shifting the variable and writing $y=x-1$,
$$0=f(y)=y-1-\cos(\pi(y+1))=y-1+\cos\pi y\approx y-1+1-\frac{\pi^2y^2}2=y\left(1-\frac{\pi^2y}2\right)$$
which gives $x\approx1.202642$.
