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? :|
Asked
Active
Viewed 198 times
3

Afshin Mobayen Khiabani
- 1,079
- 10
- 21
1 Answers
2
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
.

acer
- 6,671
- 15
- 15
-
Yes... It turns out it's bug... I explained it to my prof and finally accepted it (math prof couldn'd accept that Maple had buds)... It's finnished but thank you you might have saved me in other projects. – Afshin Mobayen Khiabani Oct 29 '18 at 16:12