The command

J := int(sin(x)/(x*(1-2*a*cos(x)+a^2)), x = 0 .. infinity)assuming a::real,a^2 <>0;

outputs 

(infinity*I)*signum(a^3*(Sum(a^_k1, _k1 = 0 .. infinity))-a^2*(Sum(a^_k1, _k1 = 0 .. infinity))-a*(Sum(a^(-_k1), _k1 = 0 .. infinity))+a^2+Sum(a^(-_k1), _k1 = 0 .. infinity)+a)

which is wrong in view of 

evalf(eval(J, a = 1/2));
                       Float(undefined) I

The correct answer is Pi/(4*a)*(abs((1+a)/(1-a))-1) according to G&R 3.792.6. Numeric calculations confirm it.


Please Wait...