# Integrating piecewise function in two variables

I want to find (and plot) the integral of a 'smooth' version of the Möbius function MoebiusMu[x]:

bump[x_, a_] :=
Piecewise[{{(Cos[2*Pi*x] + 1)/2, x - 1/2 < a < x + 1/2},
{0, True}}];
bumpmob[x_, b_] := Sum[MoebiusMu[a]*bump[x, a], {a, 1, b}];
Show[DiscretePlot[MoebiusMu[a], {a, 25}], Plot[{bumpmob[x, 25]},
{x, 0, 25}], GridLines -> Automatic]


I would like to integrate this function, but I'm not sure what syntax to use. Everything I try just seems to leave Mathematica evaluating without end - I suspect it's to do with either the fact that MoebiusMu[x] is a discrete function on integers only, or to do with having two variables.

I realise that this probably a very basic question (I have seen similar but much more complex questions on this site, but couldn't quite follow what was going on). Suggestions?

• Many definitions are missing from that code. What's MoebiusMu what's mob1 what's units – chris Jan 1 '19 at 11:36
• OP now edited. Apologies - cut and pasted the wrong thing. MoebiusMu[x] is the built-in expression for the Möbius function. – Richard Burke-Ward Jan 1 '19 at 12:08
• Probably you want :NIntegrate ? – Mariusz Iwaniuk Jan 1 '19 at 13:11
• Hmmm. What I'd really like is a piecewise general integral rather than a partial integral between specified values... – Richard Burke-Ward Jan 1 '19 at 13:22

Integrate[bumpmob[x, 25], x]

• It produces the standard symbol used in maths to mean 'integrate'. In other words, Mathematica evaluates Integrate[bumpmob[x, 25], x] as Integrate[bumpmob[x, 25], x]//TraditionalForm... – Richard Burke-Ward Jan 2 '19 at 13:45
• It is the Antiderivative of bumpmob, I think. And you are looking for what??? – Ulrich Neumann Jan 2 '19 at 18:32