General solution to problems when you integrate with a limit being a new variable and then differeinate with respect to that variable.

I will give some examples:

$$\frac{\mathrm{d}}{\mathrm{d}x} \int_3^x \ln\left(t^2+C\right)\, \mathrm{d}t$$

$$\frac{\mathrm{d}}{\mathrm{d}x} \int_3^x \sin\left(\cos\left(t^2\right)\right)\, \mathrm{d}t$$

Both of these is just replace the $x$ in the integrated function. I was told to just follow this pattern for the exam; however, wasn't given a good reason why it works.

-

Well, let's go over this example: $$\frac{d}{dx}\int_1^{3x^2}cos(t)dt$$where $f(x)=cos(t)$. Essentially what happens is you follow the Second Fundamental Theorem of Calculus, not the First, i.e. $$\frac{d}{dx}F(3x^3)-F(1)$$ From here, it's simple the chain rule $$9x^2cos(3x^3)$$ This can be generalized to $$\frac{d}{dx}\int_{g(x)}^{f(x)}c(t)dt=f'(x)C(f(x))-g'(x)C(g(x))$$ Hope this helps.
The fundamental theorem of calculus says that if $f:[a,b] \to \mathbb{R}$ is a continuous function and if we define the function $F(x) = \int_a^x f(t) dt$, then $F$ is differentiable on $(a,b)$ and $F'(x) = f(x)$.