matlab not displaying an approximated value of an improper integral?
Show older comments
I want to calculate an approximate value of an improper integral:
>> fun= 4./(x.*(1-x).*(2-x).*(pi.^2+(log(x./(1-x)).^2))
>> vpa(int(fun,0,1))
then matlab displays the result:
ans =
vpaintegral(4/(x*(log(-x/(x - 1))^2 + 2778046668940015/281474976710656)*(x - 1)*(x - 2)), x, 0, 1).
how can I get the approximate value of this improper integral? thanks in advance.
6 Comments
Hey Lahcen, I can not reproduce your results. Your fun variable is not correct. It seems there is a bracket missing at the end. But if I add it I do not get the answer you got. Have you done something beforehand? Can you show how you defined x and p? And make sure to "clear 'all'" at the start of the script
clear 'all'
syms x p
fun= 4./(x.*(1-x).*(2-x).*(p.^2+(log(x./(1-x)).^2))) % added bracket at the end
vpa(int(fun,0,1))
Dyuman Joshi
on 23 Aug 2023
Edited: Dyuman Joshi
on 23 Aug 2023
"But if I add it I do not get the answer you got"
If you check the term given by OP as the result and the final output of your code, they are the same (with a value substituted for p)
You can try solving numerically, but as there are singularities at x==0 and x==1, the result will not be accurate -
%p^2 value taken from above
p2=2778046668940015/281474976710656;
fun= @(x) 4./(x.*(1-x).*(2-x).*(p2+(log(x./(1-x)).^2)));
integral(fun,0,1)
@Dyuman Joshi good catch. I saw that but did not realise that p is probably just this numerical value then
p = 2778046668940015/281474976710656
Lahcen
on 23 Aug 2023
I had an inkling because of the value but wasn't sure due to the format of the value -
sqrt(2778046668940015/281474976710656)
Lahcen
on 24 Aug 2023
Moved: John D'Errico
on 28 Aug 2023
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











