I am to solve the following initial value problem: $$\frac {dy}{dx}=(4+y)\cos x + 4x(4+y),\ y(0)=0$$
I am aware that the general formula for an ODE/IVP is: $$\frac {dy}{dx}+p(x)\cdot y=q(x),$$ and the integrating factor is: $$I(x)=e^{\int p(x)\ dx}$$ However, do I expand the terms and solve like this: $$\frac {dy}{dx}-\cos\ x\cdot y=4\cos x+4x(4+y)$$ so there are $p(x)$ and $y$ terms on the left and a $q(x)$ term on the right?
Integrating that is proving difficult and I think I have gone about arranging the equation wrong.
Thank you.
EDIT: This allows me to have: $$e^{\int -\cos(x)\ dx}$$ which is: $$e^{-\sin(x)}$$
\begin{align} \dfrac{dy}{dx}&=(4+y)\cos x + 4x(4+y)\\ \implies\dfrac{dy}{dx}&=y(\cos x+4x)+4(\cos x+4x)\\ \implies\dfrac{dy}{dx}-y(\cos x+4x)&=4(\cos x+4x)\hspace{25pt}\cdots\text{(i)}\\ \end{align}
Now (i) is in the form of $\dfrac{dy}{dx}+y\cdotp(x)=q(x)$.
So, Integrating Factor, $I.F.=e^{-\int(\cos x+4x)\:dx}=e^{-(\sin x+2x^2)}$ .
Therefore, (i) can be written as: \begin{align} \dfrac{d}{dx}\left[y\cdot e^{-(\sin x+2x^2)}\right]&=4(\cos x+4x)\cdot e^{-(\sin x+2x^2)}\\ \int d\left[y\cdot e^{-(\sin x+2x^2)}\right]&=4\int(\cos x+4x)\cdot e^{-(\sin x+2x^2)}\ dx+c\hspace{25pt} [c=\text{integration const.]}\\ y\cdot e^{-(\sin x+2x^2)}&=-4e^{-(\sin x+2x^2)}+c \end{align} Now, as $y(0)=0\implies c=4$.
Therefore solution is, $y\cdot e^{-(\sin x+2x^2)}=4\left[1-e^{-(\sin x+2x^2)}\right]$.