This problem can be solved very easily with calculus. At the maximum value of θ , the derivative of the
expression will be zero.
This derivative is 12 cos(θ) - 18 sin(θ) cos(θ) setting this to zero results in
12 - 18 sin(θ) =0 (after dividing through by cos(θ) ) So
sin(θ) = 2/3 substituting back into the expression yields the value 4.
This can be checked using a graphing calculator.