<s>[INST] Differentiation using Chain Rule Find $\frac{dy}{dx}$ if $y=7+5^{x^2+2x-1}$.
So far I have done $\frac{dy}{dx}=(5^{x^2+2x-1})'$. Now, the RHS can be found by $(e^{\ln 5\cdot (x^2+2x-1)})'=e^{\ln 5\cdot (x^2+2x-1)}(x^2+2x-1)'\ln 5=5^{x^2+2x-1}(2x+2)\ln 5$.
However, my textbook says the answer is $(2x^3+6x^2+2x-2)(5^{x^2+2x-1})$. Where did I go wrong? Thanks.
 [/INST] First note that
$$\frac{d}{dx}a^{f(x)}=a^{f(x)}(\ln a)\frac{d}{dx}f(x)$$
So now we have
$$\frac{d}{dx}\left[7+5^{x^2+2x-1}\right]$$
$$=\frac{d}{dx}[7]+\frac{d}{dx}\left[5^{x^2+2x-1}\right]$$
$$=0+5^{x^2+2x-1}(\ln 5)\frac{d}{dx}\left[x^2+2x-1\right]$$
$$=5^{x^2+2x-1}(\ln 5)\left(2x+2\right)$$
$$=2\cdot 5^{x^2+2x-1}(x+1)\ln 5$$
</s>