Oh, those complex values!!!

*To*: mathgroup at smc.vnet.net*Subject*: [mg72068] Oh, those complex values!!!*From*: aaronfude at gmail.com*Date*: Mon, 11 Dec 2006 04:54:38 -0500 (EST)

Integrating a real function, getting complex values again. How to get the correct answer here? How to systematically avoid this pitfall? f=x Log[a+b x+Sqrt[c+2d x+x^2]]; t = Assuming[c>d^2&&a>0&&b>0,Integrate[f, x]]; u=t/.a\[Rule]2/.b\[Rule]2/.c\[Rule]10/.d\[Rule]1; N[u/.x\[Rule]1-u/.x\[Rule]0] 9.50705\[InvisibleSpace]-29.7626 \[ImaginaryI] NIntegrate[f/.a\[Rule]2/.b\[Rule]2/.c\[Rule]10/.d\[Rule]1, {x, 0, 1}] 0.954442 Many thanks in advance! Aaron Fude