Mathematica doesn't simplify an expression where n is a positive integer

Could someone help me to understand why Mathematica seems not see that (sin(nPi)=0) ?

 In[2]:= Integrate[t Sin[ 2 n t], {t, 0, \[Pi]},  Assumptions -> Element[n, Integers] && n > 0]

Out[2]= (-2 n \[Pi] Cos[2 n \[Pi]] + Sin[2 n \[Pi]])/(4 n^2)

Mathematica should “see” that Sin[n Pi] with n natural is always null, and thus give right the answer -Pi/(2*n) (n = 1..infinite)

What happens, what did I do wrong?

Thx to you.

bilik.miloslav@wanadoo.fr

Hi,

try

Assuming[m \[Element] Integers && m > 0, Integrate[t Sin[2 m t], {t, 0, Pi}]]

It also works with n, but I usually try to avoid n because there is a function N and sometimes that can be confusing.

Alternatively, you can first integrate and then simplify using assumptions:

FullSimplify[Integrate[t Sin[2 n t], {t, 0, Pi}], Assumptions -> n \[Element] Integers && n > 0]

Cheers,

Marco

Hi,
try
Assuming[m [Element] Integers && m > 0, Integrate[t Sin[2 m t], {t, 0, Pi}]]
It also works with n, but I usually try to avoid n because there is a function N and sometimes that can be confusing.
Cheers,
Marco

It’s magic and you’re great, many thx

Milos.

PS : I read your post with Outlook and thus, n apparates as dollar-n-dollar. Sorry, but I’m still curious abour the perhaps dysfunction of (Elements->..) ?

Hi Milos,

it’s not really magic -just syntax.

PS : I read your post with Outlook and thus, n apparates as
dollar-n-dollar. Sorry, but I’m still curious abour the perhaps
dysfunction of (Elements->..) ?

I don’t use Outlook, but the n comes from the markdown syntax that the community uses. It’s a bit like Latex and I instinctively use it for formatting text. If you read the post in a browser it will not show up.
Regarding the Element function I think it works just fine.

This function shows you what is going on in my line of code:

Assuming[m \[Element] Integers && m > 0, Integrate[t Sin[2 m t], {t, 0, Pi}]] // HoldForm // TreeForm

This here is what your code does:

That should help you to understand what is going on.

Cheers,

Marco

Check this MSE thread.
Also this one.

Also maybe these:

1

2

3