Use the chain rule:
y = tan(x ² - 5x + 6)
y' = sec²(x ² - 5x + 6) × (x ² - 5x + 6)'
y' = (2x - 5) sec²(x ² - 5x + 6)
Perhaps more explicitly: let u(x) = x ² - 5x + 6, so that
y(x) = tan(x ² - 5x + 6) → y(u(x)) = tan(u(x) )
By the chain rule,
y'(x) = y'(u(x)) × u'(x)
and we have
y(u) = tan(u) → y'(u) = sec²(u)
u(x) = x ² - 5x + 6 → u'(x) = 2x - 5
Then
y'(x) = (2x - 5) sec²(u)
or
y'(x) = (2x - 5) sec²(x ² - 5x + 6)
as we found earlier.