1. Senior Member
Join Date
Aug 2010
Posts
127
Rep Power
0

## Math.log1p=ln(x+1) instead of ln(x)

Simple question out of curiosity, why does Math.log1p return ln(x+1) instead of just ln(x)?

2. Originally Posted by imorio
Simple question out of curiosity, why does Math.log1p return ln(x+1) instead of just ln(x)?
ln(1+x) is mathematically quite a fundamental function (as is ln(x) which is another function/method in the Math class). The first derivative of ln(1+x) w.r.t. x is 1-x+x^2-x^3+x^4 ... and is a nice tool to construct other fundamental series with.

kind regards,

Jos

3. Senior Member
Join Date
Aug 2010
Posts
127
Rep Power
0
Ah ok, nice. I didn't see ln(x) was also in there. Thanks for the explanation.

4. Originally Posted by imorio
Ah ok, nice. I didn't see ln(x) was also in there. Thanks for the explanation.
You're welcome of course; a small correction: the first derivative is 1/(1+x). The Taylor expansion (at 0) is the series I mentioned.

kind regards,

Jos

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•