Differentiating both sides of an equation with different variables

I'm currently doing an assignment for my Ordinary Differential Equations class and I seem to have forgotten a concept from Calculus.

Part of the question that I'm stuck with makes me solve: $$\int \frac{x}{\sqrt{x^2-16}}\,dx$$

As I said before, I'm rusty on certain principles from Calculus. The help I've received says to start solving this integral by making the substitution: $t^2=x^2-16$ then differentiating both sides to get: $$2t\,dt=2x\,dx$$

With that advice I am able to solve the rest of the differential equation. Can someone explain to me why we can differentiate both sides of the equation with respect to different variables? in this situation I would have solved for $t$ to get $t=\sqrt{x^2-16}$ then use $u$ substitution and the chain rule to differentiate the equation and ultimately get: $$\frac{dt}{dx}=x(x^2-16)^\frac{-1}{2}$$

Once again, I don't understand the advice I was given and how we can differentiate an equation on both sides but with respect to different equations. Why can we take the equation $$t^2=x^2-16$$ and differential the left hand side with respect to $t$ and the right hand side with respect to $x$ and get the equation:$$2t\,dt=2x\,dx$$

Any knowledge would be greatly appreciated. Please let me know if my question does not make sense.

To better understand it, this is just implicit differentiation. Since $y$ is a function of $x$, when differentiating it with respect to $x$, one needs to treat it as a function and multiply it by $\frac{dy}{dx}$. This is because, $\frac{df(y)}{dx}=\frac{df(y)}{dy} \frac{dy}{dx}$.
$$f(y)=f(x)$$ Differentiating with respect to $x$ $$f'(y)\frac{dy}{dx}=f'(x)$$ Which can be rewritten as $$f'(y)dy=f'(x)dx$$
The same applies for differentiating with respect to $y$. The important thing is to treat $y$ as a function.
$$\int \frac{x}{\sqrt{x^2-16}}\,dx$$ $$=\frac12 \int \frac{d\, x^2}{\sqrt{x^2-16}} =\frac12 \int \frac{d(t^2+16)}{ t}$$ $$= t+c = {\sqrt{x^2-16}}+ c.$$