Solution:
| $(-\infin, 3)$ | $[3, +\infin)$ |
| $x-3$ | - | + |
Case 1 $x\in(-\infin,3)$
$f(x)=2(-(x-3))+x^2=2(3-x)+x^2=x^2-2x+6$
$x\in[5, 7]$ but $[5, 7]\notin(-\infin,3)$ So we are not interested in this case.
Case 2 $x\in[3, +\infin)$
$f(x)=2(x-3)+x^2=x^2+2x-6$
$f'(x)=(x^2+2x-6)'=2x+2$
$f'(x)=0$
$2x+2=0$
$x=-1$
In the interval $[3, +\infin)$ the function is increasing.
Min: $f(5)=5^2+2\cdot5-6=29$
Max: $f(7)=7^2+2\cdot7-6=57$
Answer: $29$
