1 | initial version |
Hello, @Nasser! This seems to be Fricas' fault, since it implements the log
function, but not the ln
function. However, Sage implements both; although the preferred name is log
.
When you call integrate("log(t)", t, algorithm="fricas")
, the following steps are executed:
ex = "log(t)"
if not isinstance(ex, Expression):
ex = SR(ex) # here ex becomes log(t), an Expression, not a string
ex= fricas(ex) # ex is translated to fricas representation
result = ex.integrate(fricas(t)) # we call the fricas' integrate function with the variable t converted to fricas
If you could print result
at this stage, you would get
t log(t) - t
which must be converted to Sage representation with the command
result.sage()
This shows you
t*log(t) - t
Notice the subtle difference between the Fricas representation and the Sage representation?
When you try to integrate an unknown function in Fricas, lets say func
, Fricas returns the not satisfactory, although completely correct answer
t
++
| func(%A)d%A
++
(This is what you get from the step result = ex.integrate(fricas(t))
that I mentioned before.) The problem here is that Fricas doesn't know how to integrate func
, so it returns an abstract representation of the integral. After translating that to Sage's representation (with the step result.sage()
mentioned above), it is shown as
integral(func(t), t)
which is the equivalent Sage representation of the abstract integral, and is also correct, but not satisfactory.
Remember: If you use an algorithm named as a software like fricas
for integrating, or solving, or differentiating, etc., you are actually using that software, which is external to Sage (although it interfaces to Sage), so you have to stick to the rues of that software.
I hope this clarifies your doubts!
2 | No.2 Revision |
Hello, @Nasser! This seems to be Fricas' fault, since it implements the log
function, but not the ln
function. However, Sage implements both; although the preferred name is log
.
When you call integrate("log(t)", t, algorithm="fricas")
, the following steps are executed:
ex = "log(t)"
if not isinstance(ex, Expression):
ex = SR(ex) # here ex becomes log(t), an Expression, not a string
ex= fricas(ex) # ex is translated to fricas representation
result = ex.integrate(fricas(t)) # we call the fricas' integrate function with the variable t converted to fricas
If you could print result
at this stage, you would get
t log(t) - t
which must be is finally converted to Sage representation with the command
result.sage()
This shows you
t*log(t) - t
Notice the subtle difference between the Fricas representation and the Sage representation?
When you try to integrate an unknown function in Fricas, lets say func
, Fricas returns the not satisfactory, although completely correct answer
t
++
| func(%A)d%A
++
(This is what you get from the step result = ex.integrate(fricas(t))
that I mentioned before.) The problem here is that Fricas doesn't know how to integrate func
, so it returns an abstract representation of the integral. After translating that to Sage's representation (with the step result.sage()
mentioned above), it is shown as
integral(func(t), t)
which is the equivalent Sage representation of the abstract integral, and is also correct, but not satisfactory.
Remember: If you use an algorithm named as a software like fricas
for integrating, or solving, or differentiating, etc., you are actually using that software, which is external to Sage (although it interfaces to Sage), so you have to stick to the rues of that software.
I hope this clarifies your doubts!
3 | No.3 Revision |
Hello, @Nasser! This seems to be Fricas' fault, since it implements the log
function, but not the ln
function. However, Sage implements both; although the preferred name is log
.
When you call integrate("log(t)", t, algorithm="fricas")
, the following steps are executed:
ex = "log(t)"
if not isinstance(ex, Expression):
ex = SR(ex) # here ex becomes log(t), an Expression, not a string
ex= fricas(ex) # ex is translated to fricas representation
result = ex.integrate(fricas(t)) # we call the fricas' integrate function with the variable t converted to fricas
If you could print result
at this stage, you would get
t log(t) - t
which is finally converted to Sage representation with the command
result.sage()
This shows you
t*log(t) - t
Notice the subtle difference between the Fricas representation and the Sage representation?
When you try to integrate an unknown function in Fricas, lets say func
, Fricas returns the not satisfactory, although completely correct answer
t
++
| func(%A)d%A
++
(This is what you get from the step result = ex.integrate(fricas(t))
that I mentioned before.) The problem here is that Fricas doesn't know how to integrate func
, so it returns an abstract representation of the integral. After translating that to Sage's representation (with the step result.sage()
mentioned above), it is shown as
integral(func(t), t)
which is the equivalent Sage representation of the abstract integral, and is also correct, but not satisfactory.
Remember: If you use an algorithm named as a software like fricas
for integrating, or solving, or differentiating, etc., you are actually using
This is what happens with ln
, which is unknown to Fricas. However, I agree with you
ln
to log
before applying the integral. I hope this clarifies your doubts!
4 | No.4 Revision |
Hello, @Nasser! This seems to be Fricas' fault, since it implements the log
function, but not the ln
function. However, Sage implements both; although the preferred name is log
.
When you call integrate("log(t)", t, algorithm="fricas")
, the following steps are executed:
ex = "log(t)"
if not isinstance(ex, Expression):
ex = SR(ex) # here ex becomes log(t), an Expression, not a string
ex= fricas(ex) # ex is translated to fricas representation
result = ex.integrate(fricas(t)) # we call the fricas' integrate function with the variable t converted to fricas
If you could print result
at this stage, you would get
t log(t) - t
which is finally converted to Sage representation with the command
result.sage()
This shows you
t*log(t) - t
Notice the subtle difference between the Fricas representation and the Sage representation?
When you try to integrate an unknown function in Fricas, lets say func
, Fricas returns the not satisfactory, although completely correct answer
t
++
| func(%A)d%A
++
(This is what you get from the step result = ex.integrate(fricas(t))
that I mentioned before.) The problem here is that Fricas doesn't know how to integrate func
, so it returns an abstract representation of the integral. After translating that to Sage's representation (with the step result.sage()
mentioned above), it is shown as
integral(func(t), t)
which is the equivalent Sage representation of the abstract integral, and is also correct, but not satisfactory.
This is what happens with ln
EDIT Based on the answer to this question
,SR
, is discourage and should be ln
to log
before applying the integral.I hope this helps!