Question: Suppose that there is a biased coin and we flip the coin until 2 of the most recent 3 flips are heads. Let $p$ be the probability that it is heads. Also, let $X$ be the random variable which represents the total flips. If the first 2 flips are heads, then $X=2$. How can we find the expected value of $X$?

Answer: 
You can simply use that $x^3$ and $x^2$ are both strictly increasing for positive $x$. (What does this tell you about $f(x)$?)
If you want to follow the route of Rolle's Theorem (or Mean Value Theorem), suppose you had two roots $a,b\in [0,1]$. Put those into your equation. Can there be a $c\in (0,1)$ for which that holds?