The problem I am attempting to solve is:
\begin{align} y=x^{5x+7} \\ \text{Find $\frac{dy}{dx}$} \end{align}
Here is my working so far:
$$\begin{align} \text{let }u &= 5x+7 \\ \frac{dy}{dx}&=\frac{dy}{du} \cdot \frac{du}{dx} \\ \frac{dy}{du}&=ux^{u-1}=(5x+7)x^{5x+6} \\ \frac{du}{dx}&=5 \\ \therefore \frac{dy}{dx}&=(25x+35)x^{5x+6} \end{align}$$
(Additionally, I'm having trouble using the align environment in Mathjax. This question wasn't formatted very well. If someone could give me some help in the comments, then I would be very thankful.)
If $u= 5x+7$ and $y = x^{5x+7} = x^u$ then if you attempt to solve $\frac {dy}{dx}=\frac{dy}{du}\frac {du}{dx}$ then you must solve $\frac {dy}{du} = \frac {dx^u}{du}$ but $x$ is dependent on $u$ so you'd have to solve $\frac {dx^u}{du} = \frac {dx^u}{dx}\frac {dx}{du}$ but to solve $\frac {dx}{du}$ we have $x$ is dependant on $u$ and .... and we'd have an infinite loop.
(By the way, if we treat $x$ as constant we'd have $\frac {dx^u}{du}=\ln(x)x^u$; not $\frac {dx^u}{dx} = ux^{u-1}$ which is what we'd have if we treated $u$ as a constant and differentiating in respect to $x$.)
To do the properly we need to express $y =x^{5x+7}$ entirely in terms of $u$
So if $u = 5x +7$ then $x = \frac {u-7}5$ and so $y =x^{5x+7} = x^u = (\frac {u-1}5)^u$ which ..... just doesn't help.
Better we do: let $y = x^{5x + 7} = e^{\ln x(5x+7)}$ the let $u = \ln x(5x+7)$ so $y=e^u$ and we can do
$\frac {dy}{dx} = \frac {dy}{du}\frac {du}{dx}$.
$\frac {dy}{du}=\frac{de^u}{d^u} = e^u= y$ was easy enough. And we can use the product rule to figure $\frac {du}{dx}$.
Let $w= \ln x$ and $v = 5x+7$ then $\frac {du}{dx} =\frac {dv\cdot w}{dx} = \frac{dv}{dx} w + \frac {dw}{dx}v$.
And $\frac {dv}{dx} = \frac {d(5x+7)}{dx}= 5$ and $\frac {dw}{dx}= \frac {d\ln x}{dx} = \frac 1x$ so
$\frac {du}{dx} = (5\ln x + \frac 1x(5x + 7))=(5\ln x + 5 +\frac 7x)$ and do
$\frac {dy}{dx}=\frac {dy}{du}\frac {du}{dx} = \frac {dy}{du}(\frac {dv}{dx}w + \frac {dw}{dx}v) = e^u(5\ln x + 5 +\frac 7x)= e^{5x+7}(5\ln x + 5 + \frac 7x)$.