Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maple incorrect calculation with ShowSolution function

Tags:

maple

Maple solves the following problem incorrectly when using ShowSolution function which is in student.calculus1 package. It's works fine when the power of x variable is odd or when I write sin(n*x) but when I wrote x^(even number)cos(nx) it's calculated incorrectly. Or when I put a number instead of n it's calculated correctly. Do I miss something? :| Here is a screenshot:

When assume(n::integer). Maple says the answer is 0 which is also incorrect

like image 902
Afshin Mobayen Khiabani Avatar asked Aug 05 '26 09:08

Afshin Mobayen Khiabani


1 Answers

It looks like a bug (and I have submitted a bug report), going wrong at the first step.

As workaround, you could do this as a first step,

restart;
with(Student:-Calculus1):

ee := Int( x^2*cos(n*x), x=-Pi..Pi ):

new := rhs( Rule[parts, x^2, sin(n*x)/n]( ee ) ) assuming n::integer;

             -(Int(2*sin(n*x)*x/n, x = -Pi .. Pi))

ShowSolution( new ) assuming n::integer; 

which produces 4*(-1)^n*Pi/n^2 at the final step.

Or do those steps without the assumptions on n, and then simplify the final result under assuming n::integer.

like image 169
acer Avatar answered Aug 08 '26 17:08

acer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!