While working on an engineering problem I needed to calculate this integral, so I typed it into the Wolfram Alpha and got this:

enter image description here

If you look at the logarithms, you will see that one of arguments have the opposite sign than the other. This means logarithms with negative arguments there, which means the result will definitely have imaginary terms. Why?

It doesn't look like there is a way to cancel the imaginary terms when I calculate a definite integral, but I think it's definitely possible to set the parameters and the range so the integrand remains real: large $a$, large $c$, small $b$ and the range of $x$ is around 0.

  • 1
    $\begingroup$ I think it just means the "$+$ constant" is a nonreal constant. $\endgroup$ Commented Jan 20, 2016 at 12:02
  • $\begingroup$ what is weird is that in wolfram $\text{Integrate Re[ ln(2*sqrt(a)*sqrt(a*x^2-b*x+c)+2*a*x-b)]}$ yields "no result" while $\text{Re[Integrate ln(2*sqrt(a)*sqrt(a*x^2-b*x+c)+2*a*x-b)]}$ yields $\text{Re[f(x)]}$ where $f$ is the function above $\endgroup$
    – reuns
    Commented Jan 20, 2016 at 12:28
  • $\begingroup$ Your function is not only real valued. With x=0 and c<0 you have a root out of a negative value there. $\endgroup$
    – Diego
    Commented Jan 20, 2016 at 12:33
  • $\begingroup$ @Diego of course it's not real valued everywhere. But the question ask why does it seem to give a complex number with an imaginary part when I perform a definite integral on a range where it remains real. $\endgroup$
    – Calmarius
    Commented Jan 20, 2016 at 13:07
  • $\begingroup$ @GerryMyerson But when I calculate a definite integral that constant vanishes anyway... $\endgroup$
    – Calmarius
    Commented Jan 20, 2016 at 13:14

1 Answer 1


apart from the already mentioned fact that $$ \ln(-a)=\ln(a)\pm i\pi $$ you can directly simplify the integral as $$ I=\int\ln\left(\sqrt{(2ax-b)^2+4ac-b^2}+(2ax-b)\right) dx \\=\frac1{2a}\int\ln\left(\sqrt{u^2+d}+u\right) du $$ which has a decided resemblance to the Arsinh function. This suggests to look at $$ \frac{d}{du}u·\ln\left(\sqrt{u^2+d}+u\right) = \ln\left(\sqrt{u^2+d}+u\right)+u·\frac{\frac{u}{\sqrt{u^2+d}}+1}{\sqrt{u^2+d}+u} \\= \ln\left(\sqrt{u^2+d}+u\right)+\frac{u}{\sqrt{u^2+d}} $$ (this is partial integration backwards), so that $$ \int\ln\left(\sqrt{u^2+d}+u\right) du = u·\ln\left(\sqrt{u^2+d}+u\right) - \sqrt{u^2+d} + C $$

Inserting this backwards gets one $$ I = \frac{2ax-b}{2a}·\ln\left(\sqrt{4a(ax^2-bx+c)}+2ax-b\right) - \frac1{2a}·\sqrt{4a(ax^2-bx+c)} + C $$ which up to variations of $\sqrt{4a}=2\sqrt{a}$ is the same anti-derivative as the one from WA.

  • $\begingroup$ If you can show me that this indefinite integral is equal to the one given by the Wolfram Alpha, I will accept this answer. $\endgroup$
    – Calmarius
    Commented Jan 20, 2016 at 21:08
  • $\begingroup$ Of course, you only need to insert backwards. $\endgroup$ Commented Jan 20, 2016 at 21:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .