4 Solving exact equations
As we have seen, the differential equation $\frac{d}{dx}\left(yx\right)=3{x}^{2}$ has solution $y={x}^{2}+C\u2215x$ . In the solution, ${x}^{2}$ is called the definite part and $C\u2215x$ is called the indefinite part (containing the arbitrary constant of integration). If we take the definite part of this solution, i.e. ${y}_{\text{d}}={x}^{2}$ , then
$\phantom{\rule{2em}{0ex}}\frac{d}{dx}\left({y}_{\text{d}}\cdot x\right)=\frac{d}{dx}\left({x}^{2}\cdot x\right)=\frac{d}{dx}\left({x}^{3}\right)=3{x}^{2}.$
Hence ${y}_{\text{d}}={x}^{2}$ is a solution of the differential equation.
Now if we take the indefinite part of the solution i.e. ${y}_{\text{i}}=C\u2215x$ then
$\phantom{\rule{2em}{0ex}}\frac{d}{dx}\left({y}_{\text{i}}\cdot x\right)=\frac{d}{dx}\left(\frac{C}{x}\cdot x\right)=\frac{d}{dx}\left(C\right)=0.$
It is always the case that the general solution of an exact equation is in two parts: a definite part ${y}_{\text{d}}\left(x\right)$ which is a solution of the differential equation and an indefinite part ${y}_{\text{i}}\left(x\right)$ which satisfies a simpler version of the differential equation in which the righthand side is zero.
Task!

Solve the equation
$\phantom{\rule{2em}{0ex}}\frac{d}{dx}\left(ycosx\right)=cosx$

Verify that the indefinite part of the solution satisfies the equation
$\phantom{\rule{2em}{0ex}}\frac{d}{dx}\left(ycosx\right)=0.$

Integrate both sides of the first differential equation:
$\phantom{\rule{2em}{0ex}}ycosx=\int cosx\phantom{\rule{0.3em}{0ex}}dx=sinx+C\phantom{\rule{2em}{0ex}}\text{leadingto}\phantom{\rule{2em}{0ex}}y=tanx+Csecx$

Substitute for
$y$
in the indefinite part (i.e. the part which contains the arbitrary constant) in the second differential equation:
The indefinite part of the solution is ${y}_{\text{i}}=Csecx$ and so ${y}_{\text{i}}cosx=C$ and
$\phantom{\rule{2em}{0ex}}\frac{d}{dx}\left({y}_{\text{i}}cosx\right)=\frac{d}{dx}\left(C\right)=0$