I’m in AP Calculus AB and can’t figure this out. Can you help me solve this?

We need to derivate the next given function:
[tex]f(x)=2x-x^2\tan x[/tex]First, we have a subtraction, which means that we can derivate both expressions separately:
[tex]\frac{d}{dx}f(x)=\frac{d}{dx}(2x)-\frac{d}{dx}(x^2\tan x)[/tex]For 2x:
[tex]\frac{d}{dx}(2x)=2[/tex]for x²tanx, the expression represents a multiplication. Therefore, we use the next rule:
[tex]\frac{d}{dx}(f\cdot g)=\frac{d}{dx}f\cdot g+f\cdot\frac{d}{dx}g[/tex]Then:
[tex]\frac{d}{dx}(x^2\tan x)=2x\tan x+x^2\sec ^2(x)[/tex]The whole derivate would be:
[tex]\frac{d}{dx}f(x)=2-(2x\tan x+x^2\sec ^2(x))[/tex]Simplify the signs for the expression:
[tex]\frac{d}{dx}f(x)=2-2x\tan x-x^2\sec ^2(x)[/tex]