<s>[INST] solve equation with cos and powers 
Solve the following equation.
$$3^{x^2-6x+11}=8+\cos^2\frac{\pi x}{3}.$$

Here is the problem that I am struggling with it
I tried to take a logarithm of both side but I kinda stuck
can someone help me with this?
Thanks
 [/INST] Add 1 to each side of the equation to get
$$3^{x^2-6x+11} + 1 = 9 + \cos^2 \frac {\pi x} {3}$$
Take $\log_3$ of both sides to get
$$x^2-6x+11 = 2 + \log_3 \cos^2 \frac {\pi x} {3}$$
The maximum of $\cos^2 \frac {\pi x} {3} = 1$, thus $\log_3 1 = 0$ , so we have
$$x^2 - 6x + 11 = 2$$
Bringing the 2 to the right hand side we have
$$x^2 - 6x + 9 = 0$$
Factoring gives us
$$(x-3)^2 = 0$$
And thus we have $$x = 3$$
Check: $3^{3^2-18+11} = 3^{9-18+11} = 3^2 = 9; \cos^2 \pi = 0; \Rightarrow 9 + 0 = 9 \ \ \checkmark$
</s>