First order ODE $ y'+y\cos x=3\cos x$ $$y'+y\cos x=3\cos x$$
When I find the integration factor it is $e^{\sin x}$, but as far as I know that has no solution when I try to complete this by integration by parts.
 A: $\textbf{hint}$ 
Try this
$$
y' + y\cos x = 3\cos x \implies y' = -(y-3)\cos x
$$
set $y-3 = v$ then we have
$$
v' = -v\cos x
$$
which is separable.
now to go by integrating factor. You have found the correct integrating factor.
$$
y\mathrm{e}^{\sin x} = 3\int \cos x \mathrm{e}^{\sin x} dx +
$$
now you have to solve the last integral
$$
\int \cos x \mathrm{e}^{\sin x} dx = \int \mathrm{e}^u du = \mathrm{e}^u + C
$$
here i used $u = \sin x$.
ps I was feeling n a good mood hence giving a complete answer.
A: If $y' + P(x)y = q(x)$ then $y=e^{-\int p(x) dx}(\int e^{\int p(x) dx}q(x) dx+c) $ is answer.
$m=e^{\int \cos xdx}=e^{sinx}$,  $y=e^{-\int \cos xdx}(\int3 e^{\int \cos xdx}cosx dx+c)=e^{-sinx}(\int3 e^{sinx}cosx dx+c)$ 
let $u=sinx\Rightarrow du=cosx dx$ thus
$$\int3 e^{sinx}cosx dx=\int3 e^{u}du=3e^{u}=3e^{sinx}$$ thus
$\color{red}{y=e^{-sinx}(3e^{sinx}+c})$
A: I would rather solve this ODE using the idea that the general solution of a linear ODE is given by the sum of the homogenous solution and the particular solution.


*

*Homogenous Solution: 
$$y_h'+\cos(x)y_h=0$$


Solving this yields $y_h=c_1e^{-\sin(x)}$.


*Particular Solution: You can use the systematic approach by the variation of constants $y_p=c(x)y_h$, where $c(x)$ is a funciton you need to find or you can simply guess the type of the solution. I will use the guessing procedure because it is faster :D. We try the ansatz $y_p=const$. Plugging in will result in $y_p=3$.


From this you can conclude that the general solution must be
$$y=y_h+y_p= c_1e^{-\sin(x)} +3$$ 
A: I would solve this with Fourier Transforms. 


*

*Differentiation is multiplication with a "ramp". 

*Multiplication in ordinary domain is convolution in Fourier domain.

*$\cos(x)$ is a sum of dirac impulses in the Fourier domain.


1,2 and 3 together will give you a linear equation system in the Fourier domain.
A: This integration factor also makes the differential equation exact. The implicit solution you can then find is
$$
y\; e^{\sin(x)} - 3\; e^{\sin(x)} = c,
$$
where $c$ is a constant that can be found with a boundary condition.
