# Integrate message: can't prove Integration limits are real

I'm working on solving differential equations through Fourier series, I made a function to help me calculate the coefficients that looks like this:

bn[α_, T_, f_] := (2/T)*Integrate[f*Sin[((2*Pi*n)/T)*t], {t, α, T + α}]


And it was workng pretty well, until I tried to evaluate this:

bn[0, L, Piecewise[{{0, 0 < t < L/3}, {w, L/3 < t < 2*(L/3)}, {0, 2*(L/3) < t < L}}]]


And it gives me the error:

Integrate::pwrl: Unable to prove that integration limits {L} are real. Adding assumptions may help. >>

Any idea on what is causing/how to avoid the error? I tried using assumptions, but I guess I'm doing it wrong because it doens't help.

bn[α_, T_, f_] :=
Integrate[(2/T)*f*Sin[((2*Pi*n)/T)*t], {t, α, α + T}, Assumptions -> Element[T, Reals]]


### Edit

You mean enter the code like it is now? Sorry for the inconvenience, but the advanced help for the site sort of suggested that I used LaTeX.

• I changed the format as you suggested. I think... Is it good now? Commented Dec 2, 2013 at 4:39
• Thanks for the code addition. It does works well for non-piecewise defined functions f. I will pick at this later. Thanks for the post and the edit. You will get response in time I expect. My initial thought is to add code to deal with the piecewise defined cases in pieces. Commented Dec 2, 2013 at 4:51
• The problem is that it works for functions that have numeric limits such as: bn[-\[Pi], 2 \[Pi], \[Piecewise] { {-\[Pi], -\[Pi] < t < 0}, {\[Pi], 0 < t < \[Pi]} }] It does give me the expected result, I get stuck when I try to use variable periods T. Commented Dec 2, 2013 at 5:21

bn[a_, T_, f_] := 2/T Integrate[f Sin[(2 π n)/T t], {t, a, T + a},  Assumptions -> T ∈ Reals]

• Ok, I analyzed the results I got in paper vs the code vs step by step in mathematica. Your answer is correct, as it makes the code work, however it still gives me a different result from the one that I'm getting on paper (and my book agrees with). Seems like the problem has to do with the Integration itself, not the piecewise. I suppose it has to do with assumptions I'm making that mathematica isn't, but I don't know why. It'd boil down to an integrate of: C Integrate[Sin[D t],{t,L/3,2L3] With C, and D being constants related to the weight distributed over a stick of length L. Commented Dec 2, 2013 at 7:01