Message Boards Message Boards

15 Replies
6 Total Likes
View groups...
Share this post:

Error in Mathematica computation

Posted 9 years ago


In mathematica,

I tried to find

Integral of ln(1 + x)/(x^2 + 1) from 0 to 1

The answer is CLEARLY ln(2)pi/8

Mathematica computes the answer to be:

1/4 ln ([Pi] + Log[4])

Which is incorrect. Why is Mathematica computing this error??

15 Replies

Nice! Thanks

Posted 9 years ago

Capitalize log - should be Log.

POSTED BY: Douglas Kubler

Notebook attached.

POSTED BY: S M Blinder

Need Log

POSTED BY: S M Blinder

Is what I enter, I cant type the code for this, but this is what I do next.enter image description here

Then I press the definite x integral

That gives the incorrect answer.

f[x_] := Log[1+x]/(x^2+1);
Integrate[ f[x], {x, 0, 1}]
POSTED BY: Isaac Abraham

Here are some posting basics I will recommend. Think of them as courtesies you might provide to the reader.

(1) Input code instead of an image.

(2) Check the documentation. Mathematica is case sensitive.

(3) When you use a general phrase like "not working", consider the possibility that it might be working just fine.

(4) Read the responses carefully in order to be sure you are replicating what they show.

It is generally good practice to have a rudimentary familiarity with the software before making claims about bugs.

POSTED BY: Daniel Lichtblau

A shame I can only give you one vote for this... I think that your "courtesy rules" should go on



POSTED BY: Marco Thiel

The correct syntax is Integrate[ Log[1+x]/(x^2+1), {x, 0, 1}]. The only problem here was that "Log" is the correct form of "ln". You may have received the incorrect answers based on some prior definitions. It is mostly a good idea to clear memory before starting fresh computations, with Clear["Global*"]or at leastClearAll[variablename]` if the variable name is known.

POSTED BY: Isaac Abraham


But how can this work if I want to FIRST input the function, and use the drop down integral option?

It's impossible to cut and paste an image. It appears that this is your computation:

Integrate[ln*(1+x)/(1+x^2), {x,0,1}]

If so, you are making some erroneous assumptions. One is that "ln" and "Log" are viewed as the same entity in Mathematica. Another is that you are using correct syntax for what is, in Mathematica, Log[x+1]. Yet another is that the mistake, such as it is, is in the program and not the use thereof.

A general rule in software is as follows: blame the program after rather than before checking documentation, and even then consider the possibility that you may have missed something.

POSTED BY: Daniel Lichtblau


Its still not working,

enter image description here

Posted 9 years ago
POSTED BY: Douglas Kubler

That is interesting. I typed in

Integrate[Log[(1 + x)]/(x^2 + 1), {x, 0, 1}]

which gives

enter image description here

which is as you state: CLEARLY correct. I tried a while and did not find what could make Mathematica produce the output you report.


POSTED BY: Marco Thiel

That is very weird. This is what I did.

I first just typed ln(x+1)/(x^2 +1) then it gave me a definite integral option....

EDIT: natural log is the same as your log in Mathematica, then what is the issue?

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract