i am trying to integrate a real valued function. For some reason, Mathematica gives an answer in the complex domain. I'd be grateful for your answers.
Here is the integral:
Integrate[(-(Cos[b*s] - (2*Sin[b*s]*(a*D - b*C))/(a^2 + b^2))/E^(a*s))^2, {s, 1, ∞},
Assumptions -> Element[s, Reals]]
Mathematica produces the following:
ConditionalExpression[1/4 (1/a + 1/(2 a - 2 I b) + 1/(2 a + 2 I b) + (-1 + E^(-2 a))/a + (-1 + E^(-2 (a + I b)))/(2 (a + I b)) + (-1 + E^(-2 a + 2 I b))/(2 a - 2 I b) - (2 (b C - a D)^2 E^(-2 (a + I b)) (-2 b^2 E^(2 I b) + a^2 (-1 + E^(2 I b))^2 + I a b (-1 + E^(4 I b))))/(a (a^2 + b^2)^3) + (4 (b C - a D) E^(-2 a) (b Cos[2 b] + a Sin[2 b]))/(a^2 + b^2)^2), Abs[Im[b]] < Re[a] && Re[a] > 0]
Reduce
, but by hand.) $\endgroup$