**Toolbox:**

- When you have any function on the index then use log before differentiating.

Let $ y^{cosx} = u$

$ ( tan^{-1}x)^y=v$

$ log \: u = cos\: x\: \: log\: y$

Differentiate both sides to get

$\large \frac{1}{u}.\large\frac{du}{dx} = \large\frac{cosx}{y}.\large\frac{dy}{dx}-sinx\: log\: y$

$ \Rightarrow \large\frac{du}{dx}=y^{cosx} \bigg[ \large\frac{cosx}{y}.\large\frac{dy}{dx}-sinx\: log \: y \bigg] $

$ log \: v =y\: log (tan^{-1}x)$

$ \large\frac{1}{v} \large\frac{dv}{dx}=y\large\frac{1}{tan^{-1}x}$ x $\large \frac{1}{1+x^2}+log ( tan^{-1}x).\large\frac{dy}{dx}$

$ \Rightarrow \large\frac{dv}{dx}=(tan^{-1}x)^y \bigg[\large \frac{y}{(tan^{-1}x)(1+x^2)}+\large\frac{dy}{dx}log(tan^{-1}x) \bigg]$

Given u + v = 1

Differentiating $ \rightarrow \large\frac{du}{dx}=\large\frac{dv}{dx}=o$

Substitute $\large \frac{du}{dx}\: and \: \large\frac{dv}{dx}$ to get $\large \frac{dy}{dx}=\large\frac{y^{cosx}sinx\: logy-(tan^{-1}x)^y.\large\frac{y}{(1+x^2)tan^{-1}x}}{(tan^{-1}x)^ylog\: tan^{-1}x+y^{cosx}\large\frac{cosx}{y}}$