Why are my two proofs contradicting?

I am checking the commutativity of integration and differentiation of single variable function $A$ with dependent variables $(x,s)$ using two methods. In first method, they are proven to be unequal. In the second, they are proven to be equal. It means I am definitely wrong somewhere in the proof(s). Please point out where am I wrong?

Method 1:

Let $A$ be a function of $s$. Also let $s=f(x)$ \begin{align} LHS=\dfrac{d}{dx}\int_{f(a)}^{f(b)}A \text{ }ds =\dfrac{d}{dx}\int_{a}^{b}A \text{ }\dfrac{ds}{dx}dx =\left[ A \text{ }\dfrac{ds}{dx} \right]_a^b \end{align}

\begin{align} RHS=\int_{f(a)}^{f(b)}\dfrac{dA}{dx} \text{ }ds =\int_{a}^{b}\dfrac{dA}{dx} \dfrac{ds}{dx}\text{ }dx =\left[ A \text{ }\dfrac{ds}{dx} \right]_a^b-\int_a^b \dfrac{d^2s}{dx^2}A\text{ }dx\neq LHS \end{align}

The third expression of RHS is obtained by applying integration by parts.

I came across the following commutativity proof of independent variables $(x\text{ and }y )$ in the internet:

\begin{align} & \dfrac{d}{dx}\int_{a}^{b}A(x,y) \text{ }dy\\ = &\lim_{\Delta x \rightarrow0} \dfrac{\int_a^bA(x+\Delta x,y)dy -\int_a^bA(x,y)dy}{\Delta x}\\ = &\lim_{\Delta x \rightarrow0} \dfrac{\int_a^b \left[ A(x+\Delta x,y)-A(x,y) \right]dy}{\Delta x}\\ = & \int_a^b\dfrac{dA(x,y)}{dx}dy \end{align}

Method 2:

Applying the same technique to dependent variables:

\begin{align} & \dfrac{d}{dx}\int_{a}^{b}A(x,s) \text{ }ds\\ = &\lim_{\Delta x \rightarrow0} \dfrac{\int_a^bA(x+\Delta x,s+\Delta s)ds -\int_a^bA(x,s)ds}{\Delta x}\\ = &\lim_{\Delta x \rightarrow0} \dfrac{\int_a^b \left[ A(x+\Delta x,s+\Delta s)-A(x,s) \right]ds}{\Delta x}\\ = & \int_a^b\dfrac{dA(x,y)}{dx}ds \end{align}

• Why $\dfrac{d}{dx}\int_{a}^{b}A \text{ }\dfrac{ds}{dx}dx=\left[ A \text{ }\dfrac{ds}{dx} \right]_a^b$? For example, if $s=x$, then it is obviously wrong. – velut luna Dec 28 '17 at 8:11
• $$\dfrac{d}{dx}\int_{a}^{b}A \text{ }\dfrac{ds}{dx}dx =\int_{a}^{b}\dfrac{d}{dx} \left[ A \text{ }\dfrac{ds}{dx} \right] dx =\left[ A \text{ }\dfrac{ds}{dx} \right]_a^b$$ – lorilori Dec 28 '17 at 8:16
• When $s=x$ LHS and RHS would be $$\left[ A \right]_a^b$$ – lorilori Dec 28 '17 at 8:19
• Thanks that is first mistake. – lorilori Dec 28 '17 at 8:23
• If $A=s^2$ and $s=x$, you have $\frac{d}{dx}\int_a^b A\frac{ds}{dx}dx =0 \ne[x^2]_a^b$ – velut luna Dec 28 '17 at 8:23