Order of Integrating a partial derivative I have some questions about the process involved when integrating higher order partial derivatives. I was going through a textbook on engineering mathematics on PDEs. 
If $~\dfrac{\partial^2 u}{\partial x \partial y} = \sin(x+y)~$, it states that $~\dfrac{\partial u}{\partial x} = -\cos(x+y) + \phi(x)~$.
My understanding was that  $~\dfrac{\partial^2 u}{\partial x \partial y}= \dfrac{\partial }{\partial x}\left(\dfrac{\partial u}{\partial y}\right) = \sin(x+y)~$.
My question is this: Can you really integrate $~\dfrac{\partial }{\partial x}\left(\dfrac{\partial u}{\partial y}\right)$ with respect to $~y~$? I thought this had to be at least integrated first wrt $~x~$ and then wrt $~y~$. In essence, since the derivative was first wrt $~y~$ and then wrt $~x~$, shouldn't the integral be first wrt $~x~$ and then wrt $~y~$?
I hope this makes sense.
Thanks

Edit: Here's the full question-Solve the equation $~\dfrac{\partial^2 u}{\partial x \partial y} = \sin(x+y)~$, given that at $~y = 0~$, $~\dfrac{\partial u}{\partial x} = 1~$ and at $~x = 0~$, $~u = (y-1)^2 ~$. Judging by the initial conditions, one way we can solve this equation is by first integrating wrt $~y~$ in order to obtain an equation in $~\dfrac{\partial u}{\partial x}~$ and hence making use of the initial condition.
 A: In this case, the function $\sin(x + y)$ is infinitely differentiable with respect to both partial derivatives. Therefore, by Clairaut's theorem, the order of partial derivatives isn't pertinent. Therefore, we may rewrite $\frac{\partial^2u}{\partial x\partial y} = \frac{\partial}{\partial x}\frac{\partial u}{\partial y} = \frac{\partial}{\partial y}\frac{\partial u}{\partial x} = \sin(x + y)$. From this, we can see that integrating this with respect to $y$ is legal, and we can apply the fundamental theorem of calculus to simplify the integration.
A: $$\dfrac{\partial^2 u}{\partial x \partial y} = \sin(x+y)$$
Since $\quad\dfrac{\partial^2 u}{\partial x \partial y}=\dfrac{\partial^2 u}{\partial y \partial x}\quad$ it doesn't matter if you first integrate with respect to $x$ or if you first integrate with respect to $y$.
For example let $\quad v=\dfrac{\partial u}{\partial x}.\quad$ The eqution becomes :
$$\dfrac{\partial v}{ \partial y}= \sin(x+y)$$
$$v=-\cos(x+y)+\text{constant with respect to } y$$
Any function of $x$ but not of $y$ is constant with respect to $y$. Thus
$$v=-\cos(x+y) + \phi(x)$$
$$\dfrac{\partial u}{\partial x} = -\cos(x+y) + \phi(x)$$
Then we integrate with respect to $x$
$$u=-\sin(x+y)+\int\phi(x)dx+\text{constant with respect to } x$$
Any function of $y$ but not of $x$ is constant with respect to $x$. Thus
$$u=-\sin(x+y) +\int\phi(x)dx+ F(y)$$
$$u=-\sin(x+y) +\Phi(x)+ F(y)$$
$\Phi$ and $F$ are arbitrary functions.
In the above example of calculus we first integrate with respect to $y$. Instead of, try to first integrate with respect to $x$ . You will see that the final result will be the same.
