The threshold degree of a Boolean function $f\!\!\,: \{0,1\}^n \rightarrow \{-1, +1\}$ is the least degree of a real polynomial $p$ such that $f(x)\equiv{{\rm sgn}\,p(x)}.$ We construct two halfspaces on $\{0,1\}^n$ whose intersection has threshold degree $\Theta(\sqrt n),$ an exponential improvement on previous lower bounds. This solves an open problem due to Klivans [A Complexity-Theoretic Approach to Learning, Ph.D. thesis, MIT, Cambridge, MA, 2002] and rules out the use of perceptron-based techniques for PAC learning the intersection of two halfspaces, a central unresolved challenge in computational learning. We also prove that the intersection of two majority functions has threshold degree $\Omega({\rm log}\,n),$ which is tight and settles a conjecture of O'Donnell and Servedio [Proceedings of the $35$th Annual ACM Symposium on Theory of Computing (STOC), 2003, pp. 325--334]. Our proof consists of two parts. First, we show that for any nonconstant Boolean functions $f$ and $g,$ the intersection $f(x)\wedge g(y)$ has threshold degree $O(d)$ if and only if $\|f-F\|_\infty + \|g-G\|_\infty < 1$ for some rational functions $F,$ $G$ of degree $O(d).$ Second, we determine the least degree required for approximating a halfspace and a majority function to any given accuracy by rational functions. Our technique further allows us to obtain direct sum theorems for polynomial representations of composed Boolean functions. In particular, we give an improved lower bound on the approximate degree of the AND-OR tree.