# Why 3 Different results for same Integral of a series?

I have the integral of a Series. According to some details, I get different outputs and I don't know which to rely on. Can anyone explain me the differences and if I am doing some mistakes?

IntegrandSerie1[x_, z_] =
Abs[ComplexExpand[
Series[-I (1 - ((1 - I)/2)*Sqrt[beta/2]*
Cosh[(1 - I)*z*
Sqrt[beta/2]]/(Sinh[(1 - I)/2*Sqrt[ beta/2]]))*(dWNorm[
x]), {beta, 0, 2}]]]^2
IntegralSerie1 =
Integrate[IntegrandSerie1[x, z], {x, -1, 1}, {z, -1/2, 1/2}]


In this case the output is:

(*Integrate[((21 + I*beta)*beta^2*dWNorm[x]^2)/15120, {x, -1, 1}]*)


First of all, I don't understand why I have an Imaginary unit after integrating the absolute value. Secondly, if I do not square the Abs, that is:

 IntegrandSerie1[x_, z_] =
Abs[Series[-I (1 - ((1 - I)/2)*Sqrt[beta/2]*
Cosh[(1 - I)*z*
Sqrt[beta/2]]/(Sinh[(1 - I)/2*Sqrt[ beta/2]]))*(dWNorm[
x]), {beta, 0, 2}]]
IntegralSerie1 =
Integrate[IntegrandSerie1[x, z], {x, -1, 1}, {z, -1/2, 1/2}]


the output is:

(*0*)


Why do I get 0 if I remove the squaring?

Finally, if I use //Normal as follows:

Abs[Series[-I (1 - ((1 - I)/2)*Sqrt[beta/2]*
Cosh[(1 - I)*z*
Sqrt[beta/2]]/(Sinh[(1 - I)/2*Sqrt[ beta/2]]))*(dWNorm[
x]), {beta, 0, 2}] // Normal]^2 // ComplexExpand
prova1 = Integrate[%, {x, -1, 1}, {z, -1/2, 1/2}]


I get in this case:

Integrate[(1/720)*beta^2*dWNorm[x]^2 + (beta^4*dWNorm[x]^2)/
1209600, {x, -1, 1}]


This last result seems more correct because there is no imaginary unit.

• What is dWNorm[x]? – Michael Seifert Apr 18 '17 at 14:02
• @MichaelSeifert I expected that question, but do you think that is relevant for my question? The results differ regardless the expression of dWNorm[x]. However, it is a simple Piecewise function of x. But its definition is not important to my problem in my opinion – Andrea G Apr 18 '17 at 14:47
• The results of the calculation you're trying to do (and the appropriate code to accomplish it) will definitely depend on whether dWNorm is a real-valued or complex-valued function. ComplexExpand might also treat it differently, depending on the particular functions and parameters you're using to define it. – Michael Seifert Apr 18 '17 at 14:50
• @MichaelSeifert I agree with that when thinking about the final result. However, I am still wondering why the intermediate results are so different, having left dWNorm in a generic undefined form. Particularly, I have doubts on that I (imaginary unit) and and the difference between first and last case, only due to the adding of //Normal – Andrea G Apr 18 '17 at 15:04