<s>[INST] Show $\frac{d}{dx} \tan^3{x}-3 \tan{x}+3x = 3 \tan^4{x}$ How do I go about doing this?

Show $\frac{d}{dx} \tan^3{x}-3 \tan{x}+3x = 3 \tan^4{x}$.

My work.
$$
\begin{align*}
\frac{d}{dx} \tan^3 x -3 \tan x+3x 
&= 3 \tan^2 x \sec^2 x - 3 \sec^2 x + 3
\\ &= 3 \frac{\sin^2 x}{\cos^2 x} \frac{1}{\cos^2 x} - 3 \frac{1}{\cos^2 x} + 3
\\ &= 3 \frac{\sin^2 x}{\cos^4 x} - 3 \frac{1}{\cos^2 x} + 3
\\ &= \frac{3\sin^2 x - 3\cos^2 x + 3\cos^4 x}{\cos^4 x} 
\\ &= \frac{3(\sin^2 x - \cos^2 x + \cos^4 x)}{\cos^4 x}. 
\end{align*}
$$
I got here so far, did I make a mistake or something?
 [/INST] One of the outcomes of the Mean Value Theorem is that if two functions have the same derivative, then the differ by a constant.  Or, in mathy speak, if $f'(x)=g'(x)$ then there is a number $C$ so that $f(x)=g(x)+C$.  If you take a derivative of $f(x)=3\tan^2(x)\sec^2(x)-3\sec^2(x)+3$, you will get
$$
f'(x)=6(\tan(x)\sec^4(x)+\tan^3(x)\sec^2(x)-\sec^2(x)\tan(x).
$$
Getting common denominators and using $\cos^2(x)+\sin^2(x)=1$ this becomes
$$
\frac{12\sin^3(x)}{\cos^5(x)}=12\tan^3(x)\sec^2(x).
$$
But, the right hand side is the derivative of $3\tan^4(x)$.  So, there is some $C$ that makes $f(x)=3\tan^4(x)+C$.  Just plug in $x=0$ to see that $C=0$.
</s>