Solving the following integral $\int_1^c\frac{1}{x} \cos(a_nx)\mathrm{d}x\ $ Solve the following integral
 $$\int_1^c\frac{1}{x} \cos(a_nx)\mathrm{d}x$$
Where $$a_{n}=\frac{(2n-1)\pi}{2c}$$
What I tried:
I tried using integration by parts and I got an expression of the form 
$$\int_1^c\frac{2}{(a_n)^2x^3} \cos(a_nx)\mathrm{d}x
+\frac{1}{ca_n}\sin(a_nc)-\frac{1}{a_n}\sin(a_n)$$
which complicates the expression rather than solving it. I then tried  using wolfram alpha to solve the following integral but what it says is that the following integral cannot be solve by using the usual method found in calculus and it went on to solve using methods found in Complex Analysis (Which I dont quite get) and its final answer is in complex form. Could anyone explain to me how to solve the following integral and get the answer in the real form and not the complex form. Thanks
The answer found in my answer key gives $$\frac{(-1)^{n+1}}{a_n}$$
Thus this the final answer that I must arrive at.

The result you give is erroneous; here is a counterexample:
Taking $c=2$ and $n=1$, the integral has numerical value $0.28665...$ whereas $a_{n}=\frac{2c}{(2n-1)\pi}=\frac{4}{\pi}=1.2732...$
