Determine whether the given function is an integrating factor for the DE Suppose $$I(x,y)=\cos(xy)$$ Determine whether the $I(x,y)$ is an integrating factor for the following DE $$[\tan(xy)+xy]dx+x^2dy=0$$
My attempt is since the integrating factor is of 2 variables ( which is impossible ) hence it is not an integrating factor. Is my way of doing correct ?
 A: It seems that you are not familiar with differential forms, so let me explain a bit about them. For more, see the wikipedia.
A differential $1$-form $\alpha$ is (for the purposes of this question) an object specified by two functions $f$ and $g$ as $\alpha = f dx + g dy$. A $0$-form is a same thing as a function and there is an operation called exterior derivative and denoted $d$ that we can use to obtain a $(p+1)$-form from a $p$-form. Here we will be content with the $p=0$ case and note that from a $0$-form $V$ we obtain a $1$-form as
$$\alpha = dV = V_x dx + V_y dy.$$
We can say that the components of the $1$-form form components of the gradient $\nabla V$ (this holds because we work in a nice space $\mathbb R^2$). We will also note here that $d^2 = 0$, which at $1$-forms amounts to $V_{xy} = V_{yx}$, i.e. the interchangability of the partial derivatives (note therefore that we need to assume $V$ at least $C^2$). Now it holds that $d \alpha = 0$ (we say that $\alpha$ is closed) if and only if there is a $V$ such that $\alpha = dV$ (we say that $\alpha$ is exact). That exact forms are closed is trivial and follows from $d^2 = 0$, but the other direction is very non-trivial and holds here again because we are in a nice space $\mathbb R^2$. For more, see Poincaré lemma.
Right, let's return back to our differential equation. Using the above, we can interpret the differential equation as $1$-form $\alpha = f dx + g dy$. To ask whether there exists  an integrating factor means to ask whether there is a function you denote by $I$ such that $I\alpha = fI dx + gI dy$ is closed, ts precisely when $(fI)_y = (gI)_x$ and this is what you should check. In reality though, what we are really interested in is the question (an equivalent one, by the previous paragraph) of whether there exists a potential $V$ such that $V_x = fI$ and $V_y = gI$. 
A last remark on the connection between differential equations and differential forms. Note, that when the potential exists, the equation $dV = f dx + g dy = 0$ can be rewritten as $y' = -f/g$, which is the implicit function theorem (assuming $g$ is non-zero). But we can also interpret it as $\nabla V \cdot (dx, dy) = 0$ and this gives us a connection between the potential and the integral curves of the equation $-$ it says that gradient of the potential is orthogonal to the integral curves or, in simpler terms, that integral curves are the curves of constant potential. So, the integrating factor exists precisely when the integral curves of the differential equation have this peculiar property.
