是否可以向 Maple int 添加集成规则?
is it possible to add an integration rule to Maple int?
我希望 Maple return ln(abs(x))
int(1/x,x)
而不是 ln(x)
。
有没有办法使用模式给出规则,以便 int
在这种情况下使用,就像在 Mathematica 中可以做的那样?即以某种方式覆盖 int
结果以获得上述特定结果?或者可能有一些可以设置的全局选项?
枫叶2018.1
程序方式:
REALINT2 := proc (f, x) local func, a;
func := int(f, x);
a := selectfun(func, ln);
`assuming`([simplify(eval(func, [seq(a[k] = map(proc (x) options operator, arrow;
abs(x) end proc, a[k]), k = 1 .. nops(a))]))], [x in real]) end proc:
REALINT2(1+1/x, x);
REALINT2(1/sin(x), x);
REALINT2(x/(x^2+1), x);
REALINT2(tan(x), x);
REALINT2((diff(f(x), x))/f(x), x);
REALINT2(1+1/abs(x), x);
`assuming`([REALINT2(1/x, x)], [x < 0])
# x + ln(|x|)
# ln(1 - cos(x)) - ln(|sin(x)|)
# 1 / 2 \
# - ln\x + 1/
# 2
# -ln(|cos(x)|)
# ln(|f(x)|)
# / x - ln(-x) x < 0
# |
# < undefined x = 0
# |
# \ x + ln(x) 0 < x
# ln(-x)
我希望 Maple return ln(abs(x))
int(1/x,x)
而不是 ln(x)
。
有没有办法使用模式给出规则,以便 int
在这种情况下使用,就像在 Mathematica 中可以做的那样?即以某种方式覆盖 int
结果以获得上述特定结果?或者可能有一些可以设置的全局选项?
枫叶2018.1
程序方式:
REALINT2 := proc (f, x) local func, a;
func := int(f, x);
a := selectfun(func, ln);
`assuming`([simplify(eval(func, [seq(a[k] = map(proc (x) options operator, arrow;
abs(x) end proc, a[k]), k = 1 .. nops(a))]))], [x in real]) end proc:
REALINT2(1+1/x, x);
REALINT2(1/sin(x), x);
REALINT2(x/(x^2+1), x);
REALINT2(tan(x), x);
REALINT2((diff(f(x), x))/f(x), x);
REALINT2(1+1/abs(x), x);
`assuming`([REALINT2(1/x, x)], [x < 0])
# x + ln(|x|)
# ln(1 - cos(x)) - ln(|sin(x)|)
# 1 / 2 \
# - ln\x + 1/
# 2
# -ln(|cos(x)|)
# ln(|f(x)|)
# / x - ln(-x) x < 0
# |
# < undefined x = 0
# |
# \ x + ln(x) 0 < x
# ln(-x)