MATLAB: Integral gives wrong answer

intintegrationlog10

Hey forum
When I solve this integral:
-x * (1/2) * int(log10(x)/x^2) + (1/2)*x^3 * int(log10(x)/x^4)
I get
(3*log(5) + 4)/(9*log(10))
which is the same as the answer from my other program:
(1/3)ยทlog10(x)+0.193
But this is wrong!
The real answer should be:
(4/9) + log10(x)/3
How can this be?
Frank

Best Answer

Hello Frank, This might be more of an observation than an answer, but one point not in your favor is that since log10(x) = log(x)/log(10), your entire integral is proportional to 1/log(10):
Int = (1/log(10)) * [ -x * (1/2) * int(log(x)/x^2) + (1/2)*x^3 * int(log(x)/x^4) ]
With the annoying log10 behavior out of there, the rest of the integral is
(1/3)log(x) + 4/9
and the entire answer is what your symbolic math programs are saying. However, there are a couple of indefinite integrals here and it's possible that there is an additional constant floating around having to do with the lower limit for x in the integrals (and of course things also depend on whether you are using log or log10 in the ODE).