Is it okay to write integrating both sides with respect to $x$? $$\frac{dy}{dx} = \sin x  \tag1$$
Then we can do $$\int dy = \int (\sin x) dx  \tag2$$
Can you please tell me what should I write between step $(1)$ and $(2)$? Is it okay to write integrating both sides with respect to $x$?
Can anyone please help me?
 A: is this what you mean ? 
$$\frac{\mathrm{d}y}{\mathrm{d}x} = \sin x \\
\color {red}{\int} \frac{\mathrm{d}y}{\mathrm{d}x}  \color {red}{dx}= \color {red}{\int}  \sin x  \;\; \color {red}{dx}  \\
 \int \;\mathrm{d}y = \int \sin x \;\mathrm{d}x.$$
A: It is totally fine. You could write it as:
$$\frac{\mathrm{d}y}{\mathrm{d}x} = \sin x \Leftrightarrow \mathrm{d}y = \sin x \;\mathrm{d} x \Rightarrow \int \;\mathrm{d}y = \int \sin x \;\mathrm{d}x.$$
A: It is fine to go from $(1)$ to $(2)$ without showing any work other than stating that you multiplied by $dx$ and then integrated both sides.
In general, if you wanted to be more precise and see how the method of separation of variables works for any first order equation, you could let $g(x)=\sin x$ and $h(y)=1$. Then, the first order differential equation is a separable equation of the form
$$\frac{dy}{dx}=g(x)h(y),$$
where $y=f(x)$ is a solution. By manipulating terms, we can move the $x$'s and $dx$'s on one side of the equation and the $y$'s and $dy$'s on the other side so that we can solve the equation by integrating both sides:
$$\frac{1}{h(y)}\,dy=g(x)\,dx,$$
$$\int\frac{1}{h(y)}\,dy=\int g(x)\,dx,$$
which is known as the method of separation of variables. To justify the validity of the method, we need to show that the antiderivative of $1/h(y)$ as a function of $y$ equals the antiderivative of $x$ as a function of $x$. Starting from
$$\frac{dy}{dx}=g(x)h(y),$$
let $y=f(x)$ be a solution of the above equation. This implies that
$$f'(x)=g(x)h(f(x)),$$
$$\frac{f'(x)}{h(f(x))}=g(x).$$
Suppose $H(y)$ is any antiderivative of $1/h(y)$; so $H'(y)=1/h(y)$. Then, the chain rule implies that
\begin{align}
\frac{d}{dx}H(f(x))&=H'(f(x))f'(x)\\&=
\frac{1}{h(f(x))}f'(x)\\&=
g(x).
\end{align}
Therefore, the solution $y=f(x)$ satisfies the equation
$$H(f(x))=\int g(x)\,dx.$$
However, this is just the result of the method of separation of variables, which is to rewrite the differential equation as
$$\frac{1}{h(y)}\,dy = g(x)\,dx.$$
Then, integrate both sides (the left with respect to $y$ and the right with respect to $x$) obtaining an equation of the form
$$H(y)=\int g(x)\,dx,$$
which implicitly defines the solution $y=f(x)$. In your case, going directly from
$$\frac{dy}{dx}=\sin x \implies \int dy = \int \sin x \,dx, $$
is fine provided that you are aware that you can justify this by the method of separation of variables.
