I’m in AP Calc AB. Could you help me with this?

We have to find the derivative of:
[tex]f(x)=2x-x^2\tan x[/tex]We can separate and derive the terms independently, but for the second term we have to apply the product rule:
[tex]\frac{d(f\cdot g)}{dx}=\frac{df}{dx}\cdot g(x)+f(x)\cdot\frac{dg}{dx}[/tex]Then, we can derive f(x) as:
[tex]\begin{gathered} \frac{df}{dx}=\frac{d(2x)}{dx}-(\frac{d(x^2)}{dx}\cdot\tan (x)+x^2\cdot\frac{d(\tan x)}{dx}) \\ \frac{df}{dx}=2-(2x\cdot\tan (x)+x^2\cdot\sec ^2(x)) \\ \frac{df}{dx}=-x^2\cdot\sec ^2(x)-2x\cdot\tan (x)+2 \end{gathered}[/tex]Answer: the derivative of f(x) is df/dx = -x²*sec²(x) - 2x*tan(x) + 2