# Derivative of $\tan(xy^3)$

Can somebody tell me if I'm right on this? The math looks right, yet it just feels so wrong due to the obscene steps I had to take to get it.

I hope I transcribed all that correctly from my paper.

1. $y=\tan(xy^3)$
2. $y'=\sec^2(xy^3)(y^3+3xy^2y')$
3. $\frac{y'}{\sec^2(xy^3)}=y^3+3xy^2y'$
4. $\frac{y'}{\sec^2(xy^3)}-3xy^2y'=y^3$
5. $y'(\cos^2(xy^3)-3xy^2)=y^3$
6. $y'=\frac{y^3}{\cos^2(xy^3)}$

Edited to substitute $\frac{1}{\sec^2(xy^3)}$ for $\cos^2(xy^3)$

-

Looks good, but I'd rewrite it after step $5$ using $$\frac1{\sec^2(xy^3)}=\cos^2(xy^3).$$
In response to OP's edit: Now you've goofed going from $5$ to $6$. Take another look.