Derivative of y=sec(tanx)?

I don't get how it is secxsecx*secxtanx*tanxtanx. Where does an extra tanx come from? Derivative of sec(tanx) is just secxtanx*tanx (and then multiply the inside as well so)* sec^2(X) as derivative of tanx. I have 2 tanx, where did the third one come from?!

the derivative of sec(u) is sec(u) tan(u)

But, if u is a function of x, then we have to apply the chain rule. Since u=tanx, then du/dx = sec^2(x)

So, the final damage is

sec(tanx) tan(tanx) sec^2(x)

To find the derivative of y = sec(tanx), we can use the chain rule. The chain rule states that if we have a composite function, such as f(g(x)), its derivative is given by the product of the derivative of the outer function with the derivative of the inner function.

In this case, let's define u = tanx. Therefore, y = sec(u). To find dy/dx, we'll start by finding du/dx (the derivative of the inner function). Then we'll find dy/du (the derivative of the outer function) and multiply these two derivatives together to get dy/dx.

Derivative of u = tanx:
Using the chain rule, we have du/dx = d(tanx)/dx = sec^2(x).
This is because the derivative of tanx with respect to x is sec^2(x).

Derivative of y = sec(u):
To find dy/du, we need to find the derivative of sec(u) with respect to u. Recall that the derivative of sec(u) is equal to sec(u)tan(u).
So, dy/du = sec(u)tan(u).

Now, let's multiply these derivatives together to get dy/dx:
dy/dx = (dy/du) * (du/dx)
= (sec(u)tan(u)) * (sec^2(x))
= sec(u)sec^2(x)tan(u)

Finally, replacing u with tanx, we get:
dy/dx = sec(tanx)sec^2(x)tan(tanx)

Therefore, the derivative of y = sec(tanx) is indeed sec(tanx)sec^2(x)tan(tanx) as you correctly mentioned. The extra tanx comes from differentiating both the inner and outer functions in the chain rule.