<s>[INST] Find $p$ and $q$ such that the maximum and minimum values of $5 +6\cos\theta + 2 \cos2\theta$ satisfy $x^2-p x+q=2$ 
If the maximum and minimum values of $5 +6\cos\theta + 2 \cos2\theta$ satisfy $x^2-px + q = 2$, then what are $p$ and $q$?

My thinking that, maximum valus  of $\cos\theta$ is $1$ and minimum is $-1$. Now I can claim that the maximum of $5+6\cos\theta + 2 \cos2\theta)$ is $13$ and the minimum value is $9$
So $p = 13$ and $q=9$.
Is it correct or not?
Any hints/solution?
Thank u 
 [/INST] The minimum value is wrong. Let $f(t)=5+6t+2(2t^{2}-1)$. [Recall that $\cos (2x)=2\cos^{2}x-1$]. Therefore, $f'(t)=6+8t=0$ when $t=-3/4$ which is a possible value for $\cos x$. So the minimum value is $5+6(-3/4)+2(9/8-1)=3/4$. The quadratic with leading coefficient $1$ and roots $3/4$ and $13$ is given by $(x-\frac 3 4 ) (x-13)=0$. Comparing coefficienrs we get $p=\frac {55} 4$ adn $q=\frac {47} 4$
</s>