We want to find R and θ such that
R cos(x + θ) = R (cos(x) cos(θ) - sin(x) sin(θ)) = 6 cos(x) + 2 sin(x)
which means
R cos(θ) = 6
-R sin(θ) = 2
Observe that
(R cos(θ))² + (-R sin(θ))² = 6² + 2² ==> R ² = 40 ==> R = 2√10
and
-R sin(θ) / (R cos(θ)) = 2/6 ==> tan(θ) = -1/3 ==> θ = arctan(-1/3) = -arctan(1/3)
So we have
6 cos(x) + 2 sin(x) = R cos(x + θ) = 2√10 cos(x - arctan(1/3))