Integral[abs(sen(x))*cos(n*x), x,- π , π ]

coredump62 shared this problem 5 years ago
New

The command


Integral[abs(sen(x))*cos(n*x), x,- π , π ]


in CAS view is faulty, returns


((-2) * cos((n * π)) / (n^(2) - 1))


but the right answer is


(((-2) * cos((n * π))) - 2) / (n^(2) - 1)


you can obtain it with


Integral[-sen(x)*cos(n*x), x, - π , 0 ] + Integral[sen(x)*cos(n*x), x, 0, π ]


Regards . . . And apologize my poor english.


Martín


[co]GeoGebra 5.0.253.0-3D (20 June 2016)

Java: 1.7.0_45

Codebase: file:/usr/share/geogebra/

OS: Linux

Architecture: amd64 / null

Heap: 910MB

CAS: Giac/JNI

Graphics Card: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)

GL Version: 3.0 Mesa 10.3.2

Comments (2)

photo
1

That's due to the discontinuities in the function which are very difficult to deal with. If you use a specific value of "n" then you will get the correct answer

photo
1

Yes, the second way ( Integral[-sen(x)*cos(n*x), x, - π , 0 ] + Integral[sen(x)*cos(n*x), x, 0, π ] ) works fine and avoid abs.


We're trying to calculate the general formulae for Fourier coeff. of a function, so we didn't want to work with a specific value of n. Thank very much for your answer. Regards,


Martín

photo
© 2021 International GeoGebra Institute