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?
 A: No mistakes. Keep going...
From where you left off:
$$\eqalign{
{3(\sin^2 x-\cos^2 x+\cos^4 x)\over\cos^4 x}
&={3\bigl(\sin^2 x+\cos^2 x(\cos^2 x-1)\bigr)\over\cos^4 x}\cr
&={3\bigl(\sin^2 x+\cos^2 x(-\sin^2 x)\bigr)\over\cos^4 x}\cr
&={3\bigl(\sin^2x ( 1-\cos^2 x) \bigr)\over\cos^4 x}\cr
&={3 \sin^2x (\sin^2 x)\over\cos^4 x}\cr
&={3 \sin^4x \over\cos^4 x}\cr
&=3\tan^4 x.
}
$$
A: Your approach is correct, but here's another way to get the same answer. Notice that both the derivative (i.e., $3 \tan^2 x \sec^2 x - 3 \sec^2 x + 3$) and the right hand side ($=3 \tan^4 x$) involve only $\tan^2x$ terms. This is an ideal situation to make use of the identity $$\color{blue}{(\ast)} \quad \sec^2 x - \tan^2 x = 1 .$$ 
Of course, this is just a variant of the usual Pythagoras theorem: $\sin^2 x + \cos^2 x = 1$.
Here's the complete sequence of steps: 
$$
\begin{align*}
3 \tan^2 x \sec^2 x - 3 \sec^2 x + 3
&= 3 \ \sec^2 x (\tan^2 x -1) + 3
\\ &\stackrel{\color{blue}{(\ast)}}{=} 3 (\tan^2 x + 1) (\tan^2 x -1) + 3
\\ &= 3 \Big((\tan^2 x)^2 - 1^2 \Big)  + 3
\\ &= 3 \tan^4 x - 3  + 3 
\\ &= 3 \tan^4 x .
\end{align*}
$$
A: 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$.
