## #51 Integrating problem of (a*x + b)^n dx general format

open
nobody
None
3
2008-04-14
2008-02-24
Valer Gonda
No

When integrate a function of general format
(a*x + b)^n dx
Maxima doesn't use the simplest formula.

In case of integrating (a*x + b)^n dx Maxima should use:

(a*x + b)^(n + 1)
―――――――――――――――― to calculate.
a * (n + 1)

That is:
n + 1
⌠ n (a∙x + b)
⌡(a∙x + b) dx = ―――――――――――――
a∙(n + 1)

For example:
4
⌠ 3 (5∙x - 2)
⌡(5∙x - 2) dx = ―――――――――――
20

## Discussion

• Valer Gonda - 2008-02-24

Logged In: YES
user_id=2018483
Originator: YES

That is:
n + 1
⌠ n (a∙x + b)
⌡(a∙x + b) dx = ――――――――――――――――
a∙(n + 1)

For example:
4
⌠ 3 (5∙x - 2)
⌡(5∙x - 2) dx = ―――――――――――
20

• Barton Willis - 2008-02-26

Logged In: YES
user_id=895922
Originator: NO

With 5.14.0, I get

(%i65) integrate((a*x + b)^n,x);
Is n + 1 zero or nonzero? nonzero;
(%o65) (a*x+b)^(n+1)/(a*(n+1))

Isn't this the answer you wanted?

• Raymond Toy - 2008-02-26

Logged In: YES
user_id=28849
Originator: NO

Barton,

Evaluate his test integral: integrate((5*x-2)^3,x);

The result is not (5*x-2)^4/20, but slightly different.

I don't consider this a problem.

• Barton Willis - 2008-02-26

Logged In: YES
user_id=895922
Originator: NO

Oh, okay -- we have

(%i1) integrate((5*x-2)^199,x);
(%o1) (5*x-2)^200/1000

(%i2) integrate((5*x-2)^3,x);
(%o2) (125*x^4)/4-50*x^3+30*x^2-8*x

Is there an option variable that controls the expansion of
the integrand / antiderivative?

• Raymond Toy - 2008-02-26

Logged In: YES
user_id=28849
Originator: NO

Ah, found it. Look in diffdiv in src/sin.lisp.

The first clause of the cond expression checks to see if the exponent is between 0 and 6 (exclusive). If so, it expands out the expression and integrates again. If not, it tries some other approach. Of course, there are no comments on why it does this and why 6.

• Stavros Macrakis - 2008-04-14

Logged In: YES
user_id=588346
Originator: NO

Maxima can't guarantee to use the simplest formula. There are various tradeoffs made internally....

Requesting that the result be in one form rather than another -- assuming they're both correct -- is a feature request not a bug report, so I have changed this item's type and lowered its priority.

• Stavros Macrakis - 2008-04-14
• labels: 840495 -->
• priority: 5 --> 3