Derivative of $\left(\frac{\sqrt{8|x|}\sin^2 x}{\cos x}\right)^{\operatorname{erf}(x)}$

Your function is:

$$\left(\frac{\sqrt{8 \left| x\right| } \sin ^2(x)}{\cos (x)}\right)^{\text{erf}(x)}=2^{\frac{3 \text{erf}(x)}{2}} \left| x\right| ^{\frac{\text{erf}(x)}{2}} (\sin (x) \tan (x))^{\text{erf}(x)}$$

As Bernard Masse correctly pointed out, using a CAS is efficient here. I tried the following using Mathematica:

FullSimplify[D[(Sqrt[8 Abs[x]]*Sin[x]^2/Cos[x])^Erf[x], x]];

As a result I obtained:

$$\frac{1}{\sqrt{\pi }}e^{-x^2} 2^{\frac{3 \text{erf}(x)}{2}-1} \left| x\right| ^{\frac{\text{erf}(x)}{2}-1}\\ \cdot(\sin (x) \tan (x))^{\text{erf}(x)} \left(\sqrt{\pi } e^{x^2} \text{erf}(x)\\ \cdot\left(\text{Abs}'(x)+2 \left| x\right| (\tan (x)+2 \cot (x))\right)+2 \left| x\right| (\log (8 \left| x\right| )+2 \log (\sin (x) \tan (x)))\right)$$

The plot of your original function is, where the blue curve represents the real part and the orange one the imaginary part:

enter image description here

And your derivative looks as follows:

enter image description here


As I mentioned in my linked answer, to take derivatives of expressions of the form $y(x)=f(x)^{g(x)}$ we write $$\log y(x)=g(x)\log f(x)$$ Use the chain rule and the product rule, $$\frac{y'(x)}{y(x)}=g'(x)\log f(x)+\frac{f'(x)}{f(x)}g(x)$$ So $$y'(x)=f(x)^{g(x)}\left(g'(x)\log f(x)+\frac{f'(x)}{f(x)}g(x)\right)$$