Quadratic Formula, nature of roots with Trigonometric Functions
Wih a little bit of manipulation we can rewrite your given equation as $$x^2 - 2x + 4 = -3\cos{\left( ax + b \right)}$$
Let $f(x) = x^2 - 2x + 4$. Differentiating to find the minimum, we get
$$f'(x) = 2x - 2 = 0 \implies x = 1$$ $$f''(x) = 2 > 0 \implies \text{minimum at } x = 1$$
The minimum value of LHS is thus $f(1) = 3$.
The RHS is a cosine whose value oscillates in the range $[-3,3]$. The maximum value of the RHS is thus $3$. So we can see that equality holds if and only if the LHS is minimum and RHS is maximum. We just saw that the LHS, $f(x)$, is minimal only at $x = 1$. Now the value of $x$ is fixed, so the value of the RHS depends only on $a$ and $b$.
Hence, we have that
$$f(1) = 3 = -3\cos(a\times 1 + b) \implies \cos(a+b) = -1$$
I leave it to you to complete the problem from here :)
On a side note: No you can't take $\cos(ax + b)$ as a constant since $x$ is not a constant :)
$a + b = (2n+1)\pi$ but $0 \le a+b \le 6$. So $n = 0$ and $a + b = \pi$
Completing the square,
$$x^2-2x+1=(x-1)^2=-3(1+\cos(ax+b)).$$
The two expressions can only be equal if they are zero, i.e. $x=1$ and $\cos(ax+b)=-1$.
Hence,
$$a+b=\pi.$$
since the $3cos(ax+b)$ lies between $[-3,3]$
because $cos x$ has a max and min value as $1,-1$ (respectively) then $3cos x$ will have $3,-3$
i can write $$-3=<x^2-2x+4<=3$$
i am completing the square !
$$\implies -3=<(x-1)^2+3<=3$$
as you see that the term inside the square has a least value 0 and this equation is always greater than or equal to 3 then $(x-1)$ must be zero !! and $x=1$
and then substituting the value of x we get $cos(a+b)=-1$ $$\implies a+b=\arccos (-1)$$ $$a+b=\pi$$and that solved the problem!!