MATLAB Answers

# Symbolic Integration Problem of Univariate Expression : Integral 1/x to ln(x) + c

5 views (last 30 days)
Herwin k on 27 Jul 2018
Commented: Herwin k on 27 Jul 2018
I just wrote a very simple integral like this:
clear, clc
syms x
f = 1/(3*x +1)
int(f)
And I got the wrong result as image below. Did I do something wrong? Is there anything i should know about this?
Thanks.
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Diwakar Ravichandran on 27 Jul 2018
Hi Herwin,
So going through your question,
Both the answers are correct. So, to clarify what I mean,
In your question you have mentioned that integral(1/x)=ln(x)+ C;
It is this C that plays a major role in both the answers.
If you take the answer that MATLAB has given you and take LCM(Least Common Multiple) of the term inside the log function, you get
ans=(log((3x+1)/3))/3 right?
By properties of logarithms, we have log(a/b)=log(a)-log(b);
So the answer can be written as
ans= (log(3x+1)-log 3)/3;
When you split the terms inside the parenthesis you get
ans= (log(3x+1)/3)-(log 3)/3;
log(3)/3 is a constant and shows in your answer as a part of C (The constant of Integration).
Hope this helps,
Cheers!
##### 1 CommentShowHide None
Herwin k on 27 Jul 2018
Hi, Ravi
So the way I see it, Matlab assuming the Constant integration value based on LCM inside log function, since we don't know the C value is.
Well, thanks for the explanation.

Sign in to comment.

R2018a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!