Show that \(3 \sin x \tan x - \cos x + 1 = 0\) can be written as a quadratic equation in \(\cos x\) and hence solve the equation \(3 \sin x \tan x - \cos x + 1 = 0\) for \(0 \leqslant x \leqslant \pi\).
Find the solutions to the equation \(3 \sin 2 x \tan 2 x - \cos 2 x + 1 = 0\) for \(0 \leqslant x \leqslant \pi\).