I see no reason to integrate when you just turn around and differentiate. With by the "Fundamental Theorem of Calculus", that the derivative of is just f(x), we get immediately your . And that does NOT satisfy the differential equation, again as you say.
HOWEVER, I think you have misread the problem. If , so that the denominator is the variable, not a constant, then the function becomes very hard to integrate but it is easy to use the "Fundamental Theorem of Calculus" to get . And that clearly does satisfy the equation.
(By the way, the constant in your integral should be cos(0)= 1, not cos(0)- but that was probably a typo.)