What is the maximum vertical distance between the line y = x + 42 and the parabola y = x^2 for −6 ≤ x ≤ 7? What is the maximum vertical distance between the line 
$y = x + 42$ and the parabola $y = x^2$ for $−6 \le x \le 7$?
I have the answer at the back of my book but I am not sure how they got that. The book mentions somthing about derivatives. 
 A: Hint: $$x+42-x^2=-\left(x-\frac12\right)^2+\frac{169}4$$
has a maximum at $(\frac12,\frac{169}4)$ in the interval $[-6,7]$.
A: Let $f(x)=x+42$ and $g(x)=x^2$. Noting that, on $[-6,7]$, we have $g(x)\leq f(x)$, what you're asking for is the maximum value of the non-negative function $h(x)=f(x)-g(x)$.
Does that give you a push in the right direction?
A: If you want to solve it with derivatives, you first have to think about how $x^2$ behaves. You see, the slope (which is the derivative of the function) of $f(x)=x+42$ is $1$. The slope of $g(x)=x^2$ is not constant, but you can calculate it for a given point by calculating its derivative $g'(x)=2x$ and plugging the $x$-coordinate of the point in.
The derivative of $g(x)$, $g'(x)=2x$ is inferior to that of $f(x)$, $f'(x)=1$ until a certain x-coordinate, and this coordinate gives us the maximal vertical distance between the two functions.
Establish the equality:$$f'(x)=g'(x)\Rightarrow 1=2x\Rightarrow x=\frac{1}{2}$$
Plug the x value in both of the functions to find the maximal distance. $$f\left(\frac{1}{2}\right)-g\left(\frac{1}{2}\right)=\frac{170}{4}-\frac{1}{4}=\frac{169}{4}$$
