Symbolic Toolbox Issue with symbolic integration

2 vues (au cours des 30 derniers jours)
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 19 Fév 2021
Commenté : Walter Roberson le 20 Fév 2021
There is an error problem in Symbolic toolbox while evaluating a symbolic integration formulation. Here is an example:
>> syms a b t; F = t/(a-b*t^2); int(F, t) % log() represents ln()
ans =
-log(b*t^2 - a)/(2*b)
% The correct answer is:
-(1/(2*b))*ln(a-b*t^2)
% Or a precisely accurate asnwer is:
-(1/(2*b))*ln(abs(a-b*t^2))
The QUESTION is how to make Symbolic MATH work accurately in such cases?
Thanks MUCH for any contributions and discussion in this regard.

Réponses (1)

Walter Roberson
Walter Roberson le 19 Fév 2021
The toolbox is correct.
The position of the division is obviously not an issue due to commutivity. P/R = 1/R * P
Switching the sign of the expression inside the log() is justifiably disconcerting and looks like a mistake at first. However:
log(A*B) = log(A) + log(B). Therefore log(-1*B) = log(-1) + log(B). Therefore log(-x) = log(x) + a constant that is log(-1)
So there is a difference of a constant between what you expect and what you got.
But notice that you did an indefinite integral. And indefinite integrals are always "plus a constant". log(-1) = 2*π*i just becomes part of the constant.
  1 commentaire
Walter Roberson
Walter Roberson le 20 Fév 2021
Why would it be included there? The description of int() is not the place to describe the theory of calculus and the theory of logarithms! It probably is not the place to list all of the integration algorithms it uses or to go through and discuss their implications and the ways they might surprise people!
"I do know how to interpret the math side of the problem."
Well you do now that I have explained it to you, but you called the results an "error" when it is a correct result that had a different form than you were expecting.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by