Solution (source code)

= Solution

Use $u=\cos x$, so $du=-\sin x\,dx$. Up to an overall minus sign, the differential form becomes
$$
(2y+3y^4u)\,du+(u+4y^3u^2)\,dy=0.
$$
Seeking a <monomial integrating factor> $u^\alpha y^\beta$, equality of mixed <derivatives> gives
$$
2(\beta+1)=\alpha+1,\qquad3(\beta+4)=4(\alpha+2).
$$
These give $\alpha=1,\beta=0$, so the <integrating factor> in the original variables is
$$
\boxed{\mu(x)=\cos x}.
$$
One may verify exactness directly without relying on invertibility of the <cosine> substitution:
$$
\cos x\,[M\,dx+N\,dy]
=-d\left(y\cos^2x+y^4\cos^3x\right).
$$
Thus the implicit <first integral> is
$$
\boxed{y\cos^2x+y^4\cos^3x=C}.
$$
The equivalence with the <differential equation> holds directly where $\cos x\ne0$. The zero solution $y=0$ is included at $C=0$. At a zero of $\cos x$, the original graph equation requires $y=0$ for any finite <differentiable> continuation, so no extra finite graph with nonzero $y$ is created by multiplying by the vanishing factor. If one allows vertical parametrized integral curves of the differential form, $x=\pi/2+n\pi$ is also such a curve and is already contained in the level set $C=0$.