I have the following function:
$$ f(q,y)= \begin{cases} \tfrac{11720+p}{37791360} & -11720<p<-7720 \\ 0 & \text{True} \end{cases} $$
where $p = 443\ y-777600\ \sin^{-1}\left(\frac{q \lambda }{4 \pi }\right)$.
Mathematica Code:
f[q_,y_]=Piecewise[ {{(11720+443 y-777600 ArcSin[(q λ)/(4 π)])/37791360, -11720<443 y-777600 ArcSin[(q λ)/(4 π)]<-7720}}, 0] Now, if I take an indefinite integral over y,
weird[q_, y_] = Integrate[f[q, y], y] which gives
$$ g(q,y)= \begin{cases} \frac{293 y}{944784}+\frac{443 y^2}{75582720}-\frac{5}{243} y\ \sin^{-1}\left(\frac{\text{qy} \lambda }{4 \pi }\right) & -11720<p<-7720 \\ 0 & \text{True} \end{cases} $$
I can then evaluate this function at my endpoints {-1,1} to get the definite integral.
However, I could also have Mathematica run the definite integral directly.
weirder[q_, y_] = Integrate[f[q, y], {y, -1, 1}] which gives
Plain Text Version:
\[Piecewise] (293-19440 ArcSin[(q \[Lambda])/(4 \[Pi])])/472392 907/86400<ArcSin[(q \[Lambda])/(4 \[Pi])]<=1253/86400 (1/33483144960)(-111170729+29544134400 ArcSin[(q \[Lambda])/(4 \[Pi])]-1209323520000 ArcSin[(q \[Lambda])/(4 \[Pi])]^2-12006144000 I Log[4 \[Pi]]-604661760000 Log[4 \[Pi]]^2+12006144000 I Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]+1209323520000 Log[4 \[Pi]] Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]-604661760000 Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]^2) 7277/777600<ArcSin[(q \[Lambda])/(4 \[Pi])]<=907/86400 (1/33483144960)(147938569-37142841600 ArcSin[(q \[Lambda])/(4 \[Pi])]+1209323520000 ArcSin[(q \[Lambda])/(4 \[Pi])]^2+18226944000 I Log[4 \[Pi]]+604661760000 Log[4 \[Pi]]^2-18226944000 I Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]-1209323520000 Log[4 \[Pi]] Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]+604661760000 Log[I q \[Lambda]+Sqrt[16 \[Pi]^2-q^2 \[Lambda]^2]]^2) 1253/86400<ArcSin[(q \[Lambda])/(4 \[Pi])]<12163/777600 0 True This result, depending on my value of q, is different that the result given by the indefinite integral. Specifically of note are the log terms, which did not appear in the indefinite integral.
Why is the definite integral different from subtracting the end points of the indefinite integral? Which of these results should I trust?

Possible IssuessubsectionDefinite IntegralunderIntegratein documentation. $\endgroup$