For the angle between two lines, you need to assume its in first quadrant (or third quadrant), otherwise you won't get rid of the absolute values. Second and fourth quadrants definitely require a - in front because sinthetacostheta is negative, whilst tan phi is always positive (since phi is acute). So the question was poorly written.